unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [RFC PATCH 0/2] emacs proof-of-concept: functions in saved searches
@ 2011-11-23 21:08 Jani Nikula
  2011-11-23 21:08 ` [RFC PATCH 1/2] emacs: allow functions as " Jani Nikula
  2011-11-23 21:08 ` [RFC PATCH 2/2] emacs: a couple of example functions that might be useful with " Jani Nikula
  0 siblings, 2 replies; 3+ messages in thread
From: Jani Nikula @ 2011-11-23 21:08 UTC (permalink / raw)
  To: notmuch

Hi, this is a quick proof-of-concept implementation of an idea by m1lkc0w on IRC
(transcript below) to allow functions in saved searches. I'm not quite sure
whether I'm for or against the idea, though it's kind of neat... :)

Patch 1 adds the implementation. The (if (functionp ...)) parts should obviously
be abstracted, but otherwise there's not much to it.

Patch 2 has a couple of crude example functions (that I just shoved into
notmuch-hello.el) that might be useful in saved searches. One to match
everything that the other saved searches don't, another a building block to
combine existing saved searches.

Comments are welcome, though I don't think I'll be pursuing this much further.

BR,
Jani.


PS. For the original problem of date range searches there's also
id:"cover.1312964528.git.jani@nikula.org" if you're willing to live with such
out of tree patches (they won't be merged).


[2011-11-23 UTC+2]
 00:43         m1lkc0w   How difficult would it be to allow functions in "saved 
                         searches"?
 00:46         m1lkc0w   This could be helpful to define functions for 
                         calculating search timestamps
 00:48         bremner   m1lkc0w: personally I'd like to get away from saved 
                         searches being emacs specific
 00:48         bremner   for dates, would it solve your problem if notmuch had 
                         a sensible date parser?
 00:49         m1lkc0w   bremner: sure.
 00:49         m1lkc0w   bremner: I just thought that in the meantime, I can 
                         calculate the timespamps in elisp
 00:50         m1lkc0w   bremner: Just wanted to list last week's email - 
                         that's hwo the idea came up
 00:51         bremner   I guess it wouldn't be that hard for someone with 
                         elisp skillz to make saved searches have a ("name" . 
                         function ) in addition to (name . string)


Jani Nikula (2):
  emacs: allow functions as saved searches
  emacs: a couple of example functions that might be useful with saved
    searches

 emacs/notmuch-hello.el |   27 +++++++++++++++++++++++++--
 emacs/notmuch-lib.el   |    8 ++++++--
 emacs/notmuch.el       |    9 +++++++--
 3 files changed, 38 insertions(+), 6 deletions(-)

-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-23 21:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-23 21:08 [RFC PATCH 0/2] emacs proof-of-concept: functions in saved searches Jani Nikula
2011-11-23 21:08 ` [RFC PATCH 1/2] emacs: allow functions as " Jani Nikula
2011-11-23 21:08 ` [RFC PATCH 2/2] emacs: a couple of example functions that might be useful with " Jani Nikula

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).