From: yamaoka Date: Tue, 5 Oct 2004 22:34:39 +0000 (+0000) Subject: Synch to No Gnus 200410052203. X-Git-Tag: t-gnus-6_17_4-quimby-~727 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=c3b7d1685c9733f400a1366ebfd0979a145cd426;p=elisp%2Fgnus.git- Synch to No Gnus 200410052203. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2c1bcbd..ad8a107 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,34 @@ +2004-10-06 Jesper Harder + + * gnus-sum.el (gnus-summary-show-article): Use with-current-buffer. + +2004-10-05 Jesper Harder + + * nnsoup.el (nnsoup-read-active-file): Use dolist, mapc or last + where approriate. + + * nnml.el (nnml-generate-active-info): do. + + * nndiary.el (nndiary-generate-active-info): do. + + * gnus-topic.el (gnus-topic-hierarchical-parameters): do. + (gnus-topic-move): do. + + * gnus-sum.el (gnus-data-enter-list, gnus-summary-process-mark-set) + (gnus-summary-set-local-parameters, gnus-summary-read-document): do. + + * gnus-srvr.el (gnus-server-prepare) + (gnus-server-open-all-servers): do. + + * gnus-msg.el (gnus-summary-cancel-article) + (gnus-summary-resend-message) + (gnus-summary-mail-crosspost-complaint): do. + + * gnus-move.el (gnus-change-server): do. + + * gnus-group.el (gnus-group-unmark-all-groups) + (gnus-group-set-current-level): do. + 2004-10-04 Simon Josefsson * message.el (message-generate-hashcash): Doc fix. diff --git a/lisp/gnus-group.el b/lisp/gnus-group.el index 23284bc..9ed15ff 100644 --- a/lisp/gnus-group.el +++ b/lisp/gnus-group.el @@ -1780,10 +1780,8 @@ If FIRST-TOO, the current line is also eligible as a target." (defun gnus-group-unmark-all-groups () "Unmark all groups." (interactive) - (let ((groups gnus-group-marked)) - (save-excursion - (while groups - (gnus-group-remove-mark (pop groups))))) + (save-excursion + (mapc 'gnus-group-remove-mark gnus-group-marked)) (gnus-group-position-point)) (defun gnus-group-mark-region (unmark beg end) @@ -3319,16 +3317,14 @@ Uses the process/prefix convention." s)))))) (unless (and (>= level 1) (<= level gnus-level-killed)) (error "Invalid level: %d" level)) - (let ((groups (gnus-group-process-prefix n)) - group) - (while (setq group (pop groups)) - (gnus-group-remove-mark group) - (gnus-message 6 "Changed level of %s from %d to %d" - group (or (gnus-group-group-level) gnus-level-killed) - level) - (gnus-group-change-level - group level (or (gnus-group-group-level) gnus-level-killed)) - (gnus-group-update-group-line))) + (dolist (group (gnus-group-process-prefix n)) + (gnus-group-remove-mark group) + (gnus-message 6 "Changed level of %s from %d to %d" + group (or (gnus-group-group-level) gnus-level-killed) + level) + (gnus-group-change-level + group level (or (gnus-group-group-level) gnus-level-killed)) + (gnus-group-update-group-line)) (gnus-group-position-point)) (defun gnus-group-unsubscribe (&optional n) diff --git a/lisp/gnus-move.el b/lisp/gnus-move.el index 3e06945..a949eb9 100644 --- a/lisp/gnus-move.el +++ b/lisp/gnus-move.el @@ -52,10 +52,8 @@ Update the .newsrc.eld file to reflect the change of nntp server." (save-excursion ;; Go through all groups and translate. - (let ((newsrc gnus-newsrc-alist) - (nntp-nov-gap nil) - info) - (while (setq info (pop newsrc)) + (let ((nntp-nov-gap nil)) + (dolist (info gnus-newsrc-alist) (when (gnus-group-native-p (gnus-info-group info)) (gnus-move-group-to-server info from-server to-server)))))) diff --git a/lisp/gnus-msg.el b/lisp/gnus-msg.el index 8f4c193..5101576 100644 --- a/lisp/gnus-msg.el +++ b/lisp/gnus-msg.el @@ -849,12 +849,10 @@ Uses the process-prefix convention. If given the symbolic prefix `a', cancel using the standard posting method; if not post using the current select method." (interactive (gnus-interactive "P\ny")) - (let ((articles (gnus-summary-work-articles n)) - (message-post-method + (let ((message-post-method `(lambda (arg) - (gnus-post-method (eq ',symp 'a) ,gnus-newsgroup-name))) - article) - (while (setq article (pop articles)) + (gnus-post-method (eq ',symp 'a) ,gnus-newsgroup-name)))) + (dolist (article (gnus-summary-work-articles n)) (when (gnus-summary-select-article t nil nil article) (when (gnus-eval-in-buffer-window gnus-article-buffer (save-excursion @@ -1454,14 +1452,12 @@ forward those articles instead." (with-current-buffer gnus-original-article-buffer (nnmail-fetch-field "to")))) current-prefix-arg)) - (let ((articles (gnus-summary-work-articles n)) - article) - (while (setq article (pop articles)) - (gnus-summary-select-article nil nil nil article) - (save-excursion - (set-buffer gnus-original-article-buffer) - (message-resend address)) - (gnus-summary-mark-article-as-forwarded article)))) + (dolist (article (gnus-summary-work-articles n)) + (gnus-summary-select-article nil nil nil article) + (save-excursion + (set-buffer gnus-original-article-buffer) + (message-resend address)) + (gnus-summary-mark-article-as-forwarded article))) ;; From: Matthieu Moy (defun gnus-summary-resend-message-edit () @@ -1540,37 +1536,35 @@ The current group name will be inserted at \"%s\".") (defun gnus-summary-mail-crosspost-complaint (n) "Send a complaint about crossposting to the current article(s)." (interactive "P") - (let ((articles (gnus-summary-work-articles n)) - article) - (while (setq article (pop articles)) - (set-buffer gnus-summary-buffer) - (gnus-summary-goto-subject article) - (let ((group (gnus-group-real-name gnus-newsgroup-name)) - newsgroups followup-to) - (gnus-summary-select-article) - (set-buffer gnus-original-article-buffer) - (if (and (<= (length (message-tokenize-header - (setq newsgroups - (mail-fetch-field "newsgroups")) - ", ")) - 1) - (or (not (setq followup-to (mail-fetch-field "followup-to"))) - (not (member group (message-tokenize-header - followup-to ", "))))) - (if followup-to - (gnus-message 1 "Followup-to restricted") - (gnus-message 1 "Not a crossposted article")) - (set-buffer gnus-summary-buffer) - (gnus-summary-reply-with-original 1) - (set-buffer gnus-message-buffer) - (message-goto-body) - (insert (format gnus-crosspost-complaint newsgroups group)) - (message-goto-subject) - (re-search-forward " *$") - (replace-match " (crosspost notification)" t t) - (gnus-deactivate-mark) - (when (gnus-y-or-n-p "Send this complaint? ") - (message-send-and-exit))))))) + (dolist (article (gnus-summary-work-articles n)) + (set-buffer gnus-summary-buffer) + (gnus-summary-goto-subject article) + (let ((group (gnus-group-real-name gnus-newsgroup-name)) + newsgroups followup-to) + (gnus-summary-select-article) + (set-buffer gnus-original-article-buffer) + (if (and (<= (length (message-tokenize-header + (setq newsgroups + (mail-fetch-field "newsgroups")) + ", ")) + 1) + (or (not (setq followup-to (mail-fetch-field "followup-to"))) + (not (member group (message-tokenize-header + followup-to ", "))))) + (if followup-to + (gnus-message 1 "Followup-to restricted") + (gnus-message 1 "Not a crossposted article")) + (set-buffer gnus-summary-buffer) + (gnus-summary-reply-with-original 1) + (set-buffer gnus-message-buffer) + (message-goto-body) + (insert (format gnus-crosspost-complaint newsgroups group)) + (message-goto-subject) + (re-search-forward " *$") + (replace-match " (crosspost notification)" t t) + (gnus-deactivate-mark) + (when (gnus-y-or-n-p "Send this complaint? ") + (message-send-and-exit)))))) (defun gnus-mail-parse-comma-list () (let (accumulated diff --git a/lisp/gnus-srvr.el b/lisp/gnus-srvr.el index 7d365fb..3cb9599 100644 --- a/lisp/gnus-srvr.el +++ b/lisp/gnus-srvr.el @@ -315,7 +315,6 @@ The following commands are available: (gnus-set-format 'server t) (let ((alist gnus-server-alist) (buffer-read-only nil) - (opened gnus-opened-servers) done server op-ser) (erase-buffer) (setq gnus-inserted-opened-servers nil) @@ -330,16 +329,15 @@ The following commands are available: (pop alist))) ;; Then we insert the list of servers that have been opened in ;; this session. - (while opened - (when (and (not (member (caar opened) done)) + (dolist (open gnus-opened-servers) + (when (and (not (member (car open) done)) ;; Just ignore ephemeral servers. - (not (member (caar opened) gnus-ephemeral-servers))) - (push (caar opened) done) + (not (member (car open) gnus-ephemeral-servers))) + (push (car open) done) (gnus-server-insert-server-line - (setq op-ser (format "%s:%s" (caaar opened) (nth 1 (caar opened)))) - (caar opened)) - (push (list op-ser (caar opened)) gnus-inserted-opened-servers)) - (setq opened (cdr opened)))) + (setq op-ser (format "%s:%s" (caar open) (nth 1 (car open)))) + (car open)) + (push (list op-ser (car open)) gnus-inserted-opened-servers)))) (goto-char (point-min)) (gnus-server-position-point)) @@ -501,9 +499,8 @@ The following commands are available: (defun gnus-server-open-all-servers () "Open all servers." (interactive) - (let ((servers gnus-inserted-opened-servers)) - (while servers - (gnus-server-open-server (car (pop servers)))))) + (dolist (server gnus-inserted-opened-servers) + (gnus-server-open-server (car server)))) (defun gnus-server-close-server (server) "Close SERVER." diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 3f2aff7..7341eb3 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -2858,8 +2858,7 @@ The following commands are available: (gnus-data-update-list odata offset))) ;; Find the last element in the list to be spliced into the main ;; list. - (while (cdr list) - (setq list (cdr list))) + (setq list (last list)) (if (not data) (progn (setcdr list gnus-newsgroup-data) @@ -3476,12 +3475,8 @@ This function is intended to be used in (defun gnus-summary-set-local-parameters (group) "Go through the local params of GROUP and set all variable specs in that list." - (let ((params (gnus-group-find-parameter group)) - (vars '(quit-config)) ; Ignore quit-config. - elem) - (while params - (setq elem (car params) - params (cdr params)) + (let ((vars '(quit-config))) ; Ignore quit-config. + (dolist (elem (gnus-group-find-parameter group)) (and (consp elem) ; Has to be a cons. (consp (cdr elem)) ; The cdr has to be a list. (symbolp (car elem)) ; Has to be a symbol in there. @@ -6179,8 +6174,7 @@ executed with point over the summary line of the articles." (defun gnus-summary-process-mark-set (set) "Make SET into the current process marked articles." (gnus-summary-unmark-all-processable) - (while set - (gnus-summary-set-process-mark (pop set)))) + (mapc 'gnus-summary-set-process-mark set)) ;;; Searching and stuff @@ -8392,12 +8386,11 @@ This will allow you to read digests and other similar documents as newsgroups. Obeys the standard process/prefix convention." (interactive "P") - (let* ((articles (gnus-summary-work-articles n)) - (ogroup gnus-newsgroup-name) + (let* ((ogroup gnus-newsgroup-name) (params (append (gnus-info-params (gnus-get-info ogroup)) (list (cons 'to-group ogroup)))) - article group egroup groups vgroup) - (while (setq article (pop articles)) + group egroup groups vgroup) + (dolist (article (gnus-summary-work-articles n)) (setq group (format "%s-%d" gnus-newsgroup-name article)) (gnus-summary-remove-process-mark article) (when (gnus-summary-display-article article) @@ -8857,8 +8850,7 @@ strokes are `C-u g'." (or (cdr (assq arg gnus-summary-show-article-charset-alist)) (mm-read-coding-system "View as charset: " ;; actually it is coding system. - (save-excursion - (set-buffer gnus-article-buffer) + (with-current-buffer gnus-article-buffer (mm-detect-coding-region (point) (point-max)))))) (default-mime-charset gnus-newsgroup-charset) (gnus-newsgroup-ignored-charsets 'gnus-all)) diff --git a/lisp/gnus-topic.el b/lisp/gnus-topic.el index f0d040f..9023d03 100644 --- a/lisp/gnus-topic.el +++ b/lisp/gnus-topic.el @@ -394,10 +394,9 @@ If RECURSIVE is t, return groups in its subtopics too." (defun gnus-topic-hierarchical-parameters (topic) "Return a topic list computed for TOPIC." - (let ((topics (gnus-current-topics topic)) - params-list param out params) - (while topics - (push (gnus-topic-parameters (pop topics)) params-list)) + (let ((params-list (nreverse (mapcar 'gnus-topic-parameters + (gnus-current-topic topic)))) + param out params) ;; We probably have lots of nil elements here, so ;; we remove them. Probably faster than doing this "properly". (setq params-list (delq nil params-list)) @@ -1731,9 +1730,7 @@ If REVERSE, reverse the sorting order." (if (gnus-topic-find-topology to current-top 0);; Don't care the level (error "Can't move `%s' to its sub-level" current)) (gnus-topic-find-topology current nil nil 'delete) - (while (cdr to-top) - (setq to-top (cdr to-top))) - (setcdr to-top (list current-top)) + (setcdr (last to-top) (list current-top)) (gnus-topic-enter-dribble) (gnus-group-list-groups) (gnus-topic-goto-topic current))) diff --git a/lisp/nndiary.el b/lisp/nndiary.el index 28cf37e..f2012f1 100644 --- a/lisp/nndiary.el +++ b/lisp/nndiary.el @@ -1213,9 +1213,7 @@ all. This may very well take some time.") (push (list group (cons (or (caar files) (1+ last)) (max last - (or (let ((f files)) - (while (cdr f) (setq f (cdr f))) - (caar f)) + (or (caar (last files)) 0)))) nndiary-group-alist))) diff --git a/lisp/nnml.el b/lisp/nnml.el index f4dd98c..712afa0 100644 --- a/lisp/nnml.el +++ b/lisp/nnml.el @@ -797,9 +797,7 @@ marks file will be regenerated properly by Gnus.") (push (list group (cons (or (caar files) (1+ last)) (max last - (or (let ((f files)) - (while (cdr f) (setq f (cdr f))) - (caar f)) + (or (caar (last files)) 0)))) nnml-group-alist))) diff --git a/lisp/nnsoup.el b/lisp/nnsoup.el index ed457ea..c41f22d 100644 --- a/lisp/nnsoup.el +++ b/lisp/nnsoup.el @@ -370,9 +370,7 @@ backend for the messages.") entry e min max) (while (setq e (cdr (setq entry (pop alist)))) (setq min (caaar e)) - (while (cdr e) - (setq e (cdr e))) - (setq max (cdar (car e))) + (setq max (cdar (car (last e)))) (setcdr entry (cons (cons min max) (cdr entry))))) (setq nnsoup-group-alist-touched t)) nnsoup-group-alist))