aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2009-02-13 03:49:58 +0000
committerGlenn Morris2009-02-13 03:49:58 +0000
commit97e92ffbd42de8321677900fbc7dc44b51a4290e (patch)
treec8533206e26175431a370a24563f424cc267864f
parenta99e0e1be2c5e33011683b5577d085f8282dcc0a (diff)
downloademacs-97e92ffbd42de8321677900fbc7dc44b51a4290e.tar.gz
emacs-97e92ffbd42de8321677900fbc7dc44b51a4290e.zip
(msgnum): Remove declaration.
(rmail-summary-redo): Add missing initialization value. (rmail-summary-overlay, rmail-summary-mode-map): Add doc string. (rmail-summary-mark-deleted, rmail-summary-deleted-p): Fix skip-chars-forward calls. (rmail-summary-mark-seen): New function. As well as removing the '-' mark, update the summary-vector. (Bug#2135) (rmail-summary-rmail-update, rmail-summary-goto-msg): Use rmail-summary-mark-seen.
-rw-r--r--lisp/mail/rmailsum.el53
1 files changed, 29 insertions, 24 deletions
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el
index 08f1fc4d89d..ce7a74a992d 100644
--- a/lisp/mail/rmailsum.el
+++ b/lisp/mail/rmailsum.el
@@ -29,9 +29,7 @@
29 29
30;;; Code: 30;;; Code:
31 31
32(defvar msgnum) 32;; For rmail-select-summary.
33
34;; For rmail-select-summary
35(require 'rmail) 33(require 'rmail)
36 34
37(defcustom rmail-summary-scroll-between-messages t 35(defcustom rmail-summary-scroll-between-messages t
@@ -52,13 +50,15 @@
52 ("{ \\([^\n}]+\\) }" 1 font-lock-comment-face)) ; Labels. 50 ("{ \\([^\n}]+\\) }" 1 font-lock-comment-face)) ; Labels.
53 "Additional expressions to highlight in Rmail Summary mode.") 51 "Additional expressions to highlight in Rmail Summary mode.")
54 52
55(defvar rmail-summary-redo 53(defvar rmail-summary-redo nil
56 "(FUNCTION . ARGS) to regenerate this Rmail summary buffer.") 54 "(FUNCTION . ARGS) to regenerate this Rmail summary buffer.")
57 55
58(defvar rmail-summary-overlay nil) 56(defvar rmail-summary-overlay nil
57 "Overlay used to highlight the current message in the Rmail summary.")
59(put 'rmail-summary-overlay 'permanent-local t) 58(put 'rmail-summary-overlay 'permanent-local t)
60 59
61(defvar rmail-summary-mode-map nil) 60(defvar rmail-summary-mode-map nil
61 "Keymap used in Rmail summary mode.")
62 62
63;; Entry points for making a summary buffer. 63;; Entry points for making a summary buffer.
64 64
@@ -741,7 +741,7 @@ a negative argument means to delete and move forward."
741 (not (overlay-get rmail-summary-overlay 'face)) 741 (not (overlay-get rmail-summary-overlay 'face))
742 (let ((buffer-read-only nil)) 742 (let ((buffer-read-only nil))
743 (skip-chars-forward " ") 743 (skip-chars-forward " ")
744 (skip-chars-forward "[0-9]") 744 (skip-chars-forward "0-9")
745 (if undel 745 (if undel
746 (if (looking-at "D") 746 (if (looking-at "D")
747 (progn (delete-char 1) (insert " "))) 747 (progn (delete-char 1) (insert " ")))
@@ -779,7 +779,7 @@ a negative argument means to delete and move forward."
779 (save-excursion 779 (save-excursion
780 (and n (rmail-summary-goto-msg n nil t)) 780 (and n (rmail-summary-goto-msg n nil t))
781 (skip-chars-forward " ") 781 (skip-chars-forward " ")
782 (skip-chars-forward "[0-9]") 782 (skip-chars-forward "0-9")
783 (looking-at "D"))) 783 (looking-at "D")))
784 784
785(defun rmail-summary-undelete (&optional arg) 785(defun rmail-summary-undelete (&optional arg)
@@ -885,6 +885,24 @@ Commands for sorting the summary:
885 (add-hook 'post-command-hook 'rmail-summary-rmail-update nil t) 885 (add-hook 'post-command-hook 'rmail-summary-rmail-update nil t)
886 (setq revert-buffer-function 'rmail-update-summary)) 886 (setq revert-buffer-function 'rmail-update-summary))
887 887
888(defun rmail-summary-mark-seen (n &optional nomove)
889 "Remove the unseen mark from the current message, update the summary vector.
890N is the number of the current message. Optional argument NOMOVE
891non-nil means we are already at the right column."
892 (save-excursion
893 (unless nomove
894 (beginning-of-line)
895 (skip-chars-forward " ")
896 (skip-chars-forward "0-9"))
897 (when (char-equal (following-char) ?-)
898 (let ((buffer-read-only nil))
899 (delete-char 1)
900 (insert " "))
901 (let ((line (buffer-substring-no-properties (line-beginning-position)
902 (line-beginning-position 2))))
903 (with-current-buffer rmail-buffer
904 (aset rmail-summary-vector (1- n) line))))))
905
888(defvar rmail-summary-put-back-unseen nil 906(defvar rmail-summary-put-back-unseen nil
889 "Used for communicating between calls to `rmail-summary-rmail-update'. 907 "Used for communicating between calls to `rmail-summary-rmail-update'.
890If it moves to a message within an Incremental Search, and removes 908If it moves to a message within an Incremental Search, and removes
@@ -930,16 +948,10 @@ Search, the `unseen' attribute is restored.")
930 (setq rmail-summary-put-back-unseen 948 (setq rmail-summary-put-back-unseen
931 (rmail-message-attr-p msg-num rmail-unseen-attr-index))) 949 (rmail-message-attr-p msg-num rmail-unseen-attr-index)))
932 (setq rmail-summary-put-back-unseen nil)) 950 (setq rmail-summary-put-back-unseen nil))
933
934 ;; Go to the desired message. 951 ;; Go to the desired message.
935 (setq rmail-current-message msg-num) 952 (setq rmail-current-message msg-num)
936
937 ;; Update the summary to show the message has been seen. 953 ;; Update the summary to show the message has been seen.
938 (if (= (following-char) ?-) 954 (rmail-summary-mark-seen msg-num t)
939 (progn
940 (delete-char 1)
941 (insert " ")))
942
943 (if window 955 (if window
944 ;; Using save-window-excursion would cause the new value 956 ;; Using save-window-excursion would cause the new value
945 ;; of point to get lost. 957 ;; of point to get lost.
@@ -1204,17 +1216,10 @@ Returns non-nil if message N was found."
1204 (setq n curmsg) 1216 (setq n curmsg)
1205 (setq message-not-found t) 1217 (setq message-not-found t)
1206 (goto-char cur)))) 1218 (goto-char cur))))
1207 (beginning-of-line) 1219 (rmail-summary-mark-seen n)
1208 (skip-chars-forward " ")
1209 (skip-chars-forward "0-9")
1210 (save-excursion (if (= (following-char) ?-)
1211 (let ((buffer-read-only nil))
1212 (delete-char 1)
1213 (insert " "))))
1214 (rmail-summary-update-highlight message-not-found) 1220 (rmail-summary-update-highlight message-not-found)
1215 (beginning-of-line) 1221 (beginning-of-line)
1216 (if skip-rmail 1222 (unless skip-rmail
1217 nil
1218 (let ((selwin (selected-window))) 1223 (let ((selwin (selected-window)))
1219 (unwind-protect 1224 (unwind-protect
1220 (progn (pop-to-buffer buf) 1225 (progn (pop-to-buffer buf)