Commit 36aecf22 authored by Glenn Morris's avatar Glenn Morris
Browse files

(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.
parent 602d718e
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
   
* mail/rmailsum.el (rmail-summary-rmail-update): * mail/rmailsum.el (rmail-summary-rmail-update):
Use rmail-message-unseen-p. (Bug#2477) 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): * progmodes/cc-vars.el (c-style-variables-are-local-p):
Mark as safe if boolean. (Bug#2197) Mark as safe if boolean. (Bug#2197)
......
...@@ -886,19 +886,20 @@ Commands for sorting the summary: ...@@ -886,19 +886,20 @@ Commands for sorting the summary:
(add-hook 'post-command-hook 'rmail-summary-rmail-update nil t) (add-hook 'post-command-hook 'rmail-summary-rmail-update nil t)
(setq revert-buffer-function 'rmail-update-summary)) (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. "Remove the unseen mark from the current message, update the summary vector.
N is the number of the current message. Optional argument NOMOVE 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 (save-excursion
(unless nomove (unless nomove
(beginning-of-line) (beginning-of-line)
(skip-chars-forward " ") (skip-chars-forward " ")
(skip-chars-forward "0-9")) (skip-chars-forward "0-9"))
(when (char-equal (following-char) ?-) (when (char-equal (following-char) (if unseen ?\s ?-))
(let ((buffer-read-only nil)) (let ((buffer-read-only nil))
(delete-char 1) (delete-char 1)
(insert " ")) (insert (if unseen "-" " ")))
(let ((line (buffer-substring-no-properties (line-beginning-position) (let ((line (buffer-substring-no-properties (line-beginning-position)
(line-beginning-position 2)))) (line-beginning-position 2))))
(with-current-buffer rmail-buffer (with-current-buffer rmail-buffer
...@@ -936,18 +937,21 @@ Search, the `unseen' attribute is restored.") ...@@ -936,18 +937,21 @@ Search, the `unseen' attribute is restored.")
(let ((window (get-buffer-window rmail-buffer t)) (let ((window (get-buffer-window rmail-buffer t))
(owin (selected-window))) (owin (selected-window)))
(if isearch-mode (if isearch-mode
(save-excursion (progn
(set-buffer rmail-buffer)
;; If we first saw the previous message in this search, ;; If we first saw the previous message in this search,
;; and we have gone to a different message while searching, ;; and we have gone to a different message while searching,
;; put back `unseen' on the former one. ;; 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-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, ;; Arrange to do that later, for the new current message,
;; if it still has `unseen'. ;; if it still has `unseen'.
(setq rmail-summary-put-back-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)) (setq rmail-summary-put-back-unseen nil))
;; Go to the desired message. ;; Go to the desired message.
(setq rmail-current-message msg-num) (setq rmail-current-message msg-num)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment