emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp ChangeLog mail/rmailsum.el


From: Glenn Morris
Subject: [Emacs-diffs] emacs/lisp ChangeLog mail/rmailsum.el
Date: Thu, 26 Feb 2009 08:45:12 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       09/02/26 08:45:11

Modified files:
        lisp           : ChangeLog 
        lisp/mail      : rmailsum.el 

Log message:
        (rmail-summary-mark-seen): Add option to mark as unseen.
        (rmail-summary-rmail-update): Store a position in
        rmail-summary-put-back-unseen rather than just a flag, and use it to put
        back the "-" mark in the summary.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.15403&r2=1.15404
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/mail/rmailsum.el?cvsroot=emacs&r1=1.172&r2=1.173

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.15403
retrieving revision 1.15404
diff -u -b -r1.15403 -r1.15404
--- ChangeLog   26 Feb 2009 08:29:13 -0000      1.15403
+++ ChangeLog   26 Feb 2009 08:45:09 -0000      1.15404
@@ -2,6 +2,10 @@
 
        * mail/rmailsum.el (rmail-summary-rmail-update):
        Use rmail-message-unseen-p.  (Bug#2477)
+       (rmail-summary-mark-seen): Add option to mark as unseen.
+       (rmail-summary-rmail-update): Store a position in
+       rmail-summary-put-back-unseen rather than just a flag, and use it to put
+       back the "-" mark in the summary.
 
        * progmodes/cc-vars.el (c-style-variables-are-local-p):
        Mark as safe if boolean.  (Bug#2197)

Index: mail/rmailsum.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/mail/rmailsum.el,v
retrieving revision 1.172
retrieving revision 1.173
diff -u -b -r1.172 -r1.173
--- mail/rmailsum.el    26 Feb 2009 08:23:08 -0000      1.172
+++ mail/rmailsum.el    26 Feb 2009 08:45:11 -0000      1.173
@@ -886,19 +886,20 @@
   (add-hook 'post-command-hook 'rmail-summary-rmail-update nil t)
   (setq revert-buffer-function 'rmail-update-summary))
 
-(defun rmail-summary-mark-seen (n &optional nomove)
+(defun rmail-summary-mark-seen (n &optional nomove unseen)
   "Remove the unseen mark from the current message, update the summary vector.
 N is the number of the current message.  Optional argument NOMOVE
-non-nil means we are already at the right column."
+non-nil means we are already at the right column.  Optional argument
+UNSEEN non-nil means mark the message as unseen."
   (save-excursion
     (unless nomove
       (beginning-of-line)
       (skip-chars-forward " ")
       (skip-chars-forward "0-9"))
-    (when (char-equal (following-char) ?-)
+    (when (char-equal (following-char) (if unseen ?\s ?-))
       (let ((buffer-read-only nil))
        (delete-char 1)
-       (insert " "))
+       (insert (if unseen "-" " ")))
       (let ((line (buffer-substring-no-properties (line-beginning-position)
                                                  (line-beginning-position 2))))
       (with-current-buffer rmail-buffer
@@ -936,18 +937,21 @@
            (let ((window (get-buffer-window rmail-buffer t))
                  (owin (selected-window)))
              (if isearch-mode
-                 (save-excursion
-                   (set-buffer rmail-buffer)
+                 (progn
                    ;; If we first saw the previous message in this search,
                    ;; and we have gone to a different message while searching,
                    ;; put back `unseen' on the former one.
-                   (if rmail-summary-put-back-unseen
+                   (when rmail-summary-put-back-unseen
                        (rmail-set-attribute rmail-unseen-attr-index t
-                                            rmail-current-message))
+                                          rmail-current-message)
+                     (save-excursion
+                       (goto-char rmail-summary-put-back-unseen)
+                       (rmail-summary-mark-seen rmail-current-message t t)))
                    ;; Arrange to do that later, for the new current message,
                    ;; if it still has `unseen'.
                    (setq rmail-summary-put-back-unseen
-                         (rmail-message-unseen-p msg-num)))
+                         (if (rmail-message-unseen-p msg-num)
+                             (point))))
                (setq rmail-summary-put-back-unseen nil))
              ;; Go to the desired message.
              (setq rmail-current-message msg-num)




reply via email to

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