aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1996-09-19 03:22:51 +0000
committerRichard M. Stallman1996-09-19 03:22:51 +0000
commit5be36e2004f8557fe0690ebd7746fbbcc3115c07 (patch)
tree102a83a542e8099386df77ad1665528c1a8c61fc
parent563ab60dbde5429aa7bc2c96f7bfcbea6c581b39 (diff)
downloademacs-5be36e2004f8557fe0690ebd7746fbbcc3115c07.tar.gz
emacs-5be36e2004f8557fe0690ebd7746fbbcc3115c07.zip
(rmail-summary-next-same-subject): Don't set
search-regexp until after adjusting subject string. (rmail-summary-rmail-update): Bind rmail-not-really-seen non-nil if in isearch mode.
-rw-r--r--lisp/mail/rmailsum.el37
1 files changed, 34 insertions, 3 deletions
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el
index b8637ce20ab..4342a94dc26 100644
--- a/lisp/mail/rmailsum.el
+++ b/lisp/mail/rmailsum.el
@@ -497,12 +497,12 @@ If N is negative, go backwards."
497 (save-excursion 497 (save-excursion
498 (set-buffer rmail-buffer) 498 (set-buffer rmail-buffer)
499 (setq subject (mail-fetch-field "Subject")) 499 (setq subject (mail-fetch-field "Subject"))
500 (setq search-regexp (concat "^Subject: *\\(Re: *\\)?"
501 (regexp-quote subject)
502 "\n"))
503 (setq i rmail-current-message)) 500 (setq i rmail-current-message))
504 (if (string-match "Re:[ \t]*" subject) 501 (if (string-match "Re:[ \t]*" subject)
505 (setq subject (substring subject (match-end 0)))) 502 (setq subject (substring subject (match-end 0))))
503 (setq search-regexp (concat "^Subject: *\\(Re: *\\)?"
504 (regexp-quote subject)
505 "\n"))
506 (save-excursion 506 (save-excursion
507 (while (and (/= n 0) 507 (while (and (/= n 0)
508 (if forward 508 (if forward
@@ -698,6 +698,13 @@ Commands for sorting the summary:
698 (add-hook 'post-command-hook 'rmail-summary-rmail-update nil t) 698 (add-hook 'post-command-hook 'rmail-summary-rmail-update nil t)
699 (setq revert-buffer-function 'rmail-update-summary)) 699 (setq revert-buffer-function 'rmail-update-summary))
700 700
701(defvar rmail-summary-put-back-unseen nil
702 "Used for communicating between calls to `rmail-summary-rmail-update'.
703If it moves to a message within an Incremental Search, and removes
704the `unseen' attribute from that message, it sets this flag
705so that if the next motion between messages is in the same Incremental
706Search, the `unseen' attribute is restored.")
707
701;; Show in Rmail the message described by the summary line that point is on, 708;; Show in Rmail the message described by the summary line that point is on,
702;; but only if the Rmail buffer is already visible. 709;; but only if the Rmail buffer is already visible.
703;; This is a post-command-hook in summary buffers. 710;; This is a post-command-hook in summary buffers.
@@ -713,14 +720,38 @@ Commands for sorting the summary:
713 (point) 720 (point)
714 (progn (skip-chars-forward "0-9") 721 (progn (skip-chars-forward "0-9")
715 (point)))))) 722 (point))))))
723 ;; Always leave `unseen' removed
724 ;; if we get out of isearch mode.
725 ;; Don't let a subsequent isearch restore that `unseen'.
726 (if (not isearch-mode)
727 (setq rmail-summary-put-back-unseen nil))
728
716 (or (eq rmail-current-message msg-num) 729 (or (eq rmail-current-message msg-num)
717 (let ((window (get-buffer-window rmail-buffer)) 730 (let ((window (get-buffer-window rmail-buffer))
718 (owin (selected-window))) 731 (owin (selected-window)))
732 (if isearch-mode
733 (save-excursion
734 (set-buffer rmail-buffer)
735 ;; If we first saw the previous message in this search,
736 ;; and we have gone to a different message while searching,
737 ;; put back `unseen' on the former one.
738 (rmail-set-attribute "unseen" t
739 rmail-current-message)
740 ;; Arrange to do that later, for the new current message,
741 ;; if it still has `unseen'.
742 (setq rmail-summary-put-back-unseen
743 (rmail-message-labels-p msg-num ", ?\\(unseen\\),")))
744 (setq rmail-summary-put-back-unseen nil))
745
746 ;; Go to the desired message.
719 (setq rmail-current-message msg-num) 747 (setq rmail-current-message msg-num)
748
749 ;; Update the summary to show the message has been seen.
720 (if (= (following-char) ?-) 750 (if (= (following-char) ?-)
721 (progn 751 (progn
722 (delete-char 1) 752 (delete-char 1)
723 (insert " "))) 753 (insert " ")))
754
724 (if window 755 (if window
725 ;; Using save-window-excursion would cause the new value 756 ;; Using save-window-excursion would cause the new value
726 ;; of point to get lost. 757 ;; of point to get lost.