This repository provides a setup configuration for effortless syncing between notmuch and lieer using a simple elisp function (old version uses + script)
It nerved me a lot that every time I wanted to fetch new email using lieer I had to leave emacs (I do not use shell within emacs) and then run “gmi sync”. So, I wrote this.
- just fix the path so that points at your “mail” dir in your setup. Then, place the notmuch-sync.el file / or just copy the code in your emacs config (i.e. init file, or whatever your setup is).
"Syncs notmuch using lieer. ARG empty: Configuration file is /Users/+++/Mail/gmi-sync.sh." ... (no-output-shell-run "pushd /Users/+++/Mail ; gmi sync ; popd ; notmuch new") ... ;; and in the add-hook ... (no-output-shell-run "pushd /Users/+++/Mail && gmi sync && popd && notmuch new") ...
- Set the period variable (e.g. in your init)
(setq notmuch-sync-period 25) ;; fetch every 25 sec
- You can sync by using “.” (full stop) when you are in search-mode i.e. “inbox”. It does not work with the notmuch-hello buffer. However, in my configuration it is bound to “C-l s” so that I can sync without having to or be in the notmuch buffer. You can easily do that by un-commenting
;; (global-set-key (kbd "C-l s") 'notmuch-sync)
- I used a hook to automatically fetch email every 25 sec
- To change the time period, edit notmuch-sync-period variable
- To disable comment out the add-hook region
- Note 1: to change auto fetching email period edit notmuch-sync-period variable
- Note 2: If you like you can enable output in new window by commenting out
(no-output-shell-run "bash /Users/+++/Mail/gmi-sync.sh /Users/+++/Mail")
and using this instead
;;(shell-command "bash /Users/+++/Mail/gmi-sync.sh") ;; new window output