emacs: I probably won't run notmuch on termux, but...

This commit is contained in:
Pavel Korytov 2024-04-09 01:38:08 +03:00
parent 15aa993b83
commit aff40b3368
4 changed files with 29 additions and 6 deletions

View file

@ -1387,6 +1387,8 @@ Obeys `widen-automatically', which see."
(setq doom-modeline-persp-icon nil)
(setq doom-modeline-persp-name nil)
(setq doom-modeline-display-misc-in-all-mode-lines nil)
(when my/is-termux
(setopt doom-modeline-icon nil))
:config
(setq doom-modeline-minor-modes nil)
(setq doom-modeline-irc nil)
@ -6588,7 +6590,7 @@ ENTRY is an instance of `elfeed-entry'."
(lambda (&key error-thrown &allow-other-keys)
(message "Error!: %S" error-thrown))))))
(unless (or my/is-termux my/remote-server)
(unless (or my/remote-server)
(let ((mail-file (expand-file-name "mail.el" user-emacs-directory)))
(if (file-exists-p mail-file)
(load-file mail-file)

View file

@ -6,6 +6,10 @@
(let ((default-directory dir))
(normal-top-level-add-subdirs-to-load-path))))
(use-package notmuch
:straight t
:if my/is-termux)
(defun my/notmuch-toggle-trash ()
(interactive)
(evil-collection-notmuch-toggle-tag "trash" "search" #'ignore))
@ -69,6 +73,7 @@
(:name "pvkorytov (unread)" :query "tag:pvkorytov AND tag:unread" :key "vu")
(:name "pvkorytov (sent)" :query "tag:pvkorytov AND tag:sent" :key "vs")
(:name "pvkorytov (all mail)" :query "tag:pvkorytov" :key "va")))
(setq notmuch-show-empty-saved-searches t)
(general-define-key
:states '(normal visual)

View file

@ -2192,6 +2192,8 @@ References:
(setq doom-modeline-persp-icon nil)
(setq doom-modeline-persp-name nil)
(setq doom-modeline-display-misc-in-all-mode-lines nil)
(when my/is-termux
(setopt doom-modeline-icon nil))
:config
(setq doom-modeline-minor-modes nil)
(setq doom-modeline-irc nil)
@ -9156,7 +9158,7 @@ However, the quality of the output for Whisper is just so much better so I consi
My notmuch config now resides in [[file:Mail.org][Mail.org]].
#+begin_src emacs-lisp
(unless (or my/is-termux my/remote-server)
(unless (or my/remote-server)
(let ((mail-file (expand-file-name "mail.el" user-emacs-directory)))
(if (file-exists-p mail-file)
(load-file mail-file)

View file

@ -127,10 +127,15 @@ Notmuch is an email indexer program, which handles labels in a way somewhat simi
Not much is going on here.
First, the database path.
#+begin_src conf-unix
First, the database path. It's different on desktop and termux.
#+NAME: get-maildir-path
#+begin_src emacs-lisp :tangle no
(expand-file-name "~/Mail")
#+end_src
#+begin_src conf-unix :noweb yes
[database]
path=/home/pavel/Mail
path=<<get-maildir-path()>>
#+end_src
My name and list of emails. It's not like it's a secret anyhow.
@ -146,7 +151,8 @@ A list of tags which will be added by =notmuch new= and directory names which wi
#+begin_src conf-unix
[new]
tags=new;
ignore=.osync_workdir;.mbsyncstate;.uidvalidity;.lock;/.*gmailieer\.json.*/
# ignore=.osync_workdir;.mbsyncstate;.uidvalidity;.lock;/.*gmailieer\.json.*/
ignore=/.*[.](json|lock|bak|osync_workdir|mbsyncstate|uidvalidity)$/
#+end_src
Exclude these tags from search by default.
@ -382,6 +388,13 @@ Then, the problem with my Guix setup is that Emacs by default doesn't see the el
(normal-top-level-add-subdirs-to-load-path))))
#+end_src
On termux the above doesn't work so...
#+begin_src emacs-lisp
(use-package notmuch
:straight t
:if my/is-termux)
#+end_src
Some functions to toggle tags:
#+begin_src emacs-lisp
(defun my/notmuch-toggle-trash ()
@ -486,6 +499,7 @@ The following formats the tables above to a proper syntax for =setq notmuch-save
(setq notmuch-saved-searches
'((:name "drafts" :query "tag:draft" :key "d")
<<format-notmuch-saved-searches()>>))
(setq notmuch-show-empty-saved-searches t)
#+end_src
#+begin_src emacs-lisp