aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/mail/rmailsum.el21
1 files changed, 21 insertions, 0 deletions
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el
index 0633bbd82ac..4c502b27870 100644
--- a/lisp/mail/rmailsum.el
+++ b/lisp/mail/rmailsum.el
@@ -722,6 +722,8 @@ Commands for sorting the summary:
722(define-key rmail-summary-mode-map [menu-bar move next] 722(define-key rmail-summary-mode-map [menu-bar move next]
723 '("Next" . rmail-summary-next-all)) 723 '("Next" . rmail-summary-next-all))
724 724
725(defvar rmail-summary-overlay nil)
726
725(defun rmail-summary-goto-msg (&optional n nowarn skip-rmail) 727(defun rmail-summary-goto-msg (&optional n nowarn skip-rmail)
726 (interactive "P") 728 (interactive "P")
727 (if (consp n) (setq n (prefix-numeric-value n))) 729 (if (consp n) (setq n (prefix-numeric-value n)))
@@ -729,9 +731,14 @@ Commands for sorting the summary:
729 (beginning-of-line) 731 (beginning-of-line)
730 (let ((buf rmail-buffer) 732 (let ((buf rmail-buffer)
731 (cur (point)) 733 (cur (point))
734 message-not-found
732 (curmsg (string-to-int 735 (curmsg (string-to-int
733 (buffer-substring (point) 736 (buffer-substring (point)
734 (min (point-max) (+ 5 (point))))))) 737 (min (point-max) (+ 5 (point)))))))
738 ;; If message number N was specified, find that message's line
739 ;; or set message-not-found.
740 ;; If N wasn't specified or that message can't be found.
741 ;; set N by default.
735 (if (not n) 742 (if (not n)
736 (setq n curmsg) 743 (setq n curmsg)
737 (if (< n 1) 744 (if (< n 1)
@@ -745,6 +752,7 @@ Commands for sorting the summary:
745 (if (not (re-search-forward (concat "^ *" (int-to-string n)) nil t)) 752 (if (not (re-search-forward (concat "^ *" (int-to-string n)) nil t))
746 (progn (or nowarn (message "Message %d not found" n)) 753 (progn (or nowarn (message "Message %d not found" n))
747 (setq n curmsg) 754 (setq n curmsg)
755 (setq message-not-found t)
748 (goto-char cur)))) 756 (goto-char cur))))
749 (beginning-of-line) 757 (beginning-of-line)
750 (skip-chars-forward " ") 758 (skip-chars-forward " ")
@@ -753,6 +761,19 @@ Commands for sorting the summary:
753 (let ((buffer-read-only nil)) 761 (let ((buffer-read-only nil))
754 (delete-char 1) 762 (delete-char 1)
755 (insert " ")))) 763 (insert " "))))
764 ;; Make sure we have an overlay to use.
765 (or rmail-summary-overlay
766 (progn
767 (make-local-variable 'rmail-summary-overlay)
768 (setq rmail-summary-overlay (make-overlay (point) (point)))))
769 ;; If this message is in the summary, use the overlay to highlight it.
770 ;; Otherwise, don't highlight anything.
771 (if message-not-found
772 (overlay-put rmail-summary-overlay 'face nil)
773 (move-overlay rmail-summary-overlay
774 (save-excursion (beginning-of-line) (1+ (point)))
775 (point))
776 (overlay-put rmail-summary-overlay 'face 'highlight))
756 (beginning-of-line) 777 (beginning-of-line)
757 (if skip-rmail 778 (if skip-rmail
758 nil 779 nil