Disable periodic mail fetching by default
This commit is contained in:
parent
5573154fd4
commit
09cc41fc69
108
config.org
108
config.org
@ -49,7 +49,30 @@ needs to be set up to install them if they aren't already.
|
|||||||
(load-theme 'spacemacs-light t)
|
(load-theme 'spacemacs-light t)
|
||||||
#+end_src
|
#+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
|
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
|
bunch. I really like the =<s= to insert a source block thing (which
|
||||||
was deprecated); =org-tempo= brings that back.
|
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)))
|
'org-insert-heading-after-current)))
|
||||||
#+end_src
|
#+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
|
** Source Blocks
|
||||||
Pressing tab inside a source block should indent appropriately for its
|
Pressing tab inside a source block should indent appropriately for its
|
||||||
language.
|
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)
|
(add-hook 'after-init-hook 'org-roam-mode)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
Hook it into Ido.
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(setq org-roam-completion-system 'ido)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
** Default Applications
|
** Default Applications
|
||||||
It's all fun and games until =C-c C-e h o= opens the source code.
|
It's all fun and games until =C-c C-e h o= opens the source code.
|
||||||
|
|
||||||
@ -177,27 +213,20 @@ needs to be set up to install them if they aren't already.
|
|||||||
(auto-mode . emacs)))
|
(auto-mode . emacs)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Start up
|
* Version Control
|
||||||
Org is better suited as scratch space than Funamental, I'd say.
|
** 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
|
||||||
|
highlighted).
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq initial-major-mode 'org-mode)
|
(use-package magit
|
||||||
(setq initial-scratch-message "")
|
:bind
|
||||||
#+end_src
|
("C-x g" . magit-status)
|
||||||
|
:config
|
||||||
* Magit
|
(setq git-commit-summary-max-length 72))
|
||||||
=magit= is truly a wonderful creation! Only deviations from defaults
|
#+end_src
|
||||||
here are a keybinding for =magit-status= and a maximum length for the
|
|
||||||
summary line of commit messages (after which the excess is
|
|
||||||
highlighted).
|
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(use-package magit
|
|
||||||
:bind
|
|
||||||
("C-x g" . magit-status)
|
|
||||||
:config
|
|
||||||
(setq git-commit-summary-max-length 72))
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
* Language Integrations
|
* Language Integrations
|
||||||
Generally, 8-character-wide tabs are not my thing.
|
Generally, 8-character-wide tabs are not my thing.
|
||||||
@ -349,15 +378,6 @@ needs to be set up to install them if they aren't already.
|
|||||||
(exwm-config-default))
|
(exwm-config-default))
|
||||||
#+end_src
|
#+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
|
||||||
Multi-monitor support is provided in =exwm-randr=:
|
Multi-monitor support is provided in =exwm-randr=:
|
||||||
|
|
||||||
@ -495,14 +515,36 @@ needs to be set up to install them if they aren't already.
|
|||||||
** Automatic updating
|
** Automatic updating
|
||||||
For updating through =mu4e= to actually work, [[help:mu4e-get-mail-command][mu4e-get-mail-command]]
|
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
|
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
|
#+begin_src emacs-lisp
|
||||||
(setq mu4e-get-mail-command "offlineimap")
|
(setq mu4e-get-mail-command "offlineimap")
|
||||||
(run-with-timer 0 120 (lambda ()
|
|
||||||
(mu4e-update-mail-and-index t)))
|
|
||||||
#+end_src
|
#+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 ()
|
||||||
|
(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
|
** Mode-line alert
|
||||||
=mu4e-alert= provides a convenient little icon that shows up
|
=mu4e-alert= provides a convenient little icon that shows up
|
||||||
whenever =mu4e= has unread mail.
|
whenever =mu4e= has unread mail.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user