From: David Edmondson <dme@dme.org>
To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org
Subject: Re: [PATCH] emacs: put current query as default value in notmuch-read-query
Date: Tue, 06 May 2014 08:44:53 +0100 [thread overview]
Message-ID: <cund2frfj0q.fsf@hotblack-desiato.hh.sledj.net> (raw)
In-Reply-To: <874n134bbi.fsf@qmul.ac.uk>
[-- Attachment #1: Type: text/plain, Size: 1766 bytes --]
On Tue, May 06 2014, Mark Walters wrote:
> Hi
>
> On Tue, 06 May 2014, David Edmondson <dme@dme.org> wrote:
>> On Sat, May 03 2014, Mark Walters wrote:
>>> An alternative to putting the logic in notmuch-read-query would be to
>>> store the query in a consistently named buffer local variable in all
>>> the modes. If we want to show the actually run query in notmuch-show
>>> above then this is probably the neatest solution.
>>
>> Could per-mode query functions not simply pass the default as an
>> optional second argument to `notmuch-read-query'?
>
> They could but at the moment notmuch-search and notmuch-tree are both
> bound in the global key map and they in turn call notmuch-read-query.
>
> I guess we could add an argument to notmuch-search and notmuch-tree
> for the default argument (which they would pass to
> notmuch-read-query). Then calling modes which know a search value
> (show,search and tree) could override the global keymap (probably using
> remap or something to mean that they keep any customised binding) to
> link into something which passes the default value through.
I would probably replace the global keymap bindings, but others should
chime in.
> One variant which might be nicer than the current version would be to
> have something like
> (let ((current-query (case major-mode
> (notmuch-show-mode (notmuch-show-get-current-query))
> (notmuch-tree-mode (notmuch-tree-get-current-query))
> (notmuch-search-mode (notmuch-search-get-current-query))))))
>
> so at least all the logic for calculating the current query can live in
> the relevant file.
>
> What do you think?
This is nicer than the current patch.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 310 bytes --]
next prev parent reply other threads:[~2014-05-06 7:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-03 16:12 [PATCH] emacs: put current query as default value in notmuch-read-query Mark Walters
2014-05-06 6:35 ` David Edmondson
2014-05-06 7:26 ` Mark Walters
2014-05-06 7:44 ` David Edmondson [this message]
2014-06-23 21:06 ` [PATCH v2] emacs: set default " Mark Walters
2014-07-16 9:38 ` David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cund2frfj0q.fsf@hotblack-desiato.hh.sledj.net \
--to=dme@dme.org \
--cc=markwalters1009@gmail.com \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).