changeset 10489:5906e2f35eb9

(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.
author Richard M. Stallman <rms@gnu.org>
date Fri, 20 Jan 1995 02:50:27 +0000
parents 701e7acfe885
children 14c7b7749f45
files lisp/mail/rmailsum.el
diffstat 1 files changed, 26 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/rmailsum.el	Fri Jan 20 01:47:45 1995 +0000
+++ b/lisp/mail/rmailsum.el	Fri Jan 20 02:50:27 1995 +0000
@@ -206,7 +206,8 @@
       (setq rmail-summary-buffer sumbuf))
     ;; Now display the summary buffer and go to the right place in it.
     (or was-in-summary
-	(if (one-window-p)
+	(if (and (one-window-p)
+		 pop-up-windows (not pop-up-frames))
 	    ;; If there is just one window, put the summary on the top.
 	    (progn
 	      (split-window)
@@ -460,6 +461,7 @@
 (defun rmail-summary-mark-deleted (&optional n undel)
   (and n (rmail-summary-goto-msg n t t))
   (or (eobp)
+      (not (overlay-get rmail-summary-overlay 'face))
       (let ((buffer-read-only nil))
 	(skip-chars-forward " ")
 	(skip-chars-forward "[0-9]")
@@ -614,7 +616,8 @@
 		(if (buffer-name rmail-buffer)
 		    (save-excursion
 		      (set-buffer rmail-buffer)
-		      (rmail-show-message msg-num t))))))))))
+		      (rmail-show-message msg-num t))))))
+	(rmail-summary-update-highlight nil)))))
 
 (defvar rmail-summary-mode-map nil)
 
@@ -839,21 +842,7 @@
 			(let ((buffer-read-only nil))
 			  (delete-char 1)
 			  (insert " "))))
-    ;; Make sure we have an overlay to use.
-    (or rmail-summary-overlay
-	(progn
-	  (make-local-variable 'rmail-summary-overlay)
-	  (setq rmail-summary-overlay (make-overlay (point) (point)))))
-    ;; If this message is in the summary, use the overlay to highlight it.
-    ;; Otherwise, don't highlight anything.
-    (if message-not-found
-	(overlay-put rmail-summary-overlay 'face nil)
-      (move-overlay rmail-summary-overlay
-		    (save-excursion (beginning-of-line)
-				    (skip-chars-forward " ")
-				    (point))
-		    (save-excursion (end-of-line) (point)))
-      (overlay-put rmail-summary-overlay 'face 'highlight))
+    (rmail-summary-update-highlight message-not-found)
     (beginning-of-line)
     (if skip-rmail
 	nil
@@ -864,6 +853,26 @@
 	  (select-window selwin)
 	  ;; The actions above can alter the current buffer.  Preserve it.
 	  (set-buffer obuf))))))
+
+;; Update the highlighted line in an rmail summary buffer.
+;; That should be current.  We highlight the line point is on.
+;; If NOT-FOUND is non-nil, we turn off highlighting.
+(defun rmail-summary-update-highlight (not-found)
+  ;; Make sure we have an overlay to use.
+  (or rmail-summary-overlay
+      (progn
+	(make-local-variable 'rmail-summary-overlay)
+	(setq rmail-summary-overlay (make-overlay (point) (point)))))
+  ;; If this message is in the summary, use the overlay to highlight it.
+  ;; Otherwise, don't highlight anything.
+  (if not-found
+      (overlay-put rmail-summary-overlay 'face nil)
+    (move-overlay rmail-summary-overlay
+		  (save-excursion (beginning-of-line)
+				  (skip-chars-forward " ")
+				  (point))
+		  (save-excursion (end-of-line) (point)))
+    (overlay-put rmail-summary-overlay 'face 'highlight)))
 
 (defun rmail-summary-scroll-msg-up (&optional dist)
   "Scroll the Rmail window forward.