]> git.eshelyaron.com Git - emacs.git/commitdiff
(rmail-summary-update-highlight): New function.
authorRichard M. Stallman <rms@gnu.org>
Fri, 20 Jan 1995 02:50:27 +0000 (02:50 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 20 Jan 1995 02:50:27 +0000 (02:50 +0000)
(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.

lisp/mail/rmailsum.el

index 784d08c34b2b1ff02f6b8aac6e1ac25ba216f26c..70ab33e7216ab6aeb2eb27947df93255919d5e56 100644 (file)
@@ -206,7 +206,8 @@ nil for FUNCTION means all messages."
       (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 @@ Deleted messages stay in the file until the \\[rmail-expunge] command is given."
 (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 @@ Commands for sorting the summary:
                (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)))))
 \f
 (defvar rmail-summary-mode-map nil)
 
@@ -839,21 +842,7 @@ Commands for sorting the summary:
                        (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 @@ Commands for sorting the summary:
          (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)))
 \f
 (defun rmail-summary-scroll-msg-up (&optional dist)
   "Scroll the Rmail window forward.