info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: exec elisp when entering group


From: Katsumi Yamaoka
Subject: Re: exec elisp when entering group
Date: Thu, 29 Nov 2007 10:05:15 +0900
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux)

>>>>> Richard G Riley wrote:

> Is it possible to execute a group specific elisp block when entering a
> group in Gnus?

There are several hooks that can be used according to your purpose.
Try `M-x apropos RET ^gnus-\(summary\|select\)-.*-hook$ RET'.

`gnus-select-group-hook' is run in the summary buffer just after
entering a group.  The summary buffer is empty.  You can refer to
the `gnus-newsgroup-name' for the news group name.  The variable
`gnus-article-buffer' holds the article buffer name but it has
not been created or has not been prepared.  For instance:

(add-hook 'gnus-select-group-hook
          (lambda ()
            (message "I just entered to the %s group"
                     gnus-newsgroup-name)
            (sit-for 1)))

`gnus-select-article-hook' is run in the summary buffer whenever
an article has been displayed.  For instance:

(add-hook 'gnus-select-article-hook
          (lambda ()
            (message "This article has %d lines"
                     (with-current-buffer gnus-article-buffer
                       (count-lines (point-min) (point-max))))))

See also: (info "(gnus)Group Parameters")


reply via email to

[Prev in Thread] Current Thread [Next in Thread]