| Submitter | Ivy Foster |
|---|---|
| Date | 2011-10-29 16:35:04 |
| Message ID | <87hb2rlps7.fsf@nausicaa.localdomain> |
| Download | mbox | patch |
| Permalink | /patch/1434/ |
| State | New |
| Headers | show |
Comments
On Sat, 29 Oct 2011 12:35:04 -0400, Ivy Foster <joyfulgirl@archlinux.us> wrote: > The following patch adds a mode-hook to notmuch-hello-mode. > Not much else to say, really. I agree it's useful, but id:"1317643438-31272-5-git-send-email-schnouki@schnouki.net" ;) (the hooks are not run from the same place though) > Would people find hooks for before and/or after adding the > tags useful? There are such hooks already: notmuch-{after,before}-tag-hook. Or do you mean something different? Regards,
On Sun, 30 Oct 2011 11:06:38 +0100, Thomas Jost <schnouki@schnouki.net> wrote: > On Sat, 29 Oct 2011 12:35:04 -0400, Ivy Foster <joyfulgirl@archlinux.us> wrote: > > The following patch adds a mode-hook to > > notmuch-hello-mode. Not much else to say, really. > I agree it's useful, but > id:"1317643438-31272-5-git-send-email-schnouki@schnouki.net" > ;) (the hooks are not run from the same place though) Hmm, good point. Whoops again. I guess the question comes down to run-hooks or run-mode-hooks, then. I'll be sure to be more careful about browsing through the archive first, in the future. > > Would people find hooks for before and/or after adding > > the tags useful? > There are such hooks already: > notmuch-{after,before}-tag-hook. Or do you mean something > different? Oh, I meant populating the hello buffer with the list of tags, not around adding or removing a message's tags. iff
On Sun, 30 Oct 2011 11:54:07 -0400, Ivy Foster <joyfulgirl@archlinux.us> wrote: > Oh, I meant populating the hello buffer with the list of > tags, not around adding or removing a message's tags. I sent a patch[1] a while ago that changes notmuch-hello such that the buffer contents are generated by a customizable list of functions. This would also allow to execute arbitrary functions around the ones that generate such tag lists thus eliminating the need for these hooks, if I understand their intended purpose correctly. [1] Latest version: id:"1318253982-23588-1-git-send-email-daniel@schoepe.org" Cheers, Daniel
On Sun, 30 Oct 2011 11:54:07 -0400, Ivy Foster <joyfulgirl@archlinux.us> wrote: > On Sun, 30 Oct 2011 11:06:38 +0100, Thomas Jost <schnouki@schnouki.net> wrote: > > On Sat, 29 Oct 2011 12:35:04 -0400, Ivy Foster <joyfulgirl@archlinux.us> wrote: > > > The following patch adds a mode-hook to > > > notmuch-hello-mode. Not much else to say, really. > > > I agree it's useful, but > > id:"1317643438-31272-5-git-send-email-schnouki@schnouki.net" > > ;) (the hooks are not run from the same place though) > > Hmm, good point. Whoops again. I guess the question comes > down to run-hooks or run-mode-hooks, then. I'll be sure to > be more careful about browsing through the archive first, in > the future. > Digging through the archive is *always* a good idea. It's filled to the brim with treasure, waiting to be re-discovered ;) Here's some more notmuch-hello-mode-hook patches from the past: - id:"1278000507-22290-6-git-send-email-dmitry.kurochkin@gmail.com" - id:"1312799218-10243-1-git-send-email-anarcat@koumbit.org" > > > Would people find hooks for before and/or after adding > > > the tags useful? > > > There are such hooks already: > > notmuch-{after,before}-tag-hook. Or do you mean something > > different? > > Oh, I meant populating the hello buffer with the list of > tags, not around adding or removing a message's tags. > > iff > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch Peace
Patch
diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 1a213f0..13356c5 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -118,6 +118,11 @@ Typically \",\" in the US and UK and \".\" in Europe." :group 'notmuch :type 'string) +(defcustom notmuch-hello-mode-hook nil + "Functions called after entering `notmuch-hello-mode'." + :group 'notmuch + :type 'hook) + (defvar notmuch-hello-url "http://notmuchmail.org" "The `notmuch' web site.") @@ -337,6 +342,7 @@ Complete list of currently available key bindings: (use-local-map notmuch-hello-mode-map) (setq major-mode 'notmuch-hello-mode mode-name "notmuch-hello") + (run-mode-hooks 'notmuch-hello-mode-hook) ;;(setq buffer-read-only t) )