Gnus development mailing list
 help / color / mirror / Atom feed
* enter-digest-group automatically
@ 2007-10-02 19:45 jidanni
  2007-10-03 15:34 ` Reiner Steib
  0 siblings, 1 reply; 2+ messages in thread
From: jidanni @ 2007-10-02 19:45 UTC (permalink / raw)
  To: reiner.steib, ding

How can one invoke gnus-summary-enter-digest-group automatically if a
Subject matches "Digest", instead of having to hit ^D?

Use gnus-select-article-hook? How? Thanks.



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

* Re: enter-digest-group automatically
  2007-10-02 19:45 enter-digest-group automatically jidanni
@ 2007-10-03 15:34 ` Reiner Steib
  0 siblings, 0 replies; 2+ messages in thread
From: Reiner Steib @ 2007-10-03 15:34 UTC (permalink / raw)
  To: ding

[ Please send Gnus questions _only_ to the list. ]

On Tue, Oct 02 2007, jidanni@jidanni.org wrote:

> How can one invoke gnus-summary-enter-digest-group automatically if a
> Subject matches "Digest", instead of having to hit ^D?
>
> Use gnus-select-article-hook? 

Yes, probably.

> How? Thanks.

Maybe like this (only slightly tested; and only for
`rs-gnus-auto-digest-groups'):

--8<---------------cut here---------------start------------->8---
(defvar rs-gnus-auto-digest-groups "de\\.alt\\.netdigest")
(defvar rs-gnus-auto-digest-subjects "^[Dd]igest")

(defun rs-gnus-maybe-enter-digest-mode ()
  (when (or (and (stringp rs-gnus-auto-digest-groups)
		 (string-match rs-gnus-auto-digest-groups gnus-newsgroup-name)
		 (not (string-match "nndoc:.*-[0-9]+" gnus-newsgroup-name)))
	    (and (stringp rs-gnus-auto-digest-subjects)
		 (let ((subject
			(gnus-with-article-buffer
			  (gnus-fetch-field "Subject"))))
		   (and (stringp subject)
			(string-match rs-gnus-auto-digest-subjects subject)))))
    (gnus-message 9 "Entering digest group automatically.")
    ;; (sit-for 1)
    (gnus-summary-enter-digest-group)
    (gnus-summary-show-article)))

(add-hook 'gnus-select-article-hook 'rs-gnus-maybe-enter-digest-mode)
--8<---------------cut here---------------end--------------->8---

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




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

end of thread, other threads:[~2007-10-03 15:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-02 19:45 enter-digest-group automatically jidanni
2007-10-03 15:34 ` Reiner Steib

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