[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: nnmail split multi-byte bug or feature?
From: |
Katsumi Yamaoka |
Subject: |
Re: nnmail split multi-byte bug or feature? |
Date: |
Wed, 08 Dec 2010 15:44:21 -0000 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) |
Newsgroups: gnu.emacs.gnus
Cc: info-gnus-english@gnu.org
Katsumi Yamaoka wrote:
> stormwatch wrote:
>> BTW, I'd like to change gnus-subscribe-options-newsgroup-method to
>> 'gnus-subscribe-topics. Some time ago I tried to add a topic parameter
>> in my .gnus with no success, forcing me to edit the topic parameters
>> interactively each time I reinstalled or moved my os. Is it possible
>> to add something like '(("utn" (subscribe . "\\.utn"))) to gnus-
>> parameters? ("utn" being the topic name).
> I'll try it.
There seems to be no other way than to modify `gnus-topic-topology'
(~/.newsrc.eld specifies its value). How about this?
--8<---------------cut here---------------start------------->8---
(require 'gnus-topic)
(add-hook
'gnus-setup-news-hook
(lambda ()
;; Create the "utn" topic if needed.
(unless (member "utn" (gnus-topic-list))
(gnus-topic-create-topic "utn" (caar gnus-topic-topology)))
;; Add `(subscribe . "\\.utn")' parameter to the "utn" topic if needed.
(let* ((subscribe '((subscribe . "\\.utn")))
(topology (cadr (gnus-topic-find-topology "utn")))
(len (length topology))
(params (car (nthcdr 3 topology))))
(cond ((= len 1)
(setcdr topology `(visible nil ,subscribe)))
((= len 2)
(setcdr (cdr topology) `(nil ,subscribe)))
((or (= len 3) (equal params '(nil)) (not (consp params)))
(setcdr (cddr topology) `(,subscribe)))
((not (assq 'subscribe params))
(setcdr params (copy-sequence params))
(setcar params subscribe))))))
--8<---------------cut here---------------end--------------->8---
If you want to set the group level, try adding this one:
--8<---------------cut here---------------start------------->8---
(add-hook
'gnus-setup-news-hook
(lambda ()
;; Add `(subscribe-level . 1)' parameter to the "utn" topic if needed.
(let ((params (car (nthcdr 3 (cadr (gnus-topic-find-topology "utn"))))))
(unless (assq 'subscribe-level params)
(setcdr params (copy-sequence params))
(setcar params '(subscribe-level . 1)))
params))
'append)
--8<---------------cut here---------------end--------------->8---