# HG changeset patch # User Glenn Morris # Date 1233200472 0 # Node ID 064248de0e1bd796fd3fe26948b247d699a8d960 # Parent caac907da88d06784ea7a034d63d01814245c2cf (rmail-summary-update-line): New function. (rmail-summary-goto-msg): Return a value according to whether message was found. (rmail-summary-update-highlight): Give the overlay an 'rmail-summary property. Use line-end-position. diff -r caac907da88d -r 064248de0e1b lisp/mail/rmailsum.el --- a/lisp/mail/rmailsum.el Thu Jan 29 03:02:39 2009 +0000 +++ b/lisp/mail/rmailsum.el Thu Jan 29 03:41:12 2009 +0000 @@ -743,6 +743,26 @@ (aset rmail-summary-vector (1- n) (rmail-create-summary-line n))))) (beginning-of-line)) +(defun rmail-summary-update-line (n) + "Update the summary line for message N." + (when (rmail-summary-goto-msg n t t) + (let* ((buffer-read-only nil) + (start (line-beginning-position)) + (end (line-beginning-position 2)) + (overlays (overlays-in start end)) + high ov) + (while (and (setq ov (car overlays)) + (not (setq high (overlay-get ov 'rmail-summary)))) + (setq overlays (cdr overlays))) + (delete-region (line-beginning-position) (line-beginning-position 2)) + (princ + (with-current-buffer rmail-buffer + (aset rmail-summary-vector (1- n) (rmail-create-summary-line n))) + (current-buffer)) + (when high + (forward-line -1) + (rmail-summary-update-highlight nil))))) + (defun rmail-summary-mark-undeleted (n) (rmail-summary-mark-deleted n t)) @@ -1141,7 +1161,8 @@ and move to that message in the Rmail buffer. If NOWARN, don't say anything if N is out of range. -If SKIP-RMAIL, don't do anything to the Rmail buffer." +If SKIP-RMAIL, don't do anything to the Rmail buffer. +Returns non-nil if message N was found." (interactive "P") (if (consp n) (setq n (prefix-numeric-value n))) (if (eobp) (forward-line -1)) @@ -1191,7 +1212,8 @@ (rmail-show-message-maybe n)) (select-window selwin) ;; The actions above can alter the current buffer. Preserve it. - (set-buffer obuf)))))) + (set-buffer obuf)))) + (not message-not-found))) ;; Update the highlighted line in an rmail summary buffer. ;; That should be current. We highlight the line point is on. @@ -1201,7 +1223,8 @@ (or rmail-summary-overlay (progn (make-local-variable 'rmail-summary-overlay) - (setq rmail-summary-overlay (make-overlay (point) (point))))) + (setq rmail-summary-overlay (make-overlay (point) (point))) + (overlay-put rmail-summary-overlay 'rmail-summary t))) ;; If this message is in the summary, use the overlay to highlight it. ;; Otherwise, don't highlight anything. (if not-found @@ -1210,7 +1233,7 @@ (save-excursion (beginning-of-line) (skip-chars-forward " ") (point)) - (save-excursion (end-of-line) (point))) + (line-end-position)) (overlay-put rmail-summary-overlay 'face 'highlight))) (defun rmail-summary-scroll-msg-up (&optional dist)