From d3eaad8f1ca14099df3a865f0a9023f4c1bbffea Mon Sep 17 00:00:00 2001 From: William Vaughn <365247+nackjicholson@users.noreply.github.com> Date: Thu, 3 Sep 2020 23:43:19 -0700 Subject: [PATCH 1/4] rm notmuch-hello customization Seeking to make this notmuch module behave more like vanilla notmuch to be less disorienting for users who are familiar with notmuch. The customizations of the notmuch-hello screen can easily be done in user configs by users that want those customizations. --- modules/email/notmuch/autoload.el | 2 +- modules/email/notmuch/config.el | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/modules/email/notmuch/autoload.el b/modules/email/notmuch/autoload.el index 49fdd745f..5ea31a47a 100644 --- a/modules/email/notmuch/autoload.el +++ b/modules/email/notmuch/autoload.el @@ -12,7 +12,7 @@ (if-let* ((buf (cl-find-if (lambda (it) (string-match-p "^\\*notmuch" (buffer-name (window-buffer it)))) (doom-visible-windows)))) (select-window (get-buffer-window buf)) - (notmuch-search "tag:inbox")) + (funcall +notmuch-home-function)) (+workspace/display)) ('error (+notmuch/quit) diff --git a/modules/email/notmuch/config.el b/modules/email/notmuch/config.el index 7cf7c8ccd..773116085 100644 --- a/modules/email/notmuch/config.el +++ b/modules/email/notmuch/config.el @@ -2,6 +2,9 @@ ;; FIXME This module is a WIP! +(defvar +notmuch-home-function #'notmuch + "Function for customizing the landing page for doom-emacs =notmuch.") + (defvar +notmuch-sync-backend 'gmi "Which backend to use. Can be either gmi, mbsync, offlineimap or nil (manual).") @@ -27,8 +30,6 @@ (set-popup-rule! "^\\*notmuch-hello" :side 'left :size 30 :ttl 0) (setq notmuch-fcc-dirs nil - notmuch-show-logo nil - notmuch-message-headers-visible nil message-kill-buffer-on-exit t message-send-mail-function 'message-send-mail-with-sendmail notmuch-search-oldest-first nil @@ -42,9 +43,6 @@ ("tags" . "(%s)")) notmuch-tag-formats '(("unread" (propertize tag 'face 'notmuch-tag-unread))) - notmuch-hello-sections - '(notmuch-hello-insert-saved-searches - notmuch-hello-insert-alltags) notmuch-saved-searches '((:name "inbox" :query "tag:inbox not tag:trash" :key "i") (:name "flagged" :query "tag:flagged" :key "f") @@ -52,8 +50,6 @@ (:name "drafts" :query "tag:draft" :key "d")) notmuch-archive-tags '("-inbox" "-unread")) - ;; (setq-hook! 'notmuch-show-mode-hook line-spacing 0) - ;; only unfold unread messages in thread by default (add-hook 'notmuch-show-hook #'+notmuch-show-expand-only-unread-h) From 16393e3af1d8ca77ec570a5cd89684383c664bf8 Mon Sep 17 00:00:00 2001 From: Will Vaughn <365247+nackjicholson@users.noreply.github.com> Date: Sat, 12 Sep 2020 12:53:21 -0700 Subject: [PATCH 2/4] Update notmuch documentation --- modules/email/notmuch/README.org | 39 +++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/modules/email/notmuch/README.org b/modules/email/notmuch/README.org index 9125f8dd4..d0fb31029 100644 --- a/modules/email/notmuch/README.org +++ b/modules/email/notmuch/README.org @@ -19,6 +19,8 @@ - [[#offlineimap][offlineimap]] - [[#mbsync][mbsync]] - [[#notmuch][notmuch]] + - [[#customize-notmuch-hello-buffer][Customize =*notmuch-hello*= buffer]] + - [[#changing-the-notmuch-landing-page][Changing the =notmuch= landing page]] - [[#troubleshooting][Troubleshooting]] * Description @@ -35,13 +37,19 @@ This module makes Emacs an email client, using ~notmuch~. * Prerequisites This module requires: -+ Either ~gmailieer~ (default), ~mbsync~ or ~offlineimap~ (to sync mail with) -+ ~notmuch~, to index and tag your downloaded messages. ++ Either ~[[https://github.com/gauteh/lieer][gmailieer]]~ (default), ~mbsync~ or ~offlineimap~ (to sync mail with) ++ ~[[https://notmuchmail.org/][notmuch]]~, to index and tag your downloaded messages. + ~afew~, optionally to initially tag your downloaded messages. - ** TODO MacOS ** TODO Arch Linux + +See: [[https://wiki.archlinux.org/index.php/Notmuch][Arch Wiki - Notmuch]] + +#+BEGIN_SRC sh +pacman -S notmuch +#+END_SRC + ** NixOS #+BEGIN_SRC nix environment.systemPackages = with pkgs; [ @@ -57,6 +65,7 @@ environment.systemPackages = with pkgs; [ ** TODO openSUSE ** TODO Debian/Ubuntu + * TODO Features * Configuration @@ -107,4 +116,28 @@ Before you can use =notmuch=, you need to index your email initially. notmuch new #+END_SRC +** Customize =*notmuch-hello*= buffer + +It is possible to change the =*notmuch-hello*= buffer if you want to. + +#+BEGIN_SRC emacs-lisp +(use-package! notmuch + :config + (setq notmuch-show-log nil + notmuch-hello-sections `(notmuch-hello-insert-saved-searches + notmuch-hello-insert-alltags) + ;; Maybe you don't like seeing email headers when you write email either. + notmuch-message-headers-visible nil)) +#+END_SRC + +** Changing the =notmuch= landing page + +You may want to forego the =*notmuch-hello*= buffer by having ~M-x =notmuch~ or ~SPC o m~ take you straight to a search page. + +When using ~SPC o m~ the =+notmuch-home-function= is called. By default it uses the =notmuch= function and so has the same familiar behavior of running a vanilla install of notmuch-emacs. But, by overwriting this function you can run a custom search as your landing page. + +#+BEGIN_SRC emacs-lisp +(setq +notmuch-home-function (lambda () (notmuch-search "tag:inbox"))) +#+END_SRC + * Troubleshooting From a0b661edac5754bb1c70fed6444cd802e61e35c1 Mon Sep 17 00:00:00 2001 From: Will Vaughn <365247+nackjicholson@users.noreply.github.com> Date: Thu, 26 Nov 2020 09:49:22 -0800 Subject: [PATCH 3/4] fix arch docs conflict --- modules/email/notmuch/README.org | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/email/notmuch/README.org b/modules/email/notmuch/README.org index d0fb31029..f92c16e09 100644 --- a/modules/email/notmuch/README.org +++ b/modules/email/notmuch/README.org @@ -42,14 +42,16 @@ This module requires: + ~afew~, optionally to initially tag your downloaded messages. ** TODO MacOS -** TODO Arch Linux +** Arch Linux +Run one of the following commands. +#+BEGIN_SRC sh +#sudo pacman -S isync notmuch #mbsync +## OR +#sudo pacman -S offlineimap notmuch +##+END_SRC See: [[https://wiki.archlinux.org/index.php/Notmuch][Arch Wiki - Notmuch]] -#+BEGIN_SRC sh -pacman -S notmuch -#+END_SRC - ** NixOS #+BEGIN_SRC nix environment.systemPackages = with pkgs; [ @@ -94,7 +96,7 @@ This module uses =Gmailier= by default. To use =mbsync=, change ~+notmuch-sync-b (setq +notmuch-sync-backend 'mbsync) #+END_SRC -The steps needed to set up =mu4e= with =mbsync= are very similar to the ones for +The steps needed to set up =notmuch= with =mbsync= are very similar to the ones for [[*offlineimap][offlineimap]]. Start with writing a ~\~/.mbsyncrc~. An example for GMAIL can be found on @@ -104,8 +106,6 @@ page]] contains all needed information to set up your own. Next you can download your email with ~mbsync --all~. This may take a while, but should be quicker than =offlineimap= ;). -You can now proceed with the [[*mu and mu4e][mu and mu4e]] section. - ** notmuch You should have your email downloaded already. If you have not, you need to set =Gmailier=, =offlineimap= or =mbsync= up before you proceed. From 1b81337d8d0bd359e61ece04307b22da5051d7d9 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 5 Mar 2021 20:57:25 -0500 Subject: [PATCH 4/4] email/notmuch: correct & reformat readme --- modules/email/notmuch/README.org | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/modules/email/notmuch/README.org b/modules/email/notmuch/README.org index f92c16e09..3ac0eb69e 100644 --- a/modules/email/notmuch/README.org +++ b/modules/email/notmuch/README.org @@ -44,11 +44,13 @@ This module requires: ** Arch Linux Run one of the following commands. + #+BEGIN_SRC sh -#sudo pacman -S isync notmuch #mbsync -## OR -#sudo pacman -S offlineimap notmuch -##+END_SRC +pacman -S isync notmuch #mbsync +#+END_SRC +#+BEGIN_SRC sh +pacman -S offlineimap notmuch +#+END_SRC See: [[https://wiki.archlinux.org/index.php/Notmuch][Arch Wiki - Notmuch]] @@ -117,12 +119,10 @@ notmuch new #+END_SRC ** Customize =*notmuch-hello*= buffer - It is possible to change the =*notmuch-hello*= buffer if you want to. #+BEGIN_SRC emacs-lisp -(use-package! notmuch - :config +(after! notmuch (setq notmuch-show-log nil notmuch-hello-sections `(notmuch-hello-insert-saved-searches notmuch-hello-insert-alltags) @@ -132,9 +132,13 @@ It is possible to change the =*notmuch-hello*= buffer if you want to. ** Changing the =notmuch= landing page -You may want to forego the =*notmuch-hello*= buffer by having ~M-x =notmuch~ or ~SPC o m~ take you straight to a search page. +You may want to forego the =*notmuch-hello*= buffer by having ~M-x =notmuch~ or +~SPC o m~ take you straight to a search page. -When using ~SPC o m~ the =+notmuch-home-function= is called. By default it uses the =notmuch= function and so has the same familiar behavior of running a vanilla install of notmuch-emacs. But, by overwriting this function you can run a custom search as your landing page. +When using ~SPC o m~ the =+notmuch-home-function= is called. By default it uses +the =notmuch= function and so has the same familiar behavior of running a +vanilla install of notmuch-emacs. But, by overwriting this function you can run +a custom search as your landing page. #+BEGIN_SRC emacs-lisp (setq +notmuch-home-function (lambda () (notmuch-search "tag:inbox")))