unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 3/3] Add notmuch-hello-mode-hook
@ 2011-10-29 16:35 Ivy Foster
  2011-10-30 10:06 ` Thomas Jost
  0 siblings, 1 reply; 5+ messages in thread
From: Ivy Foster @ 2011-10-29 16:35 UTC (permalink / raw)
  To: notmuch

The following patch adds a mode-hook to notmuch-hello-mode.
Not much else to say, really.

Would people find hooks for before and/or after adding the
tags useful? Or hooks elsewhere in this mode (or other
modes)?

iff

Signed-off-by: Ivy Foster <joyfulgirl@archlinux.us>
From e8cdead0222fc85dd01d8a0185b54aed5e0a6e1e Mon Sep 17 00:00:00 2001
From: Ivy Foster <joyfulgirl@archlinux.us>
Date: Fri, 28 Oct 2011 23:47:16 -0400
Subject: [PATCH 3/3] Added notmuch-hello-mode-hook

---
 emacs/notmuch-hello.el |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

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)
 )
 
-- 
1.7.7.1

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

* Re: [PATCH 3/3] Add notmuch-hello-mode-hook
  2011-10-29 16:35 [PATCH 3/3] Add notmuch-hello-mode-hook Ivy Foster
@ 2011-10-30 10:06 ` Thomas Jost
  2011-10-30 15:54   ` Ivy Foster
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Jost @ 2011-10-30 10:06 UTC (permalink / raw)
  To: Ivy Foster, notmuch

[-- Attachment #1: Type: text/plain, Size: 541 bytes --]

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,

-- 
Thomas/Schnouki

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

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

* Re: [PATCH 3/3] Add notmuch-hello-mode-hook
  2011-10-30 10:06 ` Thomas Jost
@ 2011-10-30 15:54   ` Ivy Foster
  2011-10-30 23:37     ` Daniel Schoepe
  2011-11-11  1:54     ` Pieter Praet
  0 siblings, 2 replies; 5+ messages in thread
From: Ivy Foster @ 2011-10-30 15:54 UTC (permalink / raw)
  To: Thomas Jost, notmuch

[-- Attachment #1: Type: text/plain, Size: 901 bytes --]

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

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: [PATCH 3/3] Add notmuch-hello-mode-hook
  2011-10-30 15:54   ` Ivy Foster
@ 2011-10-30 23:37     ` Daniel Schoepe
  2011-11-11  1:54     ` Pieter Praet
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel Schoepe @ 2011-10-30 23:37 UTC (permalink / raw)
  To: Ivy Foster, Thomas Jost, notmuch

[-- Attachment #1: Type: text/plain, Size: 620 bytes --]

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

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

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

* Re: [PATCH 3/3] Add notmuch-hello-mode-hook
  2011-10-30 15:54   ` Ivy Foster
  2011-10-30 23:37     ` Daniel Schoepe
@ 2011-11-11  1:54     ` Pieter Praet
  1 sibling, 0 replies; 5+ messages in thread
From: Pieter Praet @ 2011-11-11  1:54 UTC (permalink / raw)
  To: Ivy Foster, Thomas Jost, notmuch

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

-- 
Pieter

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

end of thread, other threads:[~2011-11-11  1:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-29 16:35 [PATCH 3/3] Add notmuch-hello-mode-hook Ivy Foster
2011-10-30 10:06 ` Thomas Jost
2011-10-30 15:54   ` Ivy Foster
2011-10-30 23:37     ` Daniel Schoepe
2011-11-11  1:54     ` Pieter Praet

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).