Gnus development mailing list
 help / color / mirror / Atom feed
From: Reiner Steib <reinersteib+gmane@imap.cc>
To: ding@gnus.org
Subject: Re: enter-digest-group automatically
Date: Wed, 03 Oct 2007 17:34:07 +0200	[thread overview]
Message-ID: <v94ph8xle8.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <874ph9ti5w.fsf@jidanni.org>

[ 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/




      reply	other threads:[~2007-10-03 15:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-02 19:45 jidanni
2007-10-03 15:34 ` Reiner Steib [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=v94ph8xle8.fsf@marauder.physik.uni-ulm.de \
    --to=reinersteib+gmane@imap.cc \
    --cc=Reiner.Steib@gmx.de \
    --cc=ding@gnus.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).