unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: Jameson Graef Rollins <jrollins@finestructure.net>,
	Notmuch Mail <notmuch@notmuchmail.org>
Subject: Re: RFC: tag macros
Date: Thu, 19 Jan 2012 09:10:19 -0400	[thread overview]
Message-ID: <87d3afltxg.fsf@zancas.localnet> (raw)
In-Reply-To: <87vco8q1yt.fsf@servo.finestructure.net>

On Wed, 18 Jan 2012 10:50:50 -0800, Jameson Graef Rollins <jrollins@finestructure.net> wrote:

> Is all of this really easier than just adding the following to your
> .emacs?:
> 
> (define-key notmuch-search-mode-map "o"
>   (lambda ()
>     (interactive)
>     (notmuch-show-add-tag "notmuch::patch")
>     (notmuch-show-add-tag "notmuch::obsolete")
>     (notmuch-show-remove-tag "notmuch::needs-review")))
> 

I started out along this route.  I think there are a few advantages to
the approach I posted, but only if many people are making similar
snippets for more than one key.

- it doesn't have the 3 lines of boilerplate per keybinding
- it doesn't require the user to program in lisp; I suspect that
  explaining to new users how to customize their lisp snippets is some
  support burden as well.
- it provides the equivalent of a submap, which is another few lines of
  boilerplate. The only actual keybinding is "t" as a prefix. 

In my case, assuming the API was improved a bit as Austin suggested,
this would be a savings of 15-20 lines of boilerplate per user. 

Anyway, we can start by improving and documenting the API, and see how
that goes. The actually "parse lists and turn them into keybindings" part
is only the 4 line function notmuch-show-apply-tag-macro.

> That seems really simple to me, and doesn't require us to support a
> bunch of code to do complicated customization stuff.

I'm admittedly ignorant about emacs customization stuff, this requires a
single list of lists. Personally I use "setq" in .emacs for most
customization; it plays much better with version control.

      parent reply	other threads:[~2012-01-19 13:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-18 14:45 RFC: tag macros David Bremner
2012-01-18 15:04 ` David Edmondson
2012-01-18 18:33 ` Austin Clements
2012-01-18 19:03   ` David Bremner
2012-01-18 19:11     ` Austin Clements
2012-01-18 19:28     ` Jameson Graef Rollins
2012-01-18 18:50 ` Jameson Graef Rollins
2012-01-19  0:04   ` David Bremner
2012-01-19  2:15     ` Jameson Graef Rollins
2012-01-19  2:37       ` David Bremner
2012-01-19 13:10   ` David Bremner [this message]

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=87d3afltxg.fsf@zancas.localnet \
    --to=david@tethera.net \
    --cc=jrollins@finestructure.net \
    --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).