aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1995-01-20 02:50:27 +0000
committerRichard M. Stallman1995-01-20 02:50:27 +0000
commit4fb6f90f18418df8c1ae8be77df123ca4fad7db2 (patch)
treee2d3d8a0e7fe2dca1b0bb08976c1a4f0bf03724c
parent2084fddb6da6a8c641dfa9907edbbaf9aac0dbfb (diff)
downloademacs-4fb6f90f18418df8c1ae8be77df123ca4fad7db2.tar.gz
emacs-4fb6f90f18418df8c1ae8be77df123ca4fad7db2.zip
(rmail-summary-update-highlight): New function.
(rmail-summary-goto-msg): Use it. (rmail-summary-rmail-update): Move the summary highlight. (rmail-summary-mark-deleted): Do nothing if rmail-summary-overlay has a nil face-property. (rmail-new-summary): Make the summary-on-top kludge more restricted in when it is used.
-rw-r--r--lisp/mail/rmailsum.el43
1 files changed, 26 insertions, 17 deletions
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el
index 784d08c34b2..70ab33e7216 100644
--- a/lisp/mail/rmailsum.el
+++ b/lisp/mail/rmailsum.el
@@ -206,7 +206,8 @@ nil for FUNCTION means all messages."
206 (setq rmail-summary-buffer sumbuf)) 206 (setq rmail-summary-buffer sumbuf))
207 ;; Now display the summary buffer and go to the right place in it. 207 ;; Now display the summary buffer and go to the right place in it.
208 (or was-in-summary 208 (or was-in-summary
209 (if (one-window-p) 209 (if (and (one-window-p)
210 pop-up-windows (not pop-up-frames))
210 ;; If there is just one window, put the summary on the top. 211 ;; If there is just one window, put the summary on the top.
211 (progn 212 (progn
212 (split-window) 213 (split-window)
@@ -460,6 +461,7 @@ Deleted messages stay in the file until the \\[rmail-expunge] command is given."
460(defun rmail-summary-mark-deleted (&optional n undel) 461(defun rmail-summary-mark-deleted (&optional n undel)
461 (and n (rmail-summary-goto-msg n t t)) 462 (and n (rmail-summary-goto-msg n t t))
462 (or (eobp) 463 (or (eobp)
464 (not (overlay-get rmail-summary-overlay 'face))
463 (let ((buffer-read-only nil)) 465 (let ((buffer-read-only nil))
464 (skip-chars-forward " ") 466 (skip-chars-forward " ")
465 (skip-chars-forward "[0-9]") 467 (skip-chars-forward "[0-9]")
@@ -614,7 +616,8 @@ Commands for sorting the summary:
614 (if (buffer-name rmail-buffer) 616 (if (buffer-name rmail-buffer)
615 (save-excursion 617 (save-excursion
616 (set-buffer rmail-buffer) 618 (set-buffer rmail-buffer)
617 (rmail-show-message msg-num t)))))))))) 619 (rmail-show-message msg-num t))))))
620 (rmail-summary-update-highlight nil)))))
618 621
619(defvar rmail-summary-mode-map nil) 622(defvar rmail-summary-mode-map nil)
620 623
@@ -839,21 +842,7 @@ Commands for sorting the summary:
839 (let ((buffer-read-only nil)) 842 (let ((buffer-read-only nil))
840 (delete-char 1) 843 (delete-char 1)
841 (insert " ")))) 844 (insert " "))))
842 ;; Make sure we have an overlay to use. 845 (rmail-summary-update-highlight message-not-found)
843 (or rmail-summary-overlay
844 (progn
845 (make-local-variable 'rmail-summary-overlay)
846 (setq rmail-summary-overlay (make-overlay (point) (point)))))
847 ;; If this message is in the summary, use the overlay to highlight it.
848 ;; Otherwise, don't highlight anything.
849 (if message-not-found
850 (overlay-put rmail-summary-overlay 'face nil)
851 (move-overlay rmail-summary-overlay
852 (save-excursion (beginning-of-line)
853 (skip-chars-forward " ")
854 (point))
855 (save-excursion (end-of-line) (point)))
856 (overlay-put rmail-summary-overlay 'face 'highlight))
857 (beginning-of-line) 846 (beginning-of-line)
858 (if skip-rmail 847 (if skip-rmail
859 nil 848 nil
@@ -864,6 +853,26 @@ Commands for sorting the summary:
864 (select-window selwin) 853 (select-window selwin)
865 ;; The actions above can alter the current buffer. Preserve it. 854 ;; The actions above can alter the current buffer. Preserve it.
866 (set-buffer obuf)))))) 855 (set-buffer obuf))))))
856
857;; Update the highlighted line in an rmail summary buffer.
858;; That should be current. We highlight the line point is on.
859;; If NOT-FOUND is non-nil, we turn off highlighting.
860(defun rmail-summary-update-highlight (not-found)
861 ;; Make sure we have an overlay to use.
862 (or rmail-summary-overlay
863 (progn
864 (make-local-variable 'rmail-summary-overlay)
865 (setq rmail-summary-overlay (make-overlay (point) (point)))))
866 ;; If this message is in the summary, use the overlay to highlight it.
867 ;; Otherwise, don't highlight anything.
868 (if not-found
869 (overlay-put rmail-summary-overlay 'face nil)
870 (move-overlay rmail-summary-overlay
871 (save-excursion (beginning-of-line)
872 (skip-chars-forward " ")
873 (point))
874 (save-excursion (end-of-line) (point)))
875 (overlay-put rmail-summary-overlay 'face 'highlight)))
867 876
868(defun rmail-summary-scroll-msg-up (&optional dist) 877(defun rmail-summary-scroll-msg-up (&optional dist)
869 "Scroll the Rmail window forward. 878 "Scroll the Rmail window forward.