Disable periodic mail fetching by default
This commit is contained in:
parent
5573154fd4
commit
09cc41fc69
84
config.org
84
config.org
@ -49,7 +49,30 @@ needs to be set up to install them if they aren't already.
|
||||
(load-theme 'spacemacs-light t)
|
||||
#+end_src
|
||||
|
||||
* Org-mode
|
||||
* Autocompletion
|
||||
Enable =company-mode= globally, and hook it into =completion-at-point-functions=.
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package company
|
||||
:config
|
||||
(add-hook 'after-init-hook 'global-company-mode)
|
||||
(setf company-backends
|
||||
(cons 'company-capf company-backends)))
|
||||
#+end_src
|
||||
|
||||
And enable =ido-mode= everywhere, with flexible matching.
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package ido
|
||||
:config
|
||||
(setq ido-enable-flex-matching t)
|
||||
(add-hook 'after-init-hook
|
||||
(lambda ()
|
||||
(ido-everywhere)
|
||||
(ido-mode t))))
|
||||
#+end_src
|
||||
|
||||
* Org
|
||||
I use a couple non-standard bits and pieces, but not a whole
|
||||
bunch. I really like the =<s= to insert a source block thing (which
|
||||
was deprecated); =org-tempo= brings that back.
|
||||
@ -71,6 +94,13 @@ needs to be set up to install them if they aren't already.
|
||||
'org-insert-heading-after-current)))
|
||||
#+end_src
|
||||
|
||||
Org is nice for scratch space
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(setq initial-major-mode 'org-mode)
|
||||
(setq initial-scratch-message "")
|
||||
#+end_src
|
||||
|
||||
** Source Blocks
|
||||
Pressing tab inside a source block should indent appropriately for its
|
||||
language.
|
||||
@ -168,6 +198,12 @@ needs to be set up to install them if they aren't already.
|
||||
(add-hook 'after-init-hook 'org-roam-mode)
|
||||
#+end_src
|
||||
|
||||
Hook it into Ido.
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(setq org-roam-completion-system 'ido)
|
||||
#+end_src
|
||||
|
||||
** Default Applications
|
||||
It's all fun and games until =C-c C-e h o= opens the source code.
|
||||
|
||||
@ -177,15 +213,8 @@ needs to be set up to install them if they aren't already.
|
||||
(auto-mode . emacs)))
|
||||
#+end_src
|
||||
|
||||
* Start up
|
||||
Org is better suited as scratch space than Funamental, I'd say.
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(setq initial-major-mode 'org-mode)
|
||||
(setq initial-scratch-message "")
|
||||
#+end_src
|
||||
|
||||
* Magit
|
||||
* Version Control
|
||||
** Git
|
||||
=magit= is truly a wonderful creation! Only deviations from defaults
|
||||
here are a keybinding for =magit-status= and a maximum length for the
|
||||
summary line of commit messages (after which the excess is
|
||||
@ -349,15 +378,6 @@ needs to be set up to install them if they aren't already.
|
||||
(exwm-config-default))
|
||||
#+end_src
|
||||
|
||||
One annoying thing here is that the default config turns on
|
||||
=ido-mode=, which I don't really like. The solution is to not use
|
||||
the default config, but for the time being:
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(add-hook 'after-init-hook
|
||||
(lambda () (ido-mode nil)))
|
||||
#+end_src
|
||||
|
||||
*** Multi-monitor
|
||||
Multi-monitor support is provided in =exwm-randr=:
|
||||
|
||||
@ -495,12 +515,34 @@ needs to be set up to install them if they aren't already.
|
||||
** Automatic updating
|
||||
For updating through =mu4e= to actually work, [[help:mu4e-get-mail-command][mu4e-get-mail-command]]
|
||||
needs to be set to =offlineimap=. New mail can be then fetched
|
||||
regularly with [[help:mu4e-update-mail-and-index][mu4e-update-mail-and-index]] using [[help:run-with-timer][run-with-timer]].
|
||||
with [[help:mu4e-update-mail-and-index][mu4e-update-mail-and-index]].
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(setq mu4e-get-mail-command "offlineimap")
|
||||
#+end_src
|
||||
|
||||
Sometimes (like when waiting for on a particular email) it might be
|
||||
useful to have the update run periodically. This can be done with
|
||||
[[help:run-with-timer][run-with-timer]]. By only actually updating if ~fetch-mail~
|
||||
non-~nil~, we give ourselves a way to turn it off.
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(setq mu4e-get-mail-command "offlineimap")
|
||||
(defvar fetch-mail nil "Controls whether mail is periodically fetched.")
|
||||
(run-with-timer 0 120 (lambda ()
|
||||
(mu4e-update-mail-and-index t)))
|
||||
(when fetch-mail
|
||||
(mu4e-update-mail-and-index t))))
|
||||
#+end_src
|
||||
|
||||
And then we need something to run through =M-x= to do that:
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(defun toggle-mail-fetching ()
|
||||
"Toggle periodic mail fetching."
|
||||
(interactive)
|
||||
(setq fetch-mail (not fetch-mail))
|
||||
(message "Mail fetching %s"
|
||||
(if fetch-mail "enabled" "disabled")))
|
||||
#+end_src
|
||||
|
||||
** Mode-line alert
|
||||
|
Loading…
x
Reference in New Issue
Block a user