Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: info-gnus-english@gnu.org
Subject: Re: exec elisp when entering group
Date: Thu, 29 Nov 2007 10:05:15 +0900	[thread overview]
Message-ID: <b4msl2prhdg.fsf@jpl.org> (raw)
In-Reply-To: <5r6afaF12ubc4U1@mid.uni-berlin.de>

>>>>> 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	other threads:[~2007-11-29  1:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-28 23:04 Richard G Riley
2007-11-29  1:05 ` Katsumi Yamaoka [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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4msl2prhdg.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=info-gnus-english@gnu.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.
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).