[PATCH] How to improve the mail handling workflow?

Jameson Rollins jrollins at finestructure.net
Fri Nov 12 07:33:33 PST 2010


On Fri, 12 Nov 2010 16:23:58 +0100, Matthieu Lemerre <racin at free.fr> wrote:
> The emacs interface to notmuch gets in my way in at least several
> manners:

Hi, Matthieu.  Here are some of the things I've done to deal with
similar issues:

>  - I often find myself hitting the spacebar too much, which ends up with
>    some of my new messages being removed from all of their tags, which
>    make them very difficult to find. I don't think the spacebar should
>    remove the inbox tag at all. It should only change the unread tag.

I agree that the function currently bound to space bar is annoying.  I
am actually in the middle of preparing a patch to fix this.  I think
that space should just scroll through the open messages.  I don't want
it to archive anything, or pop out of the currently viewed thread.  I
think this function is too aggressive as is.

>  - It does not provide a command for deleting mails. We were several
>    people who provided patches to add a 'd' keybinding to support
>    deletion. I provided a complex patch for that (that added "and not
>    tag:deleted" to all requests", but I now think that just adding a
>    "deleted" tag and removing the "inbox" tag would be sufficient).

I agree that some built-in support for handling "deleted" tags is called
for, but in the mean time it's very easy to make your own custom
functions to drop into your emacs config.  I have the following:

(define-key notmuch-search-mode-map "d"
  (lambda ()
    "delete thread and advance"
    (interactive)
    (notmuch-search-add-tag "deleted")
    (forward-line)))

(define-key notmuch-show-mode-map "d"
  (lambda ()
    "delete current message and advance"
    (interactive)
    (notmuch-show-add-tag "deleted")
    (notmuch-show-next-open-message-or-pop)))

(define-key notmuch-search-mode-map "u"
  (lambda ()
    "undelete thread"
    (interactive)
    (notmuch-search-remove-tag "deleted")))

(define-key notmuch-show-mode-map "u"
  (lambda ()
    "undelete current message"
    (interactive)
    (notmuch-show-remove-tag "deleted")))

I do *not* think that adding the "deleted" tag should remove the inbox
tag.  If you want to view your inbox without seeing the deleted
messages, then just use the search "tag:inbox and not tag:deleted".

>  - Processing mails which do not have any automatically added tag is
>    boring, because I need to press several keys to archive them: "+" to
>    add a tag, and then "a". If I forget about +, then my mail is
>    impossible to find.

Again, I achieve archiving with some simple custom functions:

(define-key notmuch-search-mode-map "a"
  (lambda ()
    "archive thread and advance"
    (interactive)
    (notmuch-search-remove-tag "inbox")
    (notmuch-search-remove-tag "unread")
    (forward-line)))

(define-key notmuch-show-mode-map "a"
  (lambda ()
    "archive current message and advance"
    (interactive)
    (notmuch-show-remove-tag "inbox")
    (notmuch-show-next-open-message-or-pop)))

(define-key notmuch-show-mode-map "i"
  (lambda ()
    "add current message to inbox"
    (interactive)
    (notmuch-show-add-tag "inbox")))

jamie.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20101112/9c9f13f2/attachment.pgp>


More information about the notmuch mailing list