+2004-09-26  Jesper Harder  <harder@ifa.au.dk>
+
+       * gnus-dup.el (gnus-dup-open): Use mapc.
+       (gnus-dup-enter-articles, gnus-dup-suppress-articles): Use dolist.
+       
+       (gnus-dup-enter-articles): Remove excess ID's from gnus-dup-hashtb.
+       Reported by Stefan Wiens <s.wi@gmx.net>.
+
+       * gnus.el (gnus-shutdown): Use dolist.
+
+       * gnus-undo.el (gnus-undo): Use mapc.
+
+       * nnrss.el (nnrss-generate-active): do.
+
+       * message.el (message-cite-original-without-signature)
+       (message-cite-original): Use mapc.
+       (message-do-actions, message-make-forward-subject): Use dolist.
+
 2004-09-25  Kevin Greiner  <kgreiner@compsol.cc>
 
        * gnus-agent.el (gnus-agent-check-overview-buffer): Fixed range of
 
 ;;; gnus-dup.el --- suppression of duplicate articles in Gnus
-;; Copyright (C) 1996, 1997, 1998, 1999, 2000
+;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2004
 ;;        Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
     (setq gnus-dup-list nil))
   (setq gnus-dup-hashtb (gnus-make-hashtable gnus-duplicate-list-length))
   ;; Enter all Message-IDs into the hash table.
-  (let ((list gnus-dup-list)
-       (obarray gnus-dup-hashtb))
-    (while list
-      (intern (pop list)))))
+  (let ((obarray gnus-dup-hashtb))
+    (mapc 'intern gnus-dup-list)))
 
 (defun gnus-dup-read ()
   "Read the duplicate suppression list."
   (unless gnus-dup-list
     (gnus-dup-open))
   (setq gnus-dup-list-dirty t)         ; mark list for saving
-  (let ((data gnus-newsgroup-data)
-       datum msgid)
+  (let (msgid)
     ;; Enter the Message-IDs of all read articles into the list
     ;; and hash table.
-    (while (setq datum (pop data))
+    (dolist (datum gnus-newsgroup-data)
       (when (and (not (gnus-data-pseudo-p datum))
                 (> (gnus-data-number datum) 0)
                 (not (memq (gnus-data-number datum) gnus-newsgroup-unreads))
   ;; Chop off excess Message-IDs from the list.
   (let ((end (nthcdr gnus-duplicate-list-length gnus-dup-list)))
     (when end
+      (mapc (lambda (id) (unintern id gnus-dup-hashtb)) (cdr end))
       (setcdr end nil))))
 
 (defun gnus-dup-suppress-articles ()
   (unless gnus-dup-list
     (gnus-dup-open))
   (gnus-message 6 "Suppressing duplicates...")
-  (let ((headers gnus-newsgroup-headers)
-       (auto (and gnus-newsgroup-auto-expire
+  (let ((auto (and gnus-newsgroup-auto-expire
                   (memq gnus-duplicate-mark gnus-auto-expirable-marks)))
-       number header)
-    (while (setq header (pop headers))
+       number)
+    (dolist (header gnus-newsgroup-headers)
       (when (and (intern-soft (mail-header-id header) gnus-dup-hashtb)
                 (gnus-summary-article-unread-p (mail-header-number header)))
        (setq gnus-newsgroup-unreads
 
       (error "Nothing further to undo"))
     (setq gnus-undo-actions (delq action gnus-undo-actions))
     (setq gnus-undo-boundary t)
-    (while action
-      (funcall (pop action)))))
+    (mapc 'funcall action)))
 
 (provide 'gnus-undo)
 
 
 
 (defun gnus-shutdown (symbol)
   "Shut down everything that waits for SYMBOL."
-  (let ((alist gnus-shutdown-alist)
-       entry)
-    (while (setq entry (pop alist))
-      (when (memq symbol (cdr entry))
-       (funcall (car entry))))))
+  (dolist (entry gnus-shutdown-alist)
+    (when (memq symbol (cdr entry))
+      (funcall (car entry)))))
 
 \f
 ;;;
 
        ;; Insert a blank line if it is peeled off.
        (insert "\n")))
     (goto-char start)
-    (while functions
-      (funcall (pop functions)))
+    (mapc 'funcall functions)
     (when message-citation-line-function
       (unless (bolp)
        (insert "\n"))
                                  "unknown sender"))
        (setq x-no-archive (message-fetch-field "x-no-archive")))
       (goto-char start)
-      (while functions
-       (funcall (pop functions)))
+      (mapc 'funcall functions)
       (when message-citation-line-function
        (unless (bolp)
          (insert "\n"))
 (defun message-do-actions (actions)
   "Perform all actions in ACTIONS."
   ;; Now perform actions on successful sending.
-  (while actions
+  (dolist (action actions)
     (ignore-errors
       (cond
        ;; A simple function.
-       ((functionp (car actions))
-       (funcall (car actions)))
+       ((functionp action)
+       (funcall action))
        ;; Something to be evaled.
        (t
-       (eval (car actions)))))
-    (pop actions)))
+       (eval action))))))
 
 (defsubst message-maybe-split-and-send-mail ()
   "Split a message if necessary, and send it via mail.
     ;; When sending via news, make sure the total folded length will
     ;; be less than 998 characters.  This is to cater to broken INN
     ;; 2.3 which counts the total number of characters in a header
-    ;; rather than the physical line length of each line, as it shuld.
+    ;; rather than the physical line length of each line, as it should.
     ;;
     ;; This hack should be removed when it's believed than INN 2.3 is
     ;; no longer widely used.
                      subject
                    (nnheader-decode-subject subject))
                ""))
-       (if message-wash-forwarded-subjects
-           (setq subject (message-wash-subject subject)))
+       (when message-wash-forwarded-subjects
+         (setq subject (message-wash-subject subject)))
        ;; Make sure funcs is a list.
        (and funcs
             (not (listp funcs))
             (setq funcs (list funcs)))
        ;; Apply funcs in order, passing subject generated by previous
        ;; func to the next one.
-       (while funcs
-         (when (functionp (car funcs))
-           (setq subject (funcall (car funcs) subject)))
-         (setq funcs (cdr funcs)))
+       (dolist (func funcs)
+         (when (functionp func)
+           (setq subject (funcall func subject))))
        subject))))
 
 ;;;###autoload
 
 (defvar nnrss-extra-categories '(nnrss-snarf-moreover-categories))
 
 (defun nnrss-generate-active ()
-  (if (y-or-n-p "Fetch extra categories? ")
-      (dolist (func nnrss-extra-categories)
-       (funcall func)))
+  (when (y-or-n-p "Fetch extra categories? ")
+    (mapc 'funcall nnrss-extra-categories))
   (save-excursion
     (set-buffer nntp-server-buffer)
     (erase-buffer)