+2004-10-06 Jesper Harder <harder@ifa.au.dk>
+
+ * gnus-sum.el (gnus-summary-show-article): Use with-current-buffer.
+
+2004-10-05 Jesper Harder <harder@ifa.au.dk>
+
+ * 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 <jas@extundo.com>
* message.el (message-generate-hashcash): Doc fix.
(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)
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)
(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))))))
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
(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 <Matthieu.Moy@imag.fr>
(defun gnus-summary-resend-message-edit ()
(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
(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)
(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))
(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."
(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)
(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.
(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
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)
(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))
(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))
(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)))
(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)))
(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)))
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))