Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* exec elisp when entering group
@ 2007-11-28 23:04 Richard G Riley
  2007-11-29  1:05 ` Katsumi Yamaoka
  0 siblings, 1 reply; 2+ messages in thread
From: Richard G Riley @ 2007-11-28 23:04 UTC (permalink / raw)
  To: info-gnus-english



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

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

* Re: exec elisp when entering group
  2007-11-28 23:04 exec elisp when entering group Richard G Riley
@ 2007-11-29  1:05 ` Katsumi Yamaoka
  0 siblings, 0 replies; 2+ messages in thread
From: Katsumi Yamaoka @ 2007-11-29  1:05 UTC (permalink / raw)
  To: info-gnus-english

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

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

end of thread, other threads:[~2007-11-29  1:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-28 23:04 exec elisp when entering group Richard G Riley
2007-11-29  1:05 ` Katsumi Yamaoka

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 NNTP newsgroup(s).