* gnus-util.el (gnus-delete-if): Rename to gnus-remove-if.
authorJesper Harder <harder@ifa.au.dk>
Wed, 5 Feb 2003 05:21:19 +0000 (05:21 +0000)
committerJesper Harder <harder@ifa.au.dk>
Wed, 5 Feb 2003 05:21:19 +0000 (05:21 +0000)
"delete-if" is misleading because it isn't actually destructive.

* gnus-topic.el (gnus-group-prepare-topics): Use new name.

* nnmail.el (nnmail-purge-split-history): do.

* gnus-win.el (gnus-get-buffer-window): do.

* gnus-sum.el (gnus-simplify-whitespace): Remove unnecessary
let-binding.
(gnus-simplify-all-whitespace): do.

lisp/ChangeLog
lisp/gnus-sum.el
lisp/gnus-topic.el
lisp/gnus-util.el
lisp/gnus-win.el
lisp/nnmail.el

index ba14d16..03200c9 100644 (file)
@@ -1,3 +1,18 @@
+2003-02-05  Jesper Harder  <harder@ifa.au.dk>
+
+       * gnus-util.el (gnus-delete-if): Rename to gnus-remove-if.
+       "delete-if" is misleading because it isn't actually destructive.
+
+       * gnus-topic.el (gnus-group-prepare-topics): Use new name.
+       
+       * nnmail.el (nnmail-purge-split-history): do.
+
+       * gnus-win.el (gnus-get-buffer-window): do.
+       
+       * gnus-sum.el (gnus-simplify-whitespace): Remove unnecessary
+       let-binding.
+       (gnus-simplify-all-whitespace): do.
+
 2003-02-05  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * gnus-delay.el (gnus-delay-article): Fix binding of the
index ba1b270..cbbe19f 100644 (file)
@@ -1392,26 +1392,24 @@ For example:
 
 (defun gnus-simplify-whitespace (str)
   "Remove excessive whitespace from STR."
-  (let ((mystr str))
-    ;; Multiple spaces.
-    (while (string-match "[ \t][ \t]+" mystr)
-      (setq mystr (concat (substring mystr 0 (match-beginning 0))
-                         " "
-                         (substring mystr (match-end 0)))))
-    ;; Leading spaces.
-    (when (string-match "^[ \t]+" mystr)
-      (setq mystr (substring mystr (match-end 0))))
-    ;; Trailing spaces.
-    (when (string-match "[ \t]+$" mystr)
-      (setq mystr (substring mystr 0 (match-beginning 0))))
-    mystr))
+  ;; Multiple spaces.
+  (while (string-match "[ \t][ \t]+" str)
+    (setq str (concat (substring str 0 (match-beginning 0))
+                       " "
+                       (substring str (match-end 0)))))
+  ;; Leading spaces.
+  (when (string-match "^[ \t]+" str)
+    (setq str (substring str (match-end 0))))
+  ;; Trailing spaces.
+  (when (string-match "[ \t]+$" str)
+    (setq str (substring str 0 (match-beginning 0))))
+  str)
 
 (defun gnus-simplify-all-whitespace (str)
   "Remove all whitespace from STR."
-  (let ((mystr str))
-    (while (string-match "[ \t\n]+" mystr)
-      (setq mystr (replace-match "" nil nil mystr)))
-    mystr))
+  (while (string-match "[ \t\n]+" str)
+    (setq str (replace-match "" nil nil str)))
+  str)
 
 (defsubst gnus-simplify-subject-re (subject)
   "Remove \"Re:\" from subject lines."
index 338afb5..9d656b8 100644 (file)
@@ -1,5 +1,5 @@
 ;;; gnus-topic.el --- a folding minor mode for Gnus group buffers
-;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
 ;;        Free Software Foundation, Inc.
 
 ;; Author: Ilja Weis <kult@uni-paderborn.de>
@@ -461,7 +461,7 @@ If LOWEST is non-nil, list all newsgroups of level LOWEST or higher."
        (unless gnus-killed-hashtb
          (gnus-make-hashtable-from-killed))
        (gnus-group-prepare-flat-list-dead
-        (gnus-delete-if (lambda (group)
+        (gnus-remove-if (lambda (group)
                           (or (gnus-gethash group gnus-newsrc-hashtb)
                               (gnus-gethash group gnus-killed-hashtb)))
                         not-in-list)
index be689ff..9582548 100644 (file)
@@ -938,13 +938,13 @@ ARG is passed to the first function."
       (setq tail (cdr tail)))
     (nreverse new)))
 
-(defun gnus-delete-if (predicate list)
-  "Delete elements from LIST that satisfy PREDICATE."
+(defun gnus-remove-if (predicate list)
+  "Return a copy of LIST with all items satisfying PREDICATE removed."
   (let (out)
     (while list
       (unless (funcall predicate (car list))
        (push (car list) out))
-      (pop list))
+      (setq list (cdr list)))
     (nreverse out)))
 
 (if (fboundp 'assq-delete-all)
index cd9ef74..71d3dba 100644 (file)
@@ -1,5 +1,5 @@
 ;;; gnus-win.el --- window configuration functions for Gnus
-;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
+;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
 ;;        Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -571,7 +571,7 @@ should have point."
              (memq frame '(t 0 visible)))
         (car
          (let ((frames (gnus-frames-on-display-list)))
-           (gnus-delete-if (lambda (win) (not (memq (window-frame win)
+           (gnus-remove-if (lambda (win) (not (memq (window-frame win)
                                                     frames)))
                            (get-buffer-window-list buffer nil frame)))))
        (t
index 54843be..65c4ad7 100644 (file)
@@ -1880,7 +1880,7 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
   "Remove all instances of GROUP from `nnmail-split-history'."
   (let ((history nnmail-split-history))
     (while history
-      (setcar history (gnus-delete-if (lambda (e) (string= (car e) group))
+      (setcar history (gnus-remove-if (lambda (e) (string= (car e) group))
                                      (car history)))
       (pop history))
     (setq nnmail-split-history (delq nil nnmail-split-history))))