Emacs22 lacks apply-partially and mouse-event-p, so define them if emacs version is less than 23. With this change, I was able to begin using notmuch in emacs22. apply-partially cribbed from http://notmuchmail.org/pipermail/notmuch/2009/000889.html This is an updated patch that fixes a bug in the last version. --- notmuch.el | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/notmuch.el b/notmuch.el index 5577dde..20e82f1 100644 --- a/notmuch.el +++ b/notmuch.el @@ -67,6 +67,21 @@ (fset 'notmuch-show-stash-map notmuch-show-stash-map) +;; Old emacs lacks apply-partially +(when (< emacs-major-version 23) + (defun apply-partially (fun args) + "Return a function that is a partial application of FUN to ARGS. +ARGS is a list of the first N arguments to pass to FUN. +The result is a new function which does the same as FUN, except that +the first N arguments are fixed at the values with which this function +was called." + (lexical-let ((fun fun) (args1 args)) +(lambda ( args2) (apply fun (append args1 args2) + + (defun mouse-event-p (object) + "Return non-nil if OBJECT is a mouse click event." + (memq (event-basic-type object) '(mouse-1 mouse-2 mouse-3 mouse-movement + (defvar notmuch-show-mode-map (let ((map (make-sparse-keymap))) (define-key map "?" 'notmuch-help) -- 126.96.36.199
>What's your favorite thing about notmuch? The simple, functional emacs interface (rmail is too simple and Gnus too complex). Especially, I like the idea that many commands create new bufferes, that get deleted with "q", so that access to buffers is done like in a stack. >What about notmuch makes it distinctive compared to other email >programs? The idea of not having to sort mails manually, but rather be able to find them later thanks to fast searching. >If someone were to implement a new email system from scratch, but >capturing the "ideas" of notmuch, what would it have to have? I would encourage him to contribute to notmuch instead! I think notmuch only need some minor improvement of the UI interface. Maybe interaction with org-mode/calendar would also be nice. But if I were to reimplement notmuch, I would definitely have an emacs interface coupled with a command-line tool. Matthieu
also sprach Carl Worth [2010.02.26.2108 +0100]: >What's your favorite thing about notmuch? a. that it's an important step forward towards a completely tag-based e-mail setup b. that it is implemented with a library, a UI, and clients on top, rather than directly as a GUI. ;) >What about notmuch makes it distinctive compared to other email >programs? the prospect of tags and fast search, accessible in a way to make integration with other programs possible. >If someone were to implement a new email system from scratch, but >capturing the "ideas" of notmuch, what would it have to have? simplicity and search. Ideally, however, it would be implemented such that synchronising between different machines were a core feature. -- martin | http://madduck.net/ | http://two.sentenc.es/ if you see an onion ring -- answer it! spamtraps: madduck.bogus at madduck.net -- next part -- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature (see http://martin-krafft.net/gpg/) URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20100227/3d3dc69e/attachment.pgp>
Here they are; as I don't know how to include them in the body, I put the patches as attachments. I hope this will be convienient enough for you. Matthieu - racin at free.fr a ?crit : > Carl: The patch in the mail has problems; apparently I have to > manually add scissorlines to the mail for it > to be processed by git-am. I thought this was automatically added. (I > hate the git UI -- nothing is consistent, > concepts have different names, the definition of scissor lines is as > precise as "A line that mainly consists of scissors (either ">8" or > "8<") and perforation (dash "-") --, but I guess we can get used to it > after a while...) > > I'll send you a proper patch as soon as I can. Meanwhile, I'm sure you > have comments on this updated patch! > > Matthieu > -- next part -- A non-text attachment was scrubbed... Name: 0002-Add-support-for-deletion-in-the-emacs-interface.patch Type: text/x-diff Size: 5934 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20100227/548167d8/attachment.patch> -- next part -- A non-text attachment was scrubbed... Name: 0001-Add-and-use-notmuch-show-forall-in-thread-macro.patch Type: text/x-diff Size: 1581 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20100227/548167d8/attachment-0001.patch>
On Fri, 26 Feb 2010 11:24:44 -0800, Carl Worth wrote: > Then, I'd like to have a new, succinct and explicit syntax to indicate a > search that should return all results. For example, we could use '*' but > that has the issue that it would need escaping from the shell. But the > idea would be to be able to run: > > notmuch count '*' > > to count everything. Anyone have a better option for what the > give-me-everything syntax should be? notmuch count '' The search patterns limit the matched messages/folders. An empty pattern should match everything. dme. -- David Edmondson, http://dme.org
On Fri, 26 Feb 2010 12:08:49 -0800, Carl Worth wrote: > It seems clear that I'll have some opportunities to present notmuch to > various audiences at varying levels of formality. Since notmuch is > already a bigger project than me, I'd love to get some ideas from others > about what you think are the "big ideas" in notmuch. > > So here are a few different phrasings of what's basically the same > question. And I'd love to hear some brief opinions on any one of these, > (or similar topics): > >What's your favorite thing about notmuch? That it takes as long to download my mail from my server as it does to then process my inbox down to zero. (Though it doesn't yet allow me to complete all the tasks within in that time unfortunately.) >What about notmuch makes it distinctive compared to other email >programs? That the sucky things about it are bugs that will be fixed soon enough, rather than architectual problems that will never get fixed (with possibly one exception noted below.) >If someone were to implement a new email system from scratch, but >capturing the "ideas" of notmuch, what would it have to have? * Thread based * Tagging * Pervasive search * Speed * An amusing name The biggest un-good thing about notmuch right now for me is that it is effectively single-machine (though not hostile about it like sup). I want local mail for offline use (like right now,) but have more than one machine. It would be perfect if doing this didn't require notmuch on every client for it to work, with graceful degredation for those without it, though I would be perfectly happy with an android port. Thanks, James
On Fri, 26 Feb 2010 23:03:34 -0500, James Vasile wrote: > On Fri, 26 Feb 2010 20:33:08 -0500, micah anderson > wrote: > > > > Hey james, > > > > i really like your notmuch-retry bits, I've taken that shell script and > > integrated it into my tagging script, thanks! I'm curious if you are > > going to update your patch for notmuch.el ("Calls to notmuch get queued > > and executed asynchronously") to use this, or if you are going to have > > those two continue to be separate ways of retrying? > > Ah, I updated my local version and am putting it through its paces, but > it's already so much better that I should just send in the revised > patch. I'll clean it up and do that tomorrow. Insomnia: when it comes to sleep, my loss is your gain. I opened a github account and the updated bits are in the retry branch at git at github.com:jvasile/notmuch.git Carl, if you want the retry functionality, feel free to pull from there or request I post those patches to this list. Note that the retry branch depends on notmuch-retry being in your path, but 'make install' does not know about notmuch-retry. Next step for this branch is to have all errors go to *Notmuch errors* rather than error buffers named for the tag commands.
Here they are; as I don't know how to include them in the body, I put the patches as attachments. I hope this will be convienient enough for you. Matthieu - ra...@free.fr a écrit : Carl: The patch in the mail has problems; apparently I have to manually add scissorlines to the mail for it to be processed by git-am. I thought this was automatically added. (I hate the git UI -- nothing is consistent, concepts have different names, the definition of scissor lines is as precise as A line that mainly consists of scissors (either 8 or 8) and perforation (dash -) --, but I guess we can get used to it after a while...) I'll send you a proper patch as soon as I can. Meanwhile, I'm sure you have comments on this updated patch! Matthieu From 0073152e3fa7dd11d88de28e87eec7762cdbbbeb Mon Sep 17 00:00:00 2001 From: Matthieu Lemerre ra...@free.fr Date: Thu, 25 Feb 2010 00:25:51 +0100 Subject: [PATCH 2/2] Add support for deletion in the emacs interface Add d keybinding in notmuch-show and notmuch-summary to delete the current thread. Adds D keybinding to delete the current message in notmuch-show. Adds a deleted folder. Omit deleted items from searchs if no prefix arg. Adds history management to make searching deleted items more convenient. --- notmuch.el | 56 +--- 1 files changed, 49 insertions(+), 7 deletions(-) diff --git a/notmuch.el b/notmuch.el index 5d7342a..0285573 100644 --- a/notmuch.el +++ b/notmuch.el @@ -92,6 +92,8 @@ (define-key map x 'notmuch-show-archive-thread-then-exit) (define-key map A 'notmuch-show-mark-read-then-archive-thread) (define-key map a 'notmuch-show-archive-thread) +(define-key map d 'notmuch-show-delete-thread) +(define-key map D 'notmuch-show-delete-message) (define-key map p 'notmuch-show-previous-message) (define-key map N 'notmuch-show-mark-read-then-next-open-message) (define-key map n 'notmuch-show-next-message) @@ -380,6 +382,23 @@ buffer. (notmuch-show-archive-thread) (kill-this-buffer)) +(defun notmuch-show-delete-message () + Delete current message (sets its deleted tag). + (interactive) + (notmuch-show-add-tag deleted)) + +(defun notmuch-show-delete-thread() + Delete each message in thread. + (interactive) + (notmuch-show-forall-in-thread + (notmuch-show-delete-message))) + +(defun notmuch-show-delete-thread-and-exit() + Delete each message in thread, then exit back to search results. + (interactive) + (notmuch-show-delete-thread) + (kill-this-buffer)) + (defun notmuch-show-mark-read-then-archive-then-exit () Remove unread tags from thread, then archive and exit to search results. (interactive) @@ -1227,6 +1246,7 @@ matching this search term are shown if non-nil. (define-key map [mouse-1] 'notmuch-search-show-thread) (define-key map * 'notmuch-search-operate-all) (define-key map a 'notmuch-search-archive-thread) +(define-key map d 'notmuch-search-delete-thread) (define-key map - 'notmuch-search-remove-tag) (define-key map + 'notmuch-search-add-tag) (define-key map (kbd RET) 'notmuch-search-show-thread) @@ -1235,6 +1255,7 @@ matching this search term are shown if non-nil. (fset 'notmuch-search-mode-map notmuch-search-mode-map) (defvar notmuch-search-query-string) +(defvar notmuch-search-history nil) (defvar notmuch-search-oldest-first t Show the oldest mail first in the search-mode) @@ -1446,6 +1467,13 @@ This function advances the next thread when finished. (notmuch-search-remove-tag inbox) (forward-line)) +(defun notmuch-search-delete-thread () + Mark the currently selected thread as deleted (set its \deleted\ tag). +This function advances the next thread when finished. + (interactive) + (notmuch-search-add-tag deleted) + (forward-line)) + (defun notmuch-search-process-sentinel (proc msg) Add a message to let user know when \notmuch search\ exits (let ((buffer (process-buffer proc)) @@ -1520,10 +1548,22 @@ characters as well as `_.+-'. (append action-split (list notmuch-search-query-string) nil ;;;###autoload -(defun notmuch-search (query optional oldest-first) - Run \notmuch search\ with the given query string and display results. - (interactive sNotmuch search: ) - (let ((buffer (get-buffer-create (concat *notmuch-search- query * +(defun notmuch-search (query optional oldest-first include-deleted) + Run \notmuch search\ with the given query string and display results. + +With prefix argument, include deleted items. + + (interactive (let* ((prefix current-prefix-arg) + (query (if prefix + (read-string Notmuch search (including deleted): + notmuch-search-query-string + 'notmuch-search-history) + (read-string Notmuch search: nil + 'notmuch-search-history + (list query nil prefix))) + (let ((real-query (if include-deleted query + (concat not tag:deleted and ( query + (buffer