emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/gnus/nnspool.el,v


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/gnus/nnspool.el,v
Date: Sun, 28 Oct 2007 09:18:51 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Miles Bader <miles>     07/10/28 09:18:40

Index: lisp/gnus/nnspool.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/gnus/nnspool.el,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- lisp/gnus/nnspool.el        26 Jul 2007 05:27:04 -0000      1.18
+++ lisp/gnus/nnspool.el        28 Oct 2007 09:18:28 -0000      1.19
@@ -246,13 +246,11 @@
        ;; Yes, completely empty spool directories *are* possible.
        ;; Fix by Sudish Joseph <address@hidden>
        (when (setq dir (directory-files pathname nil "^[0-9]+$" t))
-         (setq dir
-               (sort (mapcar (lambda (name) (string-to-number name)) dir) '<)))
+         (setq dir (sort (mapcar 'string-to-number dir) '<)))
        (if dir
            (nnheader-insert
             "211 %d %d %d %s\n" (length dir) (car dir)
-            (progn (while (cdr dir) (setq dir (cdr dir))) (car dir))
-            group)
+            (car (last dir)) group)
          (nnheader-report 'nnspool "Empty group %s" group)
          (nnheader-insert "211 0 0 0 %s\n" group))))))
 
@@ -311,9 +309,8 @@
                            groups)
                      (zerop (forward-line -1))))
          (erase-buffer)
-         (while groups
-           (insert (car groups) " 0 0 y\n")
-           (setq groups (cdr groups))))
+         (dolist (group groups)
+           (insert group " 0 0 y\n")))
        t)
     nil))
 
@@ -400,8 +397,7 @@
                                (<= last (car arts)))
                      (pop arts))
                    ;; The articles in `arts' are missing from the buffer.
-                   (while arts
-                     (nnspool-insert-nov-head (pop arts)))
+                   (mapc 'nnspool-insert-nov-head arts)
                    t))))))))))
 
 (defun nnspool-insert-nov-head (article)
@@ -421,8 +417,7 @@
 
 (defun nnspool-sift-nov-with-sed (articles file)
   (let ((first (car articles))
-       (last (progn (while (cdr articles) (setq articles (cdr articles)))
-                    (car articles))))
+       (last (car (last articles))))
     (call-process "awk" nil t nil
                  (format "BEGIN {firstmsg=%d; lastmsg=%d;}\n $1 >= firstmsg && 
$1 <= lastmsg {print;}"
                          (1- first) (1+ last))
@@ -431,16 +426,12 @@
 ;; Fixed by address@hidden (Frank D. Cringle).
 ;; Find out what group an article identified by a Message-ID is in.
 (defun nnspool-find-id (id)
-  (save-excursion
-    (set-buffer (get-buffer-create " *nnspool work*"))
-    (erase-buffer)
+  (with-temp-buffer
     (ignore-errors
       (call-process "grep" nil t nil (regexp-quote id) nnspool-history-file))
     (goto-char (point-min))
-    (prog1
        (when (looking-at "<[^>]+>[ \t]+[-0-9~]+[ \t]+\\([^ 
/\t\n]+\\)/\\([0-9]+\\)[ \t\n]")
-         (cons (match-string 1) (string-to-number (match-string 2))))
-      (kill-buffer (current-buffer)))))
+      (cons (match-string 1) (string-to-number (match-string 2))))))
 
 (defun nnspool-find-file (file)
   "Insert FILE in server buffer safely."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]