emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp/mail pmail.el


From: Chong Yidong
Subject: [Emacs-diffs] emacs/lisp/mail pmail.el
Date: Mon, 15 Dec 2008 14:56:07 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      08/12/15 14:56:07

Modified files:
        lisp/mail      : pmail.el 

Log message:
        (pmail): Call pmail-swap-buffers-maybe.
        (pmail-search): Call pmail-swap-buffers-maybe.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/mail/pmail.el?cvsroot=emacs&r1=1.29&r2=1.30

Patches:
Index: pmail.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/mail/pmail.el,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- pmail.el    12 Dec 2008 15:26:46 -0000      1.29
+++ pmail.el    15 Dec 2008 14:56:06 -0000      1.30
@@ -871,7 +871,7 @@
         (find-file-noselect file-name))))
     ;; Insure that the collection and view buffers are in sync and
     ;; insure that a message is not being edited.
-    (setq pmail-buffers-swapped-p nil)
+    (pmail-swap-buffers-maybe)
     (if (eq major-mode 'pmail-edit-mode)
        (error "Exit Pmail Edit mode before getting new mail"))
     ;; Insure that the Rmail file is in mbox format, the buffer is in
@@ -2795,28 +2795,27 @@
           (if (< n 0) "Reverse " "")
           regexp)
   (set-buffer pmail-buffer)
-  (pmail-maybe-set-message-counters)
-  (let ((omin (point-min))
-       (omax (point-max))
-       (opoint (point))
-       win
+  (let ((orig-message pmail-current-message)
+       (msg pmail-current-message)
        (reversep (< n 0))
-       (msg pmail-current-message))
-    (unwind-protect
-       (progn
+       (opoint (if pmail-buffers-swapped-p (point)))
+       found)
+    (pmail-swap-buffers-maybe)
+    (pmail-maybe-set-message-counters)
          (widen)
+    (unwind-protect
          (while (/= n 0)
-           ;; Check messages one by one, advancing message number up or down
-           ;; but searching forward through each message.
+         ;; Check messages one by one, advancing message number up or
+         ;; down but searching forward through each message.
            (if reversep
-               (while (and (null win) (> msg 1))
+             (while (and (null found) (> msg 1))
                  (setq msg (1- msg)
-                       win (pmail-search-message msg regexp)))
-             (while (and (null win) (< msg pmail-total-messages))
+                     found (pmail-search-message msg regexp)))
+           (while (and (null found) (< msg pmail-total-messages))
                (setq msg (1+ msg)
-                     win (pmail-search-message msg regexp))))
-           (setq n (+ n (if reversep 1 -1)))))
-      (if win
+                   found (pmail-search-message msg regexp))))
+         (setq n (+ n (if reversep 1 -1))))
+      (if found
          (progn
            (pmail-show-message-maybe msg)
            ;; Search forward (if this is a normal search) or backward
@@ -2834,8 +2833,8 @@
            (message "%sPmail search for %s...done"
                     (if reversep "Reverse " "")
                     regexp))
-       (goto-char opoint)
-       (narrow-to-region omin omax)
+       (pmail-show-message-maybe orig-message)
+       (if opoint (goto-char opoint))
        (ding)
        (message "Search failed: %s" regexp)))))
 




reply via email to

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