[notmuch] [PATCH] notmuch: improve installation of emacs mode
Excerpts from Jeffrey C. Ollie's message of Thu Nov 19 15:27:02 +0100 2009: > 1) Add a separate targets to build and install emacs mode. > > 2) Don't hardcode the installation directory, instead use emacs' >pkg-config module. > > 3) Install a byte compiled version of the emacs mode. > > 4) Install the emacs mode in emacs' site-start directory so that it >gets loaded automatically. > > 5) Ignore byte-compiled emacs files. > > Signed-off-by: Jeffrey C. Ollie Reviewed-by: Ingmar Vanhassel Thanks again! > --- > .gitignore |2 +- > Makefile |6 ++ > Makefile.local | 15 --- > 3 files changed, 19 insertions(+), 4 deletions(-) > > diff --git a/.gitignore b/.gitignore > index 8417d60..7d3c543 100644 > --- a/.gitignore > +++ b/.gitignore > @@ -5,4 +5,4 @@ notmuch.1.gz > *.[ao] > *~ > .*.swp > - > +*.elc > diff --git a/Makefile b/Makefile > index 023b2ec..17fa4a2 100644 > --- a/Makefile > +++ b/Makefile > @@ -7,6 +7,9 @@ CFLAGS=-O2 > extra_cflags := $(shell pkg-config --cflags glib-2.0 gmime-2.4 talloc) > extra_cxxflags := $(shell xapian-config --cxxflags) > > +emacs_lispdir := $(shell pkg-config emacs --variable sitepkglispdir) > +emacs_startdir := $(shell pkg-config emacs --variable sitestartdir) > + > # Now smash together user's values with our extra values > override CFLAGS += $(WARN_FLAGS) $(extra_cflags) > override CXXFLAGS += $(WARN_FLAGS) $(extra_cflags) $(extra_cxxflags) > @@ -28,6 +31,9 @@ include Makefile.config > %.o: %.c > $(CC) -c $(CFLAGS) $< -o $@ > > +%.elc: %.el > +emacs -batch -f batch-byte-compile $< > + > .deps/%.d: %.c > @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \ > $(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@.; \ > diff --git a/Makefile.local b/Makefile.local > index 6bc01a5..2bb4521 100644 > --- a/Makefile.local > +++ b/Makefile.local > @@ -1,5 +1,7 @@ > all: notmuch notmuch.1.gz > > +emacs: notmuch.elc > + > notmuch_client_srcs =\ > notmuch.c\ > notmuch-config.c\ > @@ -25,15 +27,22 @@ notmuch.1.gz: notmuch.1 > > install: all notmuch.1.gz > for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/share/man/man1 \ > -$(DESTDIR)/$(prefix)/share/emacs/site-lisp/ > $(DESTDIR)/etc/bash_completion.d/ ; \ > +$(DESTDIR)/etc/bash_completion.d/ ; \ > do \ > install -d $$d ; \ > done ; > install notmuch $(DESTDIR)$(prefix)/bin/ > install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/ > -install -m0644 notmuch.el $(DESTDIR)$(prefix)/share/emacs/site-lisp/ > install notmuch-completion.bash \ > $(DESTDIR)/etc/bash_completion.d/notmuch > > +install-emacs: install emacs > +for d in $(DESTDIR)/$(emacs_startdir) ; \ > +do \ > +install -d $$d ; \ > +done ; > +install -m0644 notmuch.el $(DESTDIR)$(emacs_startdir) > +install -m0644 notmuch.elc $(DESTDIR)$(emacs_startdir) > + > SRCS := $(SRCS) $(notmuch_client_srcs) > -CLEAN := $(CLEAN) notmuch $(notmuch_client_modules) > +CLEAN := $(CLEAN) notmuch $(notmuch_client_modules) notmuch.elc -- Exherbo KDE, X.org maintainer
[notmuch] Segfault searching for tags
On Thu, Nov 19, 2009 at 9:45 AM, Adrian Perez de Castro wrote: > On Wed, 18 Nov 2009 12:00:10 -0600, Jeffrey wrote: > >> Getting the following segfault with 306635c2 on Fedora 12. ?Seems to >> be happening with any 'tag:' search that returns results. ?For >> example, 'notmuch search tag:inbox' and 'notmuch search tag:unread' >> segfault but 'notmuch search tag:nosuchtag', 'notmuch search >> subject:logwatch' and 'notmuch search video' seem to work fine. >> >> Core was generated by `/usr/bin/notmuch search --sort=oldest-first >> tag:inbox'. >> Program terminated with signal 11, Segmentation fault. >> \#0 ?Xapian::TermIterator::operator* (this=) >> ? ? at api/omtermlistiterator.cc:78 >> 78 ? ? ? ?RETURN(internal->get_termname()); >> Current language: ?auto >> The current source language is "auto; currently c++". > > I have hit what I believe is exactly the same problem. In my case, some > results are printed when I execute "notmuch search tag:inbox", and then > the program crashes in the same exact place. > > The thing is that in notmuch_message_get_in_reply_to(), line 288, a NULL > instance of Xapian::TermIterator is dereferenced. In my particular case, > the culpript is a cache file of Claws-Mail, as seen in the following GDB > session: > [...] > As you can see, there "filename" points to a Claws-Mail cache file, which > is a binary file (I can provide a copy if needed). I suspect that this is > related to the fact that the iterator ends up being NULL somehow. I straced some of the crashes, and the last file that was read before the crash was a malformed message. I've attached one of the messages. I've been using offlineimap to sync my gmail mailbox to my laptop so that I can use notmuch. offlineimap isn't the most stable program, but I'm not sure yet if offlineimap is causing the problem or if that's the way the message is in gmail. -- Jeff Ollie -- next part -- Delivered-To: jeff at ollie.clive.ia.us Received: by 10.90.86.18 with SMTP id j18cs228556agb; Thu, 5 Nov 2009 22:23:50 -0800 (PST) Received: by 10.90.16.38 with SMTP id 38mr7468290agp.112.1257488620374; Thu, 05 Nov 2009 22:23:40 -0800 (PST) Return-Path: Received: from 209.85.223.101 ([116.208.64.100]) by mx.google.com with SMTP id 41si9046203iwn.112.2009.11.05.22.23.38; Thu, 05 Nov 2009 22:23:40 -0800 (PST) Received-SPF: neutral (google.com: 116.208.64.100 is neither permitted nor denied by best guess record for domain of xhutteesjj at yahoo.com.au) client-ip=116.208.64.100; Authentication-Results: mx.google.com; spf=neutral (google.com: 116.208.64.100 is neither permitted nor denied by best guess record for domain of xhutteesjj at yahoo.com.au) smtp.mail=xhutteesjj at yahoo.com.au Date: Thu, 05 Nov 2009 22:23:40 -0800 (PST) Received: from 146.2.76.118 by 116.208.64.100; Fri, 06 Nov 2009 03:20:42 -0300 Message-ID:
[notmuch] link error
Hi, Linking fails on my system for some reason (undefined references to talloc functions). Putting $(LDFLAGS) after the object list solves it. Peter diff --git a/Makefile.local b/Makefile.local index 27e42ba..c2fbe21 100644 --- a/Makefile.local +++ b/Makefile.local @@ -18,7 +18,7 @@ notmuch_client_srcs = \ notmuch_client_modules = $(notmuch_client_srcs:.c=.o) notmuch: $(notmuch_client_modules) lib/notmuch.a - $(CXX) $(LDFLAGS) $^ -o $@ + $(CXX) $^ $(LDFLAGS) -o $@ notmuch.1.gz: notmuch.1 gzip --stdout notmuch.1 > notmuch.1.gz
[notmuch] Segfault searching for tags
On Wed, 18 Nov 2009 12:00:10 -0600, Jeffrey wrote: > Getting the following segfault with 306635c2 on Fedora 12. Seems to > be happening with any 'tag:' search that returns results. For > example, 'notmuch search tag:inbox' and 'notmuch search tag:unread' > segfault but 'notmuch search tag:nosuchtag', 'notmuch search > subject:logwatch' and 'notmuch search video' seem to work fine. > > Core was generated by `/usr/bin/notmuch search --sort=oldest-first tag:inbox'. > Program terminated with signal 11, Segmentation fault. > \#0 Xapian::TermIterator::operator* (this=) > at api/omtermlistiterator.cc:78 > 78RETURN(internal->get_termname()); > Current language: auto > The current source language is "auto; currently c++". I have hit what I believe is exactly the same problem. In my case, some results are printed when I execute "notmuch search tag:inbox", and then the program crashes in the same exact place. The thing is that in notmuch_message_get_in_reply_to(), line 288, a NULL instance of Xapian::TermIterator is dereferenced. In my particular case, the culpript is a cache file of Claws-Mail, as seen in the following GDB session: Program received signal SIGSEGV, Segmentation fault. Xapian::TermIterator::operator* (this=) at api/omtermlistiterator.cc:78 78 RETURN(internal->get_termname()); Current language: auto The current source language is "auto; currently c++". (gdb) bt #0 Xapian::TermIterator::operator* (this=) at api/omtermlistiterator.cc:78 #1 0x0040f611 in _notmuch_message_get_in_reply_to(message=0x76dcd0) at lib/message.cc:288 #2 0x00412030 in _resolve_thread_relationships (thread=0x6a8b80) at lib/thread.cc:157 #3 0x00412454 in _notmuch_thread_create (ctx=0x65f1b0, notmuch=0x62d320, thread_id= 0x765530 "01b17ddb4479a0dc0b416bb63b92c43d", query_string=0x65f220 "tag:inbox") at lib/thread.cc:285 #4 0x00411982 in notmuch_query_search_threads (query=0x65f1b0, first=100, max_threads=-1) at lib/query.cc:218 #5 0x0040924d in do_search_threads (ctx=0x61f140, query=0x65f1b0, sort=NOTMUCH_SORT_NEWEST_FIRST, first=100, max_threads=-1) at notmuch-search.c:40 #6 0x004097ef in notmuch_search_command (ctx=0x61f140, argc=1, argv=0x7fffe188) at notmuch-search.c:164 #7 0x004066f1 in main (argc=3, argv=0x7fffe178) at notmuch.c:400 (gdb) frame 1 #1 0x0040f611 in _notmuch_message_get_in_reply_to (message=0x76dcd0) at lib/message.cc:288 288 in_reply_to = *i; (gdb) p *message $1 = {notmuch = 0x62d320, doc_id = 1, frozen = 0, message_id = 0x76db60 "", thread_id = 0x0, in_reply_to = 0x0, filename = 0x76dc50 "/home/aperez/.mail/inbox/.claws_cache", message_file = 0x0, replies = 0x76d250, doc = {internal = {dest = 0x76d450}}} As you can see, there "filename" points to a Claws-Mail cache file, which is a binary file (I can provide a copy if needed). I suspect that this is related to the fact that the iterator ends up being NULL somehow. I will experiment a bit more with this issue -- maybe just avoiding adding files whose name starts with a dot will suffice as temporary fix. Cheers, -- Adrian Perez de Castro Igalia - Free Software Engineering -- next part -- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20091119/5a6cbd02/attachment.pgp>
[notmuch] Mac OS X/Darwin compatibility issues
On Wed, Nov 18, 2009 at 04:24:42PM -0800, Alexander Botero-Lowry wrote: > On Thu, 19 Nov 2009 10:45:28 +1100, Stewart Smith flamingspork.com> wrote: > > On Wed, Nov 18, 2009 at 11:27:20PM +0100, Carl Worth wrote: > > > Yes. I knew I was "cheating" by using some GNU extensions here. I'm > > > happy to accept portability patches for these things, but it's hard for > > > me to get excited about writing them myself. > > > > > > Care to take a whack at these? > > > > http://www.gnu.org/software/gnulib/ > > > > could be a partial answer. > > > Why add yet another dependency for a couple of functions? Especially > considering how notmuch already depends on glib which includes portability > functions for various things. The idea with gnulib (at least what we've done with drizzle) is to just copy the bits you need into the tree. Does work pretty well for those small things that you just don't need to depend on a giant like glib for. -- Stewart Smith
[notmuch] [PATCH 2/2] notmuch list: A new command to produce various lists.
On Thu, Nov 19, 2009 at 3:41 PM, Carl Worth wrote: > On Thu, 19 Nov 2009 12:52:49 +0100, Jan Janak wrote: >> I implemented a new notmuch command that can be used to list all tags >> present in the database: > > Ah, very very interesting! I'd been planning on doing something like > this soon. And I was just thinking of "notmuch tags" as the command > line. What other ideas do you have in mind for "notmuch list" ? Yes, I considered "notmuch tags" too, but then I realized that we already have "notmuch tag" and I was worried that having both tag and tags as commands could be confusing. I was also thinking that "notmuch list" could be extended to list other terms than just tags, but I currently have no use-case for that. In any case, this is just an initial proposal, I can change it to use some other command name if you prefer that. > One way we could possibly do "notmuch tags" is to have it accept search > terms and then return the list of all tags from the matched messages. > Then of course we'd need a syntax for a search term to match all > messages, (which we want in any case). That sounds like a good idea. If the user does not provide any search terms then we could return all tags from the database like we do now. If there is a search term then we could iterate through all the messages that match it, collect their tags, sort them and present to the user. >> The main reason why I implemented this is because I am also working on >> adding the tag completion feature to the Emacs mode. This is very >> useful if you have a large collection of tags--it can save you some >> typing and, perhaps more importantly, it minimizes the risk of having >> typos in tag names. I'll send a patch for that later too. > > That will be a very nice feature to have, yes. > > The other reason I've wanted this is have something like a "folder view" > that would show a list of tags and a number of messages with each tag, > (or a number of messages with that tag and the inbox tag). Yeah, I would want that too :-). I've already looked into this and it seems like it should be easy to implement. At least it seems to be easy to get the numbers from Xapian. So we would just need to come up with a format for the list of tags with message counts, read it into emacs and present in a buffer. -- Jan
[notmuch] [PATCH 2/2] notmuch list: A new command to produce various lists.
On Thu, 19 Nov 2009 12:52:49 +0100, Jan Janak wrote: > I implemented a new notmuch command that can be used to list all tags > present in the database: Ah, very very interesting! I'd been planning on doing something like this soon. And I was just thinking of "notmuch tags" as the command line. What other ideas do you have in mind for "notmuch list" ? One way we could possibly do "notmuch tags" is to have it accept search terms and then return the list of all tags from the matched messages. Then of course we'd need a syntax for a search term to match all messages, (which we want in any case). > The main reason why I implemented this is because I am also working on > adding the tag completion feature to the Emacs mode. This is very > useful if you have a large collection of tags--it can save you some > typing and, perhaps more importantly, it minimizes the risk of having > typos in tag names. I'll send a patch for that later too. That will be a very nice feature to have, yes. The other reason I've wanted this is have something like a "folder view" that would show a list of tags and a number of messages with each tag, (or a number of messages with that tag and the inbox tag). I know that Keith said he'd prefer to use a view like that as his primary way of reading mail. Actual review of the patch later. -Carl
[notmuch] [PATCH 2/2] .gitignore: Add common editor droppings
On Wed, Nov 18, 2009 at 11:39 PM, Karl Wiberg wrote: > > Since these patterns are specific to a user rather than a project, > shouldn't they go in the user's ignore file (~/.gitignore) rather than > the project's? If every user could be counted on to put them in their personal .gitignore probably not, but I think that it's good practice to at least ignore the stuff that emacs and vim use for temporary files and backups. -- Jeff Ollie
[notmuch] [PATCH 2/2] Add a .desktop file entry.
This will add an entry in your window manager's menus that will create up a new emacs process and start notmuch. Signed-off-by: Jeffrey C. Ollie --- notmuch.desktop |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) create mode 100644 notmuch.desktop diff --git a/notmuch.desktop b/notmuch.desktop new file mode 100644 index 000..d29dff6 --- /dev/null +++ b/notmuch.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=Not Much Mail +Exec=emacs -f notmuch +Icon=emblem-mail +Terminal=false +Type=Application +Categories=Network;Email -- 1.6.5.2
[notmuch] [PATCH 1/2] Improve installation of emacs mode.
1) Add a separate targets to build and install emacs mode. 2) Don't hardcode the installation directory, instead use emacs' pkg-config module. 3) Install a byte compiled version of the emacs mode. 4) Install the emacs mode in emacs' site-lisp directory. Put "(require 'notmuch)" in your .emacs to load it automatically. 5) Ignore byte-compiled emacs files. Signed-off-by: Jeffrey C. Ollie --- .gitignore |2 +- Makefile |6 ++ Makefile.local | 15 --- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 8417d60..7d3c543 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,4 @@ notmuch.1.gz *.[ao] *~ .*.swp - +*.elc diff --git a/Makefile b/Makefile index 023b2ec..17fa4a2 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,9 @@ CFLAGS=-O2 extra_cflags := $(shell pkg-config --cflags glib-2.0 gmime-2.4 talloc) extra_cxxflags := $(shell xapian-config --cxxflags) +emacs_lispdir := $(shell pkg-config emacs --variable sitepkglispdir) +emacs_startdir := $(shell pkg-config emacs --variable sitestartdir) + # Now smash together user's values with our extra values override CFLAGS += $(WARN_FLAGS) $(extra_cflags) override CXXFLAGS += $(WARN_FLAGS) $(extra_cflags) $(extra_cxxflags) @@ -28,6 +31,9 @@ include Makefile.config %.o: %.c $(CC) -c $(CFLAGS) $< -o $@ +%.elc: %.el + emacs -batch -f batch-byte-compile $< + .deps/%.d: %.c @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \ $(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@.; \ diff --git a/Makefile.local b/Makefile.local index c44d160..ecd4ceb 100644 --- a/Makefile.local +++ b/Makefile.local @@ -1,5 +1,7 @@ all: notmuch notmuch.1.gz +emacs: notmuch.elc + notmuch_client_srcs = \ notmuch.c \ notmuch-config.c\ @@ -25,15 +27,22 @@ notmuch.1.gz: notmuch.1 install: all notmuch.1.gz for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/share/man/man1 \ - $(DESTDIR)/$(prefix)/share/emacs/site-lisp/ $(DESTDIR)/etc/bash_completion.d/ ; \ + $(DESTDIR)/etc/bash_completion.d/ ; \ do \ install -d $$d ; \ done ; install notmuch $(DESTDIR)$(prefix)/bin/ install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/ - install -m0644 notmuch.el $(DESTDIR)$(prefix)/share/emacs/site-lisp/ install notmuch-completion.bash \ $(DESTDIR)/etc/bash_completion.d/notmuch +install-emacs: install emacs + for d in $(DESTDIR)/$(emacs_lispdir) ; \ + do \ + install -d $$d ; \ + done ; + install -m0644 notmuch.el $(DESTDIR)$(emacs_lispdir) + install -m0644 notmuch.elc $(DESTDIR)$(emacs_lispdir) + SRCS := $(SRCS) $(notmuch_client_srcs) -CLEAN := $(CLEAN) notmuch $(notmuch_client_modules) +CLEAN := $(CLEAN) notmuch $(notmuch_client_modules) notmuch.elc -- 1.6.5.2
[notmuch] [PATCH] notmuch.el: Completion for tag names.
Add support for completion of tag names. Several commands ask the user for a tag name. With this feature the user can just press tab and emacs automatically retrieves the list of all existing tags from notmuch database with 'notmuch list tags' and presents a completion buffer to the user. Signed-off-by: Jan Janak --- notmuch.el | 22 +- 1 files changed, 17 insertions(+), 5 deletions(-) diff --git a/notmuch.el b/notmuch.el index 706e9f3..587e093 100644 --- a/notmuch.el +++ b/notmuch.el @@ -165,7 +165,8 @@ Unlike builtin `next-line' this version accepts no arguments." (defun notmuch-show-add-tag ( toadd) "Add a tag to the current message." - (interactive "sTag to add: ") + (interactive + (list (notmuch-tag-with-completion "Tag to add: "))) (apply 'notmuch-call-notmuch-process (append (cons "tag" (mapcar (lambda (s) (concat "+" s)) toadd)) @@ -174,7 +175,8 @@ Unlike builtin `next-line' this version accepts no arguments." (defun notmuch-show-remove-tag ( toremove) "Remove a tag from the current message." - (interactive "sTag to remove: ") + (interactive + (list (notmuch-tag-with-completion "Tag to remove: "))) (let ((tags (notmuch-show-get-tags))) (if (intersection tags toremove :test 'string=) (progn @@ -873,13 +875,22 @@ and will also appear in a buffer named \"*Notmuch errors*\"." (let ((end (- (point) 1))) (split-string (buffer-substring beg end)) +(defun notmuch-tag-with-completion (prompt) + (let ((tag-list +(with-output-to-string + (with-current-buffer standard-output +(call-process "notmuch" nil t nil "list" "tags") +(completing-read prompt (split-string tag-list "\n+" t) nil nil nil))) + (defun notmuch-search-add-tag (tag) - (interactive "sTag to add: ") + (interactive + (list (notmuch-tag-with-completion "Tag to add: "))) (notmuch-call-notmuch-process "tag" (concat "+" tag) (notmuch-search-find-thread-id)) (notmuch-search-set-tags (delete-dups (sort (cons tag (notmuch-search-get-tags)) 'string< (defun notmuch-search-remove-tag (tag) - (interactive "sTag to remove: ") + (interactive + (list (notmuch-tag-with-completion "Tag to remove: "))) (notmuch-call-notmuch-process "tag" (concat "-" tag) (notmuch-search-find-thread-id)) (notmuch-search-set-tags (delete tag (notmuch-search-get-tags @@ -964,7 +975,8 @@ current search results AND the additional query string provided." Runs a new search matching only messages that match both the current search results AND that are tagged with the given tag." - (interactive "sFilter by tag: ") + (interactive + (list (notmuch-tag-with-completion "Filter by tag: "))) (notmuch-search (concat notmuch-search-query-string " and tag:" tag) notmuch-search-oldest-first)) (defun notmuch () -- 1.6.3.3
[notmuch] [PATCH] Buttonize citation expander.
Currently the button has no action or special handling at all. --- notmuch.el | 15 +++ 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/notmuch.el b/notmuch.el index 1fc54c3..6a34282 100644 --- a/notmuch.el +++ b/notmuch.el @@ -453,10 +453,17 @@ which this thread was originally shown." (forward-line)) (let ((overlay (make-overlay beg-sub (point (overlay-put overlay 'invisible 'notmuch-show-citation) - (overlay-put overlay 'before-string - (concat indent - "[" (number-to-string (count-lines beg-sub (point))) - "-line citation. Press 'c' to show.]\n") + (let ( +(p (point)) +(cite-button-text (concat "[" (number-to-string (count-lines beg-sub (point))) + "-line citation. Press 'c' to show.]")) +) +(goto-char (- beg-sub 1)) +(insert (concat "\n" indent)) +(insert-button cite-button-text) +(insert "\n") +(goto-char (+ (length cite-button-text) p)) + (move-to-column depth) (if (looking-at notmuch-show-signature-regexp) (let ((sig-lines (- (count-lines beg-sub end) 1))) -- 1.6.5.2
[notmuch] [PATCH] notmuch: improve installation of emacs mode
Excerpts from Jeffrey C. Ollie's message of Thu Nov 19 14:12:48 +0100 2009: > 1) Add a separate install target to install emacs mode. Thanks > 2) Don't hardcode the installation directory, instead use emacs' >pkg-config module. > > 3) Install a byte compiled version of the emacs mode. > > 4) Install the emacs mode in emacs' site-start directory so that it >gets loaded automatically. > > Signed-off-by: Jeffrey C. Ollie > --- > Makefile |6 ++ > Makefile.local | 13 ++--- > 2 files changed, 16 insertions(+), 3 deletions(-) > > diff --git a/Makefile b/Makefile > index 023b2ec..17fa4a2 100644 > --- a/Makefile > +++ b/Makefile > @@ -7,6 +7,9 @@ CFLAGS=-O2 > extra_cflags := $(shell pkg-config --cflags glib-2.0 gmime-2.4 talloc) > extra_cxxflags := $(shell xapian-config --cxxflags) > > +emacs_lispdir := $(shell pkg-config emacs --variable sitepkglispdir) > +emacs_startdir := $(shell pkg-config emacs --variable sitestartdir) > + > # Now smash together user's values with our extra values > override CFLAGS += $(WARN_FLAGS) $(extra_cflags) > override CXXFLAGS += $(WARN_FLAGS) $(extra_cflags) $(extra_cxxflags) > @@ -28,6 +31,9 @@ include Makefile.config > %.o: %.c > $(CC) -c $(CFLAGS) $< -o $@ > > +%.elc: %.el > +emacs -batch -f batch-byte-compile $< > + Looking at this .. > .deps/%.d: %.c > @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \ > $(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@.; \ > diff --git a/Makefile.local b/Makefile.local > index 6bc01a5..e4a27e5 100644 > --- a/Makefile.local > +++ b/Makefile.local > @@ -1,4 +1,4 @@ > -all: notmuch notmuch.1.gz > +all: notmuch notmuch.1.gz notmuch.elc .. notmuch.elc requires emacs to build Maybe make emacs && make install-emacs? > > notmuch_client_srcs =\ > notmuch.c\ > @@ -25,15 +25,22 @@ notmuch.1.gz: notmuch.1 > > install: all notmuch.1.gz > for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/share/man/man1 \ > -$(DESTDIR)/$(prefix)/share/emacs/site-lisp/ > $(DESTDIR)/etc/bash_completion.d/ ; \ > +$(DESTDIR)/etc/bash_completion.d/ ; \ > do \ > install -d $$d ; \ > done ; > install notmuch $(DESTDIR)$(prefix)/bin/ > install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/ > -install -m0644 notmuch.el $(DESTDIR)$(prefix)/share/emacs/site-lisp/ > install notmuch-completion.bash \ > $(DESTDIR)/etc/bash_completion.d/notmuch > > +install-emacs: install notmuch.elc > +for d in $(DESTDIR)/$(emacs_startdir) ; \ > +do \ > +install -d $$d ; \ > +done ; > +install -m0644 notmuch.el $(DESTDIR)$(emacs_startdir) > +install -m0644 notmuch.elc $(DESTDIR)$(emacs_startdir) > + > SRCS := $(SRCS) $(notmuch_client_srcs) > CLEAN := $(CLEAN) notmuch $(notmuch_client_modules) -- Exherbo KDE, X.org maintainer
[notmuch] [PATCH 2/2] notmuch list: A new command to produce various lists.
Carl and others, I implemented a new notmuch command that can be used to list all tags present in the database: $ notmuch list tags If you run this, you'll get an alphabetically sorted list of all tags--one tag per line. The main reason why I implemented this is because I am also working on adding the tag completion feature to the Emacs mode. This is very useful if you have a large collection of tags--it can save you some typing and, perhaps more importantly, it minimizes the risk of having typos in tag names. I'll send a patch for that later too. Let me know what do you think. -- Jan On Thu, Nov 19, 2009 at 12:34 PM, Jan Janak wrote: > Here we create a new notmuch command called list. The purpose of the > command is to produce various lists from the notmuch database. > > At the moment we support only one command, notmuch list tags. This > command creates a list of all tags found in the database. > > Signed-off-by: Jan Janak > --- > ?Makefile.local ? | ? ?1 + > ?notmuch-client.h | ? ?3 ++ > ?notmuch-list.c ? | ? 98 > ++ > ?notmuch.c ? ? ? ?| ? 10 + > ?4 files changed, 112 insertions(+), 0 deletions(-) > ?create mode 100644 notmuch-list.c > > diff --git a/Makefile.local b/Makefile.local > index 27e42ba..fb6d5c3 100644 > --- a/Makefile.local > +++ b/Makefile.local > @@ -12,6 +12,7 @@ notmuch_client_srcs = ? ? ? ? \ > ? ? ? ?notmuch-show.c ? ? ? ? ?\ > ? ? ? ?notmuch-tag.c ? ? ? ? ? \ > ? ? ? ?notmuch-time.c ? ? ? ? ?\ > + ? ?notmuch-list.c ? ? ?\ > ? ? ? ?gmime-filter-reply.c ? ?\ > ? ? ? ?query-string.c ? ? ? ? ?\ > ? ? ? ?show-message.c > diff --git a/notmuch-client.h b/notmuch-client.h > index b65aa77..ae876b5 100644 > --- a/notmuch-client.h > +++ b/notmuch-client.h > @@ -114,6 +114,9 @@ notmuch_show_command (void *ctx, int argc, char *argv[]); > ?int > ?notmuch_tag_command (void *ctx, int argc, char *argv[]); > > +int > +notmuch_list_command (void *ctx, int argc, char *argv[]); > + > ?const char * > ?notmuch_time_relative_date (const void *ctx, time_t then); > > diff --git a/notmuch-list.c b/notmuch-list.c > new file mode 100644 > index 000..fe71108 > --- /dev/null > +++ b/notmuch-list.c > @@ -0,0 +1,98 @@ > +/* notmuch - Not much of an email program, (just index and search) > + * > + * Copyright ? 2009 Carl Worth > + * Copyright ? 2009 Jan Janak > + * > + * This program is free software: you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation, either version 3 of the License, or > + * (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ?See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program. ?If not, see http://www.gnu.org/licenses/ . > + * > + * Authors: Carl Worth > + * ? ? ? ? ?Jan Janak > + */ > + > +#include "notmuch-client.h" > + > +enum list_cmd { > + ? ? ? LIST_TAGS > +}; > + > + > +static int > +list_all_tags(notmuch_database_t* db) > +{ > + ? ? ? notmuch_tags_t* tags; > + ? ? ? const char* t; > + > + ? ? ? if ((tags = notmuch_database_get_tags(db)) == NULL) { > + ? ? ? ? ? ? ? fprintf(stderr, "Error while obtaining tags from the > database.\n"); > + ? ? ? ? ? ? ? return 1; > + ? ? ? } > + > + ? ? ? while((t = notmuch_tags_get(tags))) { > + ? ? ? ? ? ? ? printf("%s\n", t); > + ? ? ? ? ? ? ? notmuch_tags_advance(tags); > + ? ? ? } > + > + ? ? ? notmuch_tags_destroy(tags); > + ? ? ? return 0; > +} > + > +int > +notmuch_list_command (void *ctx, int argc, char *argv[]) > +{ > + ? ?notmuch_config_t *config; > + ? ?notmuch_database_t *db; > + ? ? ? enum list_cmd cmd; > + > + ? ? ? config = NULL; > + ? ? ? db = NULL; > + > + ? ? ? if (argc < 1) { > + ? ? ? ? ? ? ? fprintf(stderr, "Error: notmuch list requires at least one > parameter.\n"); > + ? ? ? ? ? ? ? fprintf(stderr, "(See notmuch help list)\n"); > + ? ? ? ? ? ? ? goto error; > + ? ? ? } > + > + ? ? ? if (!strcmp(argv[0], "tags")) { > + ? ? ? ? ? ? ? cmd = LIST_TAGS; > + ? ? ? } else { > + ? ? ? ? ? ? ? fprintf(stderr, "Sub-command '%s' not supported.\n", argv[0]); > + ? ? ? ? ? ? ? goto error; > + ? ? ? } > + > + ? ?if ((config = notmuch_config_open (ctx, NULL, NULL)) == NULL) { > + ? ? ? ? ? ? ? goto error; > + ? ? ? } > + > + ? ?db = notmuch_database_open (notmuch_config_get_database_path (config)); > + ? ?if (db == NULL) { > + ? ? ? ? ? ? ? goto error; > + ? ? ? } > + > + ? ? ? switch(cmd) { > + ? ? ? case LIST_TAGS: > + ? ? ? ? ? ? ? if (list_all_tags(db) != 0) goto error; > + ? ? ? ? ? ? ? break; > + > + ? ? ? default: > + ? ? ? ? ? ? ? fprintf(stderr, "Unsupported command: bug in > notmuch_list_command.\n"); > + ? ? ? ? ? ? ? goto error; > + ? ? ? } > + > + ?
[notmuch] Mac OS X/Darwin compatibility issues
On Thu, 19 Nov 2009 16:42:42 +1100, Stewart Smith wrote: > > The idea with gnulib (at least what we've done with drizzle) is to > just copy the bits you need into the tree. Does work pretty well for > those small things that you just don't need to depend on a giant like > glib for. Looks like that's the intended mode of usage for gnulib: Its components are intended to be shared at the source level, rather than being a library that gets built, installed, and linked against. Thus, there is no distribution tarball; the idea is to copy files from Gnulib into your own source tree. That does sound like exactly what we need for getting portable implementations of the few GNU-extension functions we're using here. So thanks for sharing this. -Carl
[notmuch] [PATCH 2/2] notmuch list: A new command to produce various lists.
Here we create a new notmuch command called list. The purpose of the command is to produce various lists from the notmuch database. At the moment we support only one command, notmuch list tags. This command creates a list of all tags found in the database. Signed-off-by: Jan Janak --- Makefile.local |1 + notmuch-client.h |3 ++ notmuch-list.c | 98 ++ notmuch.c| 10 + 4 files changed, 112 insertions(+), 0 deletions(-) create mode 100644 notmuch-list.c diff --git a/Makefile.local b/Makefile.local index 27e42ba..fb6d5c3 100644 --- a/Makefile.local +++ b/Makefile.local @@ -12,6 +12,7 @@ notmuch_client_srcs = \ notmuch-show.c \ notmuch-tag.c \ notmuch-time.c \ +notmuch-list.c \ gmime-filter-reply.c\ query-string.c \ show-message.c diff --git a/notmuch-client.h b/notmuch-client.h index b65aa77..ae876b5 100644 --- a/notmuch-client.h +++ b/notmuch-client.h @@ -114,6 +114,9 @@ notmuch_show_command (void *ctx, int argc, char *argv[]); int notmuch_tag_command (void *ctx, int argc, char *argv[]); +int +notmuch_list_command (void *ctx, int argc, char *argv[]); + const char * notmuch_time_relative_date (const void *ctx, time_t then); diff --git a/notmuch-list.c b/notmuch-list.c new file mode 100644 index 000..fe71108 --- /dev/null +++ b/notmuch-list.c @@ -0,0 +1,98 @@ +/* notmuch - Not much of an email program, (just index and search) + * + * Copyright ?? 2009 Carl Worth + * Copyright ?? 2009 Jan Janak + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/ . + * + * Authors: Carl Worth + * Jan Janak + */ + +#include "notmuch-client.h" + +enum list_cmd { + LIST_TAGS +}; + + +static int +list_all_tags(notmuch_database_t* db) +{ + notmuch_tags_t* tags; + const char* t; + + if ((tags = notmuch_database_get_tags(db)) == NULL) { + fprintf(stderr, "Error while obtaining tags from the database.\n"); + return 1; + } + + while((t = notmuch_tags_get(tags))) { + printf("%s\n", t); + notmuch_tags_advance(tags); + } + + notmuch_tags_destroy(tags); + return 0; +} + +int +notmuch_list_command (void *ctx, int argc, char *argv[]) +{ +notmuch_config_t *config; +notmuch_database_t *db; + enum list_cmd cmd; + + config = NULL; + db = NULL; + + if (argc < 1) { + fprintf(stderr, "Error: notmuch list requires at least one parameter.\n"); + fprintf(stderr, "(See notmuch help list)\n"); + goto error; + } + + if (!strcmp(argv[0], "tags")) { + cmd = LIST_TAGS; + } else { + fprintf(stderr, "Sub-command '%s' not supported.\n", argv[0]); + goto error; + } + +if ((config = notmuch_config_open (ctx, NULL, NULL)) == NULL) { + goto error; + } + +db = notmuch_database_open (notmuch_config_get_database_path (config)); +if (db == NULL) { + goto error; + } + + switch(cmd) { + case LIST_TAGS: + if (list_all_tags(db) != 0) goto error; + break; + + default: + fprintf(stderr, "Unsupported command: bug in notmuch_list_command.\n"); + goto error; + } + +notmuch_database_close (db); +return 0; + +error: + if (db) notmuch_database_close(db); + return 1; +} diff --git a/notmuch.c b/notmuch.c index 5cc8e4c..1baa22d 100644 --- a/notmuch.c +++ b/notmuch.c @@ -230,6 +230,16 @@ command_t commands[] = { "\t\tSo if you've previously been using sup for mail, then the\n" "\t\t\"notmuch restore\" command provides you a way to import\n" "\t\tall of your tags (or labels as sup calls them)." }, + { "list", notmuch_list_command, + "", + "\t\tShow additional information about the database.", + "\t\tThe following sub-commands are supported:" + "\n\n" + "\t\ttags\n" + "\n" + "\t\t\tGenerate a list of all tags available in the database.\n" + "\t\t\tThe list will be sorted alphabetically." + }, { "help", notmuch_help_command, "[]", "\t\tThis message, or more detailed help
[notmuch] [PATCH 1/2] notmuch: Support for notmuch_database_get_tags
This patch adds a new function called notmuch_database_get_tags which can be used to obtain a list of all tags defined in the database (that is, the list all tags from all messages). The function produces an alphabetically sorted list. To add support for the new function, we rip the guts off of notmuch_message_get_tags and put them in a new generic function called _notmuch_convert_tags. The generic function takes a TermIterator as argument and produces a notmuch_tags_t list of tags. Function notmuch_message_get_tags is then reimplemented to call the generic function with message->doc.termlist_begin() as argument. Similarly, we implement notmuch_message_database_tags, the function calls the generic function with db->xapian_db->allterms_begin() as argument. Finally, notmuch_database_get_tags is exported through lib/notmuch.h Signed-off-by: Jan Janak --- lib/database.cc | 48 lib/message.cc | 38 ++ lib/notmuch.h |4 3 files changed, 58 insertions(+), 32 deletions(-) diff --git a/lib/database.cc b/lib/database.cc index 4998fc9..b1c15c3 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -983,3 +983,51 @@ notmuch_database_add_message (notmuch_database_t *notmuch, return ret; } + +notmuch_tags_t * +_notmuch_convert_tags (void* ctx, Xapian::TermIterator i); + +/* Converts tags from the format used in Xapian to a list in + notmuch_tags_t. */ +notmuch_tags_t * +_notmuch_convert_tags (void* ctx, Xapian::TermIterator i) +{ +const char *prefix = _find_prefix ("tag"); +notmuch_tags_t *tags; +std::string tag; + +/* Currently this iteration is written with the assumption that + * "tag" has a single-character prefix. */ +assert (strlen (prefix) == 1); + +tags = _notmuch_tags_create (ctx); +if (unlikely (tags == NULL)) + return NULL; + +i.skip_to (prefix); + +while (1) { + tag = *i; + + if (tag.empty () || tag[0] != *prefix) + break; + + _notmuch_tags_add_tag (tags, tag.c_str () + 1); + + i++; +} + +_notmuch_tags_prepare_iterator (tags); + +return tags; +} + +/* + * Returns a list of all tags defined in a notmuch database. The resulting + * list is sorted alphabetically. + */ +notmuch_tags_t * +notmuch_database_get_tags (notmuch_database_t *db) +{ + return _notmuch_convert_tags(db, db->xapian_db->allterms_begin()); +} diff --git a/lib/message.cc b/lib/message.cc index 9488fb6..af23bb2 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -41,6 +41,9 @@ struct _notmuch_message { Xapian::Document doc; }; +extern notmuch_tags_t * +_notmuch_convert_tags (void* ctx, Xapian::TermIterator i); + /* "128 bits of thread-id ought to be enough for anybody" */ #define NOTMUCH_THREAD_ID_BITS 128 #define NOTMUCH_THREAD_ID_DIGITS (NOTMUCH_THREAD_ID_BITS / 4) @@ -445,43 +448,14 @@ notmuch_message_get_date (notmuch_message_t *message) return Xapian::sortable_unserialise (value); } + notmuch_tags_t * notmuch_message_get_tags (notmuch_message_t *message) { -const char *prefix = _find_prefix ("tag"); -Xapian::TermIterator i, end; -notmuch_tags_t *tags; -std::string tag; - -/* Currently this iteration is written with the assumption that - * "tag" has a single-character prefix. */ -assert (strlen (prefix) == 1); - -tags = _notmuch_tags_create (message); -if (unlikely (tags == NULL)) - return NULL; - -i = message->doc.termlist_begin (); -end = message->doc.termlist_end (); - -i.skip_to (prefix); - -while (1) { - tag = *i; - - if (tag.empty () || tag[0] != *prefix) - break; - - _notmuch_tags_add_tag (tags, tag.c_str () + 1); - - i++; -} - -_notmuch_tags_prepare_iterator (tags); - -return tags; + return _notmuch_convert_tags(message, message->doc.termlist_begin()); } + void _notmuch_message_set_date (notmuch_message_t *message, const char *date) diff --git a/lib/notmuch.h b/lib/notmuch.h index cc713a3..1edcfd6 100644 --- a/lib/notmuch.h +++ b/lib/notmuch.h @@ -271,6 +271,10 @@ notmuch_message_t * notmuch_database_find_message (notmuch_database_t *database, const char *message_id); +notmuch_tags_t * +notmuch_database_get_tags (notmuch_database_t *database); + + /* Create a new query for 'database'. * * Here, 'database' should be an open database, (see -- 1.6.3.3
[notmuch] [PATCH] Makefile: Create elisp install directory explicitly
On Thu, 19 Nov 2009 02:45:44 +0100, Ingmar Vanhassel wrote: > When doing a DESTDIR install, this directory likely won't exist, and > installing notmuch.el will fail. Thanks. Pushed. -Carl
[notmuch] [PATCH] notmuch: improve installation of emacs mode
Excerpts from Jeffrey C. Ollie's message of Thu Nov 19 07:18:50 +0100 2009: > 1) Don't hardcode the installation directory, instead use emacs' >pkg-config module. > > 2) Install a byte compiled version of the emacs mode. > > 3) Install the emacs mode in emacs' site-start directory so that it >gets loaded automatically. Your patch makes emacs required to do make install, which is a no-go imo. Notmuch can be used without emacs. Shouldn't installing the emac mode be a seperate target? -- Exherbo KDE, X.org maintainer
[notmuch] [PATCH -V3] notmuch: Add search mode hook
This patch add notmuch-search-hook that gets run when we after displaying search results Signed-off-by: Aneesh Kumar K.V Cc:Keith Packard --- notmuch.el | 12 +++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/notmuch.el b/notmuch.el index 706e9f3..1fc54c3 100644 --- a/notmuch.el +++ b/notmuch.el @@ -654,6 +654,12 @@ view, (remove the \"inbox\" tag from each), with :options '(goto-address) :group 'notmuch) +(defcustom notmuch-search-hook nil + "List of functions to call when notmuch displays the search results." + :type 'hook + :options '(hl-line-mode) + :group 'notmuch) + ; Make show mode a bit prettier, highlighting URLs and using word wrap (defun notmuch-show-pretty-hook () @@ -661,6 +667,9 @@ view, (remove the \"inbox\" tag from each), with (visual-line-mode)) (add-hook 'notmuch-show-hook 'notmuch-show-pretty-hook) +(add-hook 'notmuch-search-hook + (lambda() + (hl-line-mode 1) )) (defun notmuch-show (thread-id parent-buffer) "Run \"notmuch show\" with the given thread ID and display results. @@ -911,7 +920,8 @@ This function advances point to the next line when finished." (call-process "notmuch" nil t nil "search" "--sort=oldest-first" query) (call-process "notmuch" nil t nil "search" "--sort=newest-first" query)) (notmuch-search-markup-thread-ids) - + )) +(run-hooks 'notmuch-search-hook))) (defun notmuch-search-refresh-view () "Refresh the current view. -- 1.6.5.2.74.g610f9
[notmuch] [PATCH] notmuch: Add search mode hook
On Wed, Nov 18, 2009 at 09:21:11PM -0800, Keith Packard wrote: > On Thu, 19 Nov 2009 10:25:37 +0530, "Aneesh Kumar K.V" linux.vnet.ibm.com> wrote: > > > This patch add notmuch-search-mode-hook and rename > > notmuch-show-hook to notmuch-show-mode-hook. This > > also runs notmuch-show-mode-hook when we enable > > notmuch-show-mode > > I'm not sure we want to run the hooks that early; I can easily imagine > hooks that want to be run after the message has been loaded. Ok i will move them and send another patch -aneesh
[notmuch] [PATCH] notmuch: improve installation of emacs mode
On Thu, 19 Nov 2009 00:18:50 -0600, "Jeffrey C. Ollie" wrote: > 1) Don't hardcode the installation directory, instead use emacs' >pkg-config module. > > 2) Install a byte compiled version of the emacs mode. yes, both of these seem reasonable > 3) Install the emacs mode in emacs' site-start directory so that it >gets loaded automatically. I'd say anyone using notmuch should just use (require 'notmuch) instead; that way you don't abuse people not using this system. This is similar to most other package usage with emacs... -- keith.packard at intel.com -- next part -- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20091119/a5e66746/attachment.pgp>
[notmuch] [PATCH 2/2] notmuch list: A new command to produce various lists.
On Thu, 2009-11-19 at 15:41 +0100, Carl Worth wrote: > The other reason I've wanted this is have something like a "folder view" > that would show a list of tags and a number of messages with each tag, > (or a number of messages with that tag and the inbox tag). > > I know that Keith said he'd prefer to use a view like that as his > primary way of reading mail. Yes. I've been pondering approaches to prioritizing the pool of unread messages. Most of my thinking so far is along the lines of the ability to automatically apply tags to new messages on various criteria combined with the ability to manipulate the order in which tags are presented in a view like what you're describing. For better or worse, with about 45k messages hitting my inbox per year *after* most of the list traffic gets peeled off and fed to a private NNTP server, it's not about reading all of my email any more... it's about finding and reading the stuff that actually matters *to me*. Can't tell you how excited I am about what's happening here! Bdale
[notmuch] Mac OS X/Darwin compatibility issues
On Wed, Nov 18, 2009 at 11:27:20PM +0100, Carl Worth wrote: > Yes. I knew I was "cheating" by using some GNU extensions here. I'm > happy to accept portability patches for these things, but it's hard for > me to get excited about writing them myself. > > Care to take a whack at these? http://www.gnu.org/software/gnulib/ could be a partial answer. We've taken to using it where needed for Drizzle and seems to work fine. -- Stewart Smith
[notmuch] [PATCH] notmuch: Add search mode hook
This patch add notmuch-search-mode-hook and rename notmuch-show-hook to notmuch-show-mode-hook. This also runs notmuch-show-mode-hook when we enable notmuch-show-mode Signed-off-by: Aneesh Kumar K.V CC:Keith Packard --- notmuch.el | 20 +++- 1 files changed, 15 insertions(+), 5 deletions(-) diff --git a/notmuch.el b/notmuch.el index 706e9f3..2f11b2b 100644 --- a/notmuch.el +++ b/notmuch.el @@ -640,7 +640,8 @@ view, (remove the \"inbox\" tag from each), with (use-local-map notmuch-show-mode-map) (setq major-mode 'notmuch-show-mode mode-name "notmuch-show") - (setq buffer-read-only t)) + (setq buffer-read-only t) + (run-hooks 'notmuch-show-mode-hook)) ;;;###autoload @@ -648,19 +649,28 @@ view, (remove the \"inbox\" tag from each), with "Notmuch mail reader for Emacs." :group 'mail) -(defcustom notmuch-show-hook nil +(defcustom notmuch-show-mode-hook nil "List of functions to call when notmuch displays a message." :type 'hook :options '(goto-address) :group 'notmuch) +(defcustom notmuch-search-mode-hook nil + "List of functions to call when notmuch displays the search results." + :type 'hook + :options '(hl-line-mode) + :group 'notmuch) + ; Make show mode a bit prettier, highlighting URLs and using word wrap (defun notmuch-show-pretty-hook () (goto-address-mode 1) (visual-line-mode)) -(add-hook 'notmuch-show-hook 'notmuch-show-pretty-hook) +(add-hook 'notmuch-show-mode-hook 'notmuch-show-pretty-hook) +(add-hook 'notmuch-search-mode-hook + (lambda() + (hl-line-mode 1) )) (defun notmuch-show (thread-id parent-buffer) "Run \"notmuch show\" with the given thread ID and display results. @@ -684,7 +694,6 @@ thread from that buffer can be show when done with this one)." (call-process "notmuch" nil t nil "show" thread-id) (notmuch-show-markup-messages) ) - (run-hooks 'notmuch-show-hook) ; Move straight to the first unread message (if (not (notmuch-show-message-unread-p)) (progn @@ -787,7 +796,8 @@ global search. (setq truncate-lines t) (setq major-mode 'notmuch-search-mode mode-name "notmuch-search") - (setq buffer-read-only t)) + (setq buffer-read-only t) + (run-hooks 'notmuch-search-mode-hook)) (defun notmuch-search-find-thread-id () (save-excursion -- 1.6.5.2.74.g610f9
[notmuch] [PATCH] notmuch: improve installation of emacs mode
1) Add a separate targets to build and install emacs mode. 2) Don't hardcode the installation directory, instead use emacs' pkg-config module. 3) Install a byte compiled version of the emacs mode. 4) Install the emacs mode in emacs' site-start directory so that it gets loaded automatically. 5) Ignore byte-compiled emacs files. Signed-off-by: Jeffrey C. Ollie --- .gitignore |2 +- Makefile |6 ++ Makefile.local | 15 --- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 8417d60..7d3c543 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,4 @@ notmuch.1.gz *.[ao] *~ .*.swp - +*.elc diff --git a/Makefile b/Makefile index 023b2ec..17fa4a2 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,9 @@ CFLAGS=-O2 extra_cflags := $(shell pkg-config --cflags glib-2.0 gmime-2.4 talloc) extra_cxxflags := $(shell xapian-config --cxxflags) +emacs_lispdir := $(shell pkg-config emacs --variable sitepkglispdir) +emacs_startdir := $(shell pkg-config emacs --variable sitestartdir) + # Now smash together user's values with our extra values override CFLAGS += $(WARN_FLAGS) $(extra_cflags) override CXXFLAGS += $(WARN_FLAGS) $(extra_cflags) $(extra_cxxflags) @@ -28,6 +31,9 @@ include Makefile.config %.o: %.c $(CC) -c $(CFLAGS) $< -o $@ +%.elc: %.el + emacs -batch -f batch-byte-compile $< + .deps/%.d: %.c @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \ $(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@.; \ diff --git a/Makefile.local b/Makefile.local index 6bc01a5..2bb4521 100644 --- a/Makefile.local +++ b/Makefile.local @@ -1,5 +1,7 @@ all: notmuch notmuch.1.gz +emacs: notmuch.elc + notmuch_client_srcs = \ notmuch.c \ notmuch-config.c\ @@ -25,15 +27,22 @@ notmuch.1.gz: notmuch.1 install: all notmuch.1.gz for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/share/man/man1 \ - $(DESTDIR)/$(prefix)/share/emacs/site-lisp/ $(DESTDIR)/etc/bash_completion.d/ ; \ + $(DESTDIR)/etc/bash_completion.d/ ; \ do \ install -d $$d ; \ done ; install notmuch $(DESTDIR)$(prefix)/bin/ install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/ - install -m0644 notmuch.el $(DESTDIR)$(prefix)/share/emacs/site-lisp/ install notmuch-completion.bash \ $(DESTDIR)/etc/bash_completion.d/notmuch +install-emacs: install emacs + for d in $(DESTDIR)/$(emacs_startdir) ; \ + do \ + install -d $$d ; \ + done ; + install -m0644 notmuch.el $(DESTDIR)$(emacs_startdir) + install -m0644 notmuch.elc $(DESTDIR)$(emacs_startdir) + SRCS := $(SRCS) $(notmuch_client_srcs) -CLEAN := $(CLEAN) notmuch $(notmuch_client_modules) +CLEAN := $(CLEAN) notmuch $(notmuch_client_modules) notmuch.elc -- 1.6.5.2
[notmuch] [PATCH] Handle rename of message file
Twas brillig at 18:06:09 18.11.2009 UTC-08 when keithp at keithp.com did gyre and gimble: KP> Checking for new files is easy; notmuch already does that, and so KP> handling renames doesn't seem all that difficult. Except rename does not change mtime of file, and so it won't be picked up by 'notmuch new'. -- http://fossarchy.blogspot.com/ -- next part -- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 834 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20091119/1b8750a4/attachment.pgp>
[notmuch] [PATCH] Handle rename of message file
Twas brillig at 02:08:15 19.11.2009 UTC+01 when cworth at cworth.org did gyre and gimble: CW> I believe you said in IRC that this patch is not ready yet. Yes. CW> I'd love to hear more from you on any experiments/ideas you have in CW> this area. It would be a really nice feature to have, (particularly CW> for people who are experimenting with notmuch while still using CW> some other primary email program that keeps fiddling with the CW> filenames). Did not have time to work on it further yet. The only dumb idea I have in mind is hardlinking all mail to separate directory in order to make a "pristine copy" which does not change as time goes. This directory could be cleaned up: if some file has only 1 link, then it was deleted from main mail spool and should be deleted
[notmuch] [PATCH] notmuch: improve installation of emacs mode
1) Add a separate install target to install emacs mode. 2) Don't hardcode the installation directory, instead use emacs' pkg-config module. 3) Install a byte compiled version of the emacs mode. 4) Install the emacs mode in emacs' site-start directory so that it gets loaded automatically. Signed-off-by: Jeffrey C. Ollie --- Makefile |6 ++ Makefile.local | 13 ++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 023b2ec..17fa4a2 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,9 @@ CFLAGS=-O2 extra_cflags := $(shell pkg-config --cflags glib-2.0 gmime-2.4 talloc) extra_cxxflags := $(shell xapian-config --cxxflags) +emacs_lispdir := $(shell pkg-config emacs --variable sitepkglispdir) +emacs_startdir := $(shell pkg-config emacs --variable sitestartdir) + # Now smash together user's values with our extra values override CFLAGS += $(WARN_FLAGS) $(extra_cflags) override CXXFLAGS += $(WARN_FLAGS) $(extra_cflags) $(extra_cxxflags) @@ -28,6 +31,9 @@ include Makefile.config %.o: %.c $(CC) -c $(CFLAGS) $< -o $@ +%.elc: %.el + emacs -batch -f batch-byte-compile $< + .deps/%.d: %.c @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \ $(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@.; \ diff --git a/Makefile.local b/Makefile.local index 6bc01a5..e4a27e5 100644 --- a/Makefile.local +++ b/Makefile.local @@ -1,4 +1,4 @@ -all: notmuch notmuch.1.gz +all: notmuch notmuch.1.gz notmuch.elc notmuch_client_srcs = \ notmuch.c \ @@ -25,15 +25,22 @@ notmuch.1.gz: notmuch.1 install: all notmuch.1.gz for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/share/man/man1 \ - $(DESTDIR)/$(prefix)/share/emacs/site-lisp/ $(DESTDIR)/etc/bash_completion.d/ ; \ + $(DESTDIR)/etc/bash_completion.d/ ; \ do \ install -d $$d ; \ done ; install notmuch $(DESTDIR)$(prefix)/bin/ install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/ - install -m0644 notmuch.el $(DESTDIR)$(prefix)/share/emacs/site-lisp/ install notmuch-completion.bash \ $(DESTDIR)/etc/bash_completion.d/notmuch +install-emacs: install notmuch.elc + for d in $(DESTDIR)/$(emacs_startdir) ; \ + do \ + install -d $$d ; \ + done ; + install -m0644 notmuch.el $(DESTDIR)$(emacs_startdir) + install -m0644 notmuch.elc $(DESTDIR)$(emacs_startdir) + SRCS := $(SRCS) $(notmuch_client_srcs) CLEAN := $(CLEAN) notmuch $(notmuch_client_modules) -- 1.6.5.2
[notmuch] [PATCH -V3] notmuch: Add search mode hook
On Thu, 19 Nov 2009 11:40:54 +0530, "Aneesh Kumar K.V" wrote: > This patch add notmuch-search-hook that gets run when we > after displaying search results Looks good. > Signed-off-by: Aneesh Kumar K.V Reviewed-by: Keith Packard -- keith.packard at intel.com -- next part -- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20091119/8536ad3e/attachment.pgp>
[notmuch] [PATCH 2/2] .gitignore: Add common editor droppings
On Wed, Nov 18, 2009 at 11:51 PM, Ingmar Vanhassel wrote: > diff --git a/.gitignore b/.gitignore > index d277c5a..a210779 100644 > --- a/.gitignore > +++ b/.gitignore > @@ -2,4 +2,6 @@ > ?notmuch > ?notmuch.1.gz > ?*.[ao] > +*~ > +.*.swp Since these patterns are specific to a user rather than a project, shouldn't they go in the user's ignore file (~/.gitignore) rather than the project's? -- Karl Wiberg, kha at treskal.com subrabbit.wordpress.com www.treskal.com/kalle
[notmuch] [PATCH] Makefile: Create elisp install directory explicitly
When doing a DESTDIR install, this directory likely won't exist, and installing notmuch.el will fail. See 0d4b5292 --- Makefile.local |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Makefile.local b/Makefile.local index 27e42ba..6bc01a5 100644 --- a/Makefile.local +++ b/Makefile.local @@ -25,7 +25,7 @@ notmuch.1.gz: notmuch.1 install: all notmuch.1.gz for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/share/man/man1 \ - $(DESTDIR)/etc/bash_completion.d/ ; \ + $(DESTDIR)/$(prefix)/share/emacs/site-lisp/ $(DESTDIR)/etc/bash_completion.d/ ; \ do \ install -d $$d ; \ done ; -- 1.6.5.2.433.g23cdb
[notmuch] [PATCH] Handle rename of message file
On Wed, 18 Nov 2009 02:51:18 +0600, Mikhail Gusarov wrote: > If message file has been renamed, just update filename in the DB. > > Signed-off-by: Mikhail Gusarov I believe you said in IRC that this patch is not ready yet. I'd love to hear more from you on any experiments/ideas you have in this area. It would be a really nice feature to have, (particularly for people who are experimenting with notmuch while still using some other primary email program that keeps fiddling with the filenames). -Carl
[notmuch] request for pull
On Wed, 18 Nov 2009 08:29:41 -0800, Carl Worth wrote: > On Wed, 18 Nov 2009 00:02:56 -0800, Alexander Botero-Lowry at gmail.com> wrote: > > The following changes since commit e8c9c3e6a534fc6c2919c2c1de63cea7250eb488: > > > > are available in the git repository at: > > > > git://alexbl.net/notmuch.git master ... > Well, that's what I have a "todo" tag for. So I'll look at this later > when I've got internet access again. (But I believe the first commit is > already addressed independently.) > > BTW, thanks for the patches! Looks like by the time I got back there's nothing left to get here, (presumably the changes got pushed up separately). But I've at least got your repository as a "git remote" now, and after I'm done travelling this week I'll have a stable internet connection and pull requests will be easier to handle. Happy hacking, -Carl
[notmuch] RPM spec file
On Wed, 18 Nov 2009 12:31:53 -0600, "Jeffrey C. Ollie" wrote: > I prefere managing all of the software on my system with RPM, so I > came up with a quick spec file for building RPMS. Once notmuch > settles down and I continue using it I may submit notmuch to Fedora as > an official package. If you'd like your own RPMS build your own, I > don't plan on offering a repository of binary packages. This sounds great, Jeffrey. What makes the most sense for this file? Shall we just leave it in the central repository? Or put it in its own rpm branch? I'm open to your suggestions here. -Carl
[notmuch] [PATCH 1/2] zsh: Initial zsh-completion for notmuch
Excerpts from Carl Worth's message of Thu Nov 19 01:51:51 +0100 2009: > On Wed, 18 Nov 2009 23:50:40 +0100, Ingmar Vanhassel > wrote: > > Signed-off-by: Ingmar Vanhassel > > --- > > _notmuch | 74 > > ++ > > 1 files changed, 74 insertions(+), 0 deletions(-) > > create mode 100644 _notmuch > > Looks nice. Could you also add a Makefile.local target to install this > in the right place so that it actually does something? Sure, any suggestions on the name? Or did you mean to add it to the install target? > And I'd like it to have a more descriptive name in the source tree (such > as notmuch-completion.zsh). Alright, will do. I just named it what it'll be installed as, but either works. > Thanks, > > -Carl -- Exherbo KDE, X.org maintainer
[notmuch] Fw: Introducing myself
On Thu, 19 Nov 2009 01:32:30 +0100, Adrian wrote: > (Re-injecting this one in the list... it was my fault in reality because I > sent two copies, one to the list and another to Carl, so he replied to me > directly. It would have been enough to send my mail to the list -- I am > sorry a lot for the noise) > > Begin forwarded message: > > Date: Thu, 19 Nov 2009 00:58:38 +0100 > From: Carl Worth > To: Adrian Perez de Castro > Subject: Re: [notmuch] Introducing myself > > > On Wed, 18 Nov 2009 16:47:06 +0100, Adrian Perez de Castro > wrote: > > On Wed, 18 Nov 2009 03:15:31 -0800, Carl wrote: > > > > I tried the "notmuch.el" Emacs mode, and have just installed Emacs in > > order to be able to try it out. As I have been using Vim for the last ~9 > > years, probably that was the reason why I found it not very comfortable. > > Wow, you're brave to give it a shot. And I'm glad that you were able to > work your way through it. After trying things a bit with some copied mailboxes, I am planning now on moving away from Claws-Mail... so Emacs will be sitting here for a while :D > > I also think it would be great to have a curses-based UI, so this may > > be a good opportunity to start doing some serious coding with it in my > > spare time. > > Sounds great. I would feel just fine seeing lots of interfaces built up > around the notmuch search and tagging. Me too, and all sharing the same index. > [...] I do hope people doing custom > interfaces will consider implementing some of the things that I happen > to consider part of the "notmuch experience", (viewing an entire, nested > thread at once with citations/signatures elided---this feature comes > exactly from sup; and my magic space-bar for reading lots of mail with > only one key---though the most important part here is to not archive a > message until it is paged *off* the screen---as opposed to many emailers > that mark a message as "read" as soon as any of the message appears on > the screen). > > Of course, if you're doing your own interface, then you get to do > whatever you want. But I hope you might at least consider those ideas. I am not totally sure about the elusion of citation and signatures, but that can be an user setting. My favourite feature is not marking messages as read until one decides to do so. For the rest of the lot, I agree that they should be there as well. Best regards, [1] http://fdm.sourceforge.net/ -- Adrian Perez de Castro Igalia - Free Software Engineering -- next part -- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20091119/4b5eaf49/attachment-0001.pgp>
[notmuch] [PATCH 1/2] zsh: Initial zsh-completion for notmuch
On Wed, 18 Nov 2009 23:50:40 +0100, Ingmar Vanhassel wrote: > Signed-off-by: Ingmar Vanhassel > --- > _notmuch | 74 > ++ > 1 files changed, 74 insertions(+), 0 deletions(-) > create mode 100644 _notmuch Looks nice. Could you also add a Makefile.local target to install this in the right place so that it actually does something? And I'd like it to have a more descriptive name in the source tree (such as notmuch-completion.zsh). Thanks, -Carl
[notmuch] How to list archived mails
On Thu, 19 Nov 2009 00:38:01 +0100, Carl Worth wrote: > On Wed, 18 Nov 2009 20:35:26 +0530, aneesh.kumar at linux.vnet.ibm.com > (Aneesh Kumar K.V) wrote: > > Once i mark the mail as archived how do i search for them ? > > Right now with notmuch.el i am adding a tag "archive" when > > i am archiving the mail. I am just wondering is this the right > > way ? > > You might expect to be able to find all archived messages with: > > notmuch search not tag:inbox And now you can ignore everything else I said after this. Adrian Perez just discovered that we just weren't enabling an option in Xapian to allow this syntax to work. His commit is pushed, so now if you update your source *can* you use the above syntax and it should work just fine. Happy hacking, -Carl
[notmuch] [PATCH] Allow lone "not" search operators
On Thu, 19 Nov 2009 01:07:22 +0100, Adrian Perez wrote: > As suggested by Keith in FLAG_PURE_NOT allows for expressions like: > > notmuch search NOT tag:inbox Oh, fantastic! I guess I'd run into enough QueryParser bugs recently that I was willing to blame it without cause this time. And I *thought* I had looked carefully at all the QueryParser tags to choose all the useful ones, but clearly I missed this one. Anyway, thanks for the research and the fix. This is pushed now. Happy hacking, -Carl
[notmuch] link error
* Peter Wang (novalazy at gmail.com) wrote: > Linking fails on my system for some reason (undefined references to > talloc functions). Putting $(LDFLAGS) after the object list solves it. I have a similar ordering change in the ebuild I posted earlier as a workaround for people using ld's --as-needed option. Thanks, James
[notmuch] [PATCH] Makefile: Make object targets depend on Makefiles
All objects need to be recompiled when any of the Makefiles changes, so we make them all depend on all the Makefiles. Signed-off-by: Jan Janak --- Makefile | 11 +++ 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 96aaa73..2787aff 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,9 @@ CFLAGS=-O2 extra_cflags = `pkg-config --cflags glib-2.0 gmime-2.4 talloc` extra_cxxflags = `xapian-config --cxxflags` +all_deps = Makefile Makefile.local Makefile.config \ + lib/Makefile lib/Makefile.local + # Now smash together user's values with our extra values override CFLAGS += $(WARN_FLAGS) $(extra_cflags) override CXXFLAGS += $(WARN_FLAGS) $(extra_cflags) $(extra_cxxflags) @@ -21,19 +24,19 @@ include lib/Makefile.local # And get user settings from the output of configure include Makefile.config -%.o: %.cc +%.o: %.cc $(all_deps) $(CXX) -c $(CFLAGS) $(CXXFLAGS) $< -o $@ -%.o: %.c +%.o: %.c $(all_deps) $(CC) -c $(CFLAGS) $< -o $@ -.deps/%.d: %.c +.deps/%.d: %.c $(all_deps) @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \ $(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@.; \ sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@. > $@; \ rm -f $@. -.deps/%.d: %.cc +.deps/%.d: %.cc $(all_deps) @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \ $(CXX) -M $(CPPFLAGS) $(CXXFLAGS) $< > $@.; \ sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@. > $@; \ -- 1.6.3.3
[notmuch] [PATCH] Make reply/show/tag all require at least one search term
On Wed, 18 Nov 2009 13:45:58 -0800, Keith Packard wrote: > In particular, notmuch tag -inbox "" tended to take a long time to > run, happened if you hit 'a' on a blank line in the search view and > probably didn't have the desired effect. Another nice fix. Thanks again. This is pushed. -Carl
[notmuch] Fw: Introducing myself
(Re-injecting this one in the list... it was my fault in reality because I sent two copies, one to the list and another to Carl, so he replied to me directly. It would have been enough to send my mail to the list -- I am sorry a lot for the noise) Begin forwarded message: Date: Thu, 19 Nov 2009 00:58:38 +0100 From: Carl Worth <cwo...@cworth.org> To: Adrian Perez de Castro Subject: Re: [notmuch] Introducing myself On Wed, 18 Nov 2009 16:47:06 +0100, Adrian Perez de Castro wrote: > On Wed, 18 Nov 2009 03:15:31 -0800, Carl wrote: > > I tried the "notmuch.el" Emacs mode, and have just installed Emacs in > order to be able to try it out. As I have been using Vim for the last ~9 > years, probably that was the reason why I found it not very comfortable. Wow, you're brave to give it a shot. And I'm glad that you were able to work your way through it. > I showed the thing to my work mates this morning and most of them said > that they would like to have Mutt-like keybindings *with* Not Much's > search and tagging running behind it. Any long-time mutt users want to suggest keybindings? I've mostly been making stuff up as I go (with some influence from sup), but I think it's early enough that I could still re-train my muscles. Get your votes in now for your favorite keybindings. > I also think it would be great to have a curses-based UI, so this may > be a good opportunity to start doing some serious coding with it in my > spare time. Sounds great. I would feel just fine seeing lots of interfaces built up around the notmuch search and tagging. I do hope people doing custom interfaces will consider implementing some of the things that I happen to consider part of the "notmuch experience", (viewing an entire, nested thread at once with citations/signatures elided---this feature comes exactly from sup; and my magic space-bar for reading lots of mail with only one key---though the most important part here is to not archive a message until it is paged *off* the screen---as opposed to many emailers that mark a message as "read" as soon as any of the message appears on the screen). Of course, if you're doing your own interface, then you get to do whatever you want. But I hope you might at least consider those ideas. Happy hacking! -Carl -- Adrian Perez de Castro Igalia - Free Software Engineering -- next part -- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20091119/c9d3ac28/attachment.pgp>
[notmuch] [PATCH] Filter out carriage-returns in show and reply output.
On Wed, 18 Nov 2009 11:56:13 -0800, Keith Packard wrote: > Thanks, windows mail clients. Very nice to have. Pushed. -Carl
[notmuch] [PATCH] Fix a compile warning under gcc-4.4.1
On Wed, 18 Nov 2009 14:43:22 -0500, Joshua Roys wrote: > --- > Hello, > This fixes the following for me: Thanks so much for the report and patch, Joshua. This bug was recently fixed in a commit pushed out to the notmuch repository. Happy hacking, -Carl
[notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags
On Wed, 18 Nov 2009 09:45:01 -0800, Keith Packard wrote: > On Wed, 18 Nov 2009 02:19:26 -0800, Carl Worth wrote: > You can use kill-buffer directly (C-X k); adding a new special binding > for that command seems unnecessary to me. Well, that's "Control, X, K, Enter", so quite a bit harder than just 'x'. :-) But fine, I could move my convenience for "kill buffer" to just 'k'. I think I'd like to see a better mapping for "archive and kill buffer" to a key other than 'x'. Any ideas? > My mail flow doesn't involve moving directly from one message to the > next; I go back to the index after reviewing each one; there isn't a way > to mark a buffer as read/archived and *not* view another message OK, that's definitely different than me. Let me at least explain a couple of parts of my flow, (not intended to try to convince you to use it---just to explain): 1. Before I go into "read a bunch of messages with spacebar" mode I first arrange for filtered search results that I know I want to read all together. Most frequently this involves bringing up the inbox, and then hitting 't' for filter-to-tag and choosing a tag of mail that's all interesting, (like the "to-me" tag that gets applied automatically[*] to all mail addressed to me individually). 2. When I archive a thread with 'a', I'm not necessarily always planning to read the next message (just because notmuch is presenting it to me). And if not, I'll just press 'x' right away. a. An important point here is that that "undesired" presentation of a message results in no state changes. In far too many other email programs I've used, deleting one message causes another one to be displayed and *that* message gets immediately marked "unread" forcing me to read it immediately or risk losing it. Not nice. b. Sometimes, even if I wasn't really planning in advance to read the mail, just having it appear does encourage me to read it, (but with no risk if I choose not to---unlike the broken mailer I described above). So here's one way that notmuch encourages me to mow through my pending mail quickly. 3. There's one entirely different mode I use. The above is for a collection of "mostly interesting" messages where I want to at least see them all. The other mode is "mostly uninteresting" messages where I can take care of most everything from the search view, (and maybe just pop into one or two messages). Here your, 'archive and exit' key might be useful, but my 'exit without archiving' works fine too. The reason is that after I look at the one or two interesting messages, the next thing I'll do is to archive away all the messages from the search view. Of course, for this I need an "archive all" binding that doesn't exist yet. And I also really need to fix the Xapian bug so that archiving 100 threads doesn't take *forever* like it does currently. Anyway, thanks for letting me ramble a bit about how I deal with mail. -Carl [*] I'm currently getting "automatic" tags via a script (which I've named notmuch-poll) that calls "notmuch new" and then calls a bunch of "notmuch tag" commands not unlike the following: notmuch tag +notmuch to:notmuchmail.org and not tag:notmuch
[notmuch] [PATCH] Allow lone "not" search operators
As suggested by Keith in FLAG_PURE_NOT allows for expressions like: notmuch search NOT tag:inbox Note that this way a search like: notmuch search foobar NOT tag:inbox should not be written instead: notmuch search foobar AND NOT tag:inbox In my opinion, the latter feels more natural and is somewhat more explicit. It gives a better clue of what the search is about instead of assuming that an implicit AND operator is there. --- lib/query.cc |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/lib/query.cc b/lib/query.cc index a869f3e..75f22b3 100644 --- a/lib/query.cc +++ b/lib/query.cc @@ -97,7 +97,8 @@ notmuch_query_search_messages (notmuch_query_t *query, Xapian::QueryParser::FLAG_PHRASE | Xapian::QueryParser::FLAG_LOVEHATE | Xapian::QueryParser::FLAG_BOOLEAN_ANY_CASE | - Xapian::QueryParser::FLAG_WILDCARD); + Xapian::QueryParser::FLAG_WILDCARD | + Xapian::QueryParser::FLAG_PURE_NOT); if (strcmp (query_string, "") == 0) { final_query = mail_query; -- 1.6.5.2
[notmuch] [PATCH] We use the message mail system for new mail, let emacs know.
On Wed, 18 Nov 2009 09:34:51 -0800, Keith Packard wrote: > This makes things like the goto-address system bring up the right > message composition window. Thanks. Pushed. -Carl
[notmuch] RPM spec file
On Wed, Nov 18, 2009 at 7:03 PM, Carl Worth wrote: > On Wed, 18 Nov 2009 12:31:53 -0600, "Jeffrey C. Ollie" > wrote: >> I prefere managing all of the software on my system with RPM, so I >> came up with a quick spec file for building RPMS. ?Once notmuch >> settles down and I continue using it I may submit notmuch to Fedora as >> an official package. ?If you'd like your own RPMS build your own, I >> don't plan on offering a repository of binary packages. > > This sounds great, Jeffrey. > > What makes the most sense for this file? Shall we just leave it in the > central repository? Or put it in its own rpm branch? I'm open to your > suggestions here. I don't think that a separate Git branch makes sense, but maybe stuff like this should be in a subdirectory like "packaging/fedora", since I imagine that there will eventually be a need for "packaging/debian" etc. as well. -- Jeff Ollie
[notmuch] [PATCH] notmuch: Add tag archive when archiving the mails
On Wed, 18 Nov 2009 13:50:58 -0600, Jeffrey Ollie wrote: > On Wed, Nov 18, 2009 at 1:07 PM, Keith Packard wrote: > > I think you can just use 'not tag:inbox' as 'archived' really just means > > 'doesn't have the inbox tag'. > > That resulted in an error for me: > > $ notmuch search not tag:inbox > A Xapian exception occurred: Syntax: NOT > A Xapian exception occurred: Syntax: NOT Like I said earlier. I think that's a bug we should report to the Xapian folks. Meanwhile, it just occurred to me that we can make "notmuch search not tag:inbox" work without any change to Xapian. For every document we store in the database we put a special term on it to indicate its type. (We mostly just have documents of type "mail" but we also have documents of type "timestamp"---see the comment at the top of lib/database.cc for details.) So if we take the string "not tag:inbox" and turn it into "type:mail and not tag:inbox" then that will work just fine. (That's close to what we're doing currently, but different. Right now we try to parse the query "not tag:inbox" on its own and then combine the result with another query generated from a term representing the "mail" type.) -Carl
[notmuch] [PATCH] notmuch: Add hooks for show-mode and search-mode
On Wed, 18 Nov 2009 20:44:58 +0530, aneesh.kumar at linux.vnet.ibm.com (Aneesh Kumar K.V) wrote: > From: Aneesh Kumar K.V > Date: Wed, 18 Nov 2009 20:43:13 +0530 > Subject: [PATCH] notmuch: Add hooks for show-mode and search-mode > > This enables to do things like > > (add-hook 'notmuch-search-mode-hook > (lambda() > (hl-line-mode 1) )) Hi Aneesh, Thanks for the patch. I think the hooks will be genuinely useful. I haven't pushed this yet for two questions: 1. I recently merged an independent patch from Keith to add one hook already. (And it looks like Keith got fancy and used defcustom instead of defvar.) Could you re-do your patch on top of master and match the style he used? [*] 2. If this hl-line-mode thing is interesting for you, might it not be interesting for all users? (What does it do anyway?) One concern I have with hooks is that people will use them to fix things locally and prevent the defaults getting fixed to improve things for everybody. (Granted, sometimes there's an honest difference of opinion, so the defaults can't always satisfy everyone, and we'll want the hooks.) I guess I'm just hoping that people will at least attempt to get improvements to be integrated into the defaults instead of just changing local hooks. -Carl [*] Independently, it might be nice to switch all of our variables intended to be tweaked by the user from defvar to defcustom.
[notmuch] How to list archived mails
On Wed, 18 Nov 2009 20:35:26 +0530, aneesh.kumar at linux.vnet.ibm.com (Aneesh Kumar K.V) wrote: > Once i mark the mail as archived how do i search for them ? > Right now with notmuch.el i am adding a tag "archive" when > i am archiving the mail. I am just wondering is this the right > way ? You might expect to be able to find all archived messages with: notmuch search not tag:inbox (And if I had written the query parser that would work fine.) But oddly, that fails because in Xapian's query parser the NOT operator is not a unary operator but is instead a binary operator of AND_NOT. I think the lack of a unary not is a bug in Xapian. In the meantime, what we could use here is some syntax for a query that is guaranteed to match all messages. Anyone have any ideas? Meanwhile, if it's not that you're trying to list all archived messages, (which I think would be a rare thing to want), but instead you want all archived messages matching then you can simply do: notmuch search and not tag:inbox I hope that helps. Happy hacking, -Carl
[notmuch] Why is no. of files from count_files reset to 0?
On Wed, 18 Nov 2009 15:36:51 +0100, Jan Janak wrote: > When I comment out the following line (before add_files is called): > > add_files_state.total_files = 0; > > The progress indicator shows the total number of files to be > processed, as well as the time remaining. This is, IMHO, much better, > especially if you process a large collection of emails. > > Is there any reason for having the variable reset to 0 before calling > add_files? Thanks! Just a bug. Thanks for pointing this out. It's fixed now---and it will be nice for new users to have the countdown working once again. -Carl
[notmuch] [PATCH] notmuch: improve installation of emacs mode
1) Don't hardcode the installation directory, instead use emacs' pkg-config module. 2) Install a byte compiled version of the emacs mode. 3) Install the emacs mode in emacs' site-start directory so that it gets loaded automatically. --- Makefile |6 ++ Makefile.local |9 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 023b2ec..17fa4a2 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,9 @@ CFLAGS=-O2 extra_cflags := $(shell pkg-config --cflags glib-2.0 gmime-2.4 talloc) extra_cxxflags := $(shell xapian-config --cxxflags) +emacs_lispdir := $(shell pkg-config emacs --variable sitepkglispdir) +emacs_startdir := $(shell pkg-config emacs --variable sitestartdir) + # Now smash together user's values with our extra values override CFLAGS += $(WARN_FLAGS) $(extra_cflags) override CXXFLAGS += $(WARN_FLAGS) $(extra_cflags) $(extra_cxxflags) @@ -28,6 +31,9 @@ include Makefile.config %.o: %.c $(CC) -c $(CFLAGS) $< -o $@ +%.elc: %.el + emacs -batch -f batch-byte-compile $< + .deps/%.d: %.c @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \ $(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@.; \ diff --git a/Makefile.local b/Makefile.local index 27e42ba..8aac201 100644 --- a/Makefile.local +++ b/Makefile.local @@ -1,4 +1,4 @@ -all: notmuch notmuch.1.gz +all: notmuch notmuch.1.gz notmuch.elc notmuch_client_srcs = \ notmuch.c \ @@ -23,15 +23,16 @@ notmuch: $(notmuch_client_modules) lib/notmuch.a notmuch.1.gz: notmuch.1 gzip --stdout notmuch.1 > notmuch.1.gz -install: all notmuch.1.gz +install: all notmuch.1.gz notmuch.elc for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/share/man/man1 \ - $(DESTDIR)/etc/bash_completion.d/ ; \ + $(DESTDIR)/etc/bash_completion.d/ $(DESTDIR)$(emacs_startdir) ; \ do \ install -d $$d ; \ done ; install notmuch $(DESTDIR)$(prefix)/bin/ install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/ - install -m0644 notmuch.el $(DESTDIR)$(prefix)/share/emacs/site-lisp/ + install -m0644 notmuch.el $(DESTDIR)$(emacs_startdir) + install -m0644 notmuch.elc $(DESTDIR)$(emacs_startdir) install notmuch-completion.bash \ $(DESTDIR)/etc/bash_completion.d/notmuch -- 1.6.5.2
[notmuch] Gentoo ebuild for notmuch
Hi, Just in case other Gentoo users are trying notmuch out I thought I'd post my ebuild(perhaps you'll make it better for me too :). It is working well up to at least e5da2b70. I won't bother the list if it requires changes, as it is available from my main overlay[1] if you wish to check for updated versions. Thanks, James 1. http://github.com/JNRowe/misc-overlay/tree/master/mail-client/notmuch/ -- next part -- # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="2" inherit toolchain-funcs elisp-common bash-completion git EGIT_REPO_URI="git://notmuchmail.org/git/${PN}" DESCRIPTION="Thread-based email index, search and tagging." HOMEPAGE="http://notmuchmail.org/; SRC_URI="" LICENSE="GPL-3" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="emacs" DEPEND="dev-util/pkgconfig ${RDEPEND}" RDEPEND="sys-libs/talloc dev-libs/gmime dev-libs/xapian emacs? ( virtual/emacs )" SITEFILE="50${PN}-gentoo.el" src_prepare() { # Change ordering in case people are using as-needed sed -i 's,\($(LDFLAGS)\)\(.*\),\2 \1,' Makefile.local } src_compile() { emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" CFLAGS="${CFLAGS}" \ || die "emake failed" if use emacs; then elisp-compile ${PN}.el || die "elisp-compile failed" fi } src_install() { # Don't use make install, because it installs compressed man pages, # bash-completion in the wrong location and emacs files unconditionally. # Three commands are quicker than patching Makefile.local locally. dobin ${PN} doman ${PN}.1 dobashcompletion notmuch-completion.bash ${PN} dodoc AUTHORS README TODO if use emacs; then elisp-install ${PN}{,.el} elisp-site-file-install "${FILESDIR}/${SITEFILE}" fi } -- next part -- ; notmuch site-list config (add-to-list 'load-path "@SITELISP@") (autoload 'notmuch "notmuch" "Start notmuch" t)
[notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap
On Wed, 18 Nov 2009 00:29:59 -0800, Keith Packard wrote: > I created the notmuch-show-hook precisely so I could add these two > options, but I suspect most people will want them, so I just made them > the default. If you don't want them, you can use remove-hook to get > rid of this. Thanks, Keith! I had actually held off on pushing your original commit to add the hook because I didn't like that it wasn't documenting what the hook was good for. But now that we've got some good, suggested behavior there, I'm much happier. So both are pushed now. On Wed, 18 Nov 2009 00:52:34 -0800, Alexander Botero-Lowry wrote: > Yes, hooks should be added for search as well. :) Not a bad idea at all. > visual-line-mode turns out to make subject look pretty ugly if there is a > continuation. It doesn't do much good for the citation headers > either. We probably need to do our own intelligent wrapping rather then > use visual-line-mode to make this actually look right. Yes, this stuff isn't perfect yet, but I think it's better than nothing. We can do our own wrapping if these things get too annoying. -Carl