Rudolf Adamkovič Personal site


Configuration: Ergonomic “toggle unread”

Toggling unread via j or - is slow.

Bind SPC to toggle the unread tag ergonomically.

(with-eval-after-load 'notmuch
  (keymap-set notmuch-search-mode-map
              "SPC"
              (defun my-notmuch-search-toggle-unread ()
                "Toggle unread and advance to the next thread."
                (interactive)
                (let* ((tag "unread")
                       (change (concat (if (member tag
                                                   (notmuch-search-get-tags))
                                           "-" "+")
                                       tag)))
                  (notmuch-search-tag (list change))
                  (notmuch-search-next-thread)))))

© 2025 Rudolf Adamkovič under GNU General Public License version 3.
Made with Emacs and secret alien technologies of yesteryear.