aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2009-01-29 03:41:12 +0000
committerGlenn Morris2009-01-29 03:41:12 +0000
commit8fbbdd44047b2f40ffc10dbf25aec5664112ee80 (patch)
tree27f2843bd72f0daf42f3bae7486114b07813df80
parentb3a51d1d2050881e0f92947db95c461a68fc43d4 (diff)
downloademacs-8fbbdd44047b2f40ffc10dbf25aec5664112ee80.tar.gz
emacs-8fbbdd44047b2f40ffc10dbf25aec5664112ee80.zip
(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.
-rw-r--r--lisp/mail/rmailsum.el31
1 files changed, 27 insertions, 4 deletions
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el
index 6a405dd1582..d7b1aa2c28e 100644
--- a/lisp/mail/rmailsum.el
+++ b/lisp/mail/rmailsum.el
@@ -743,6 +743,26 @@ a negative argument means to delete and move forward."
743 (aset rmail-summary-vector (1- n) (rmail-create-summary-line n))))) 743 (aset rmail-summary-vector (1- n) (rmail-create-summary-line n)))))
744 (beginning-of-line)) 744 (beginning-of-line))
745 745
746(defun rmail-summary-update-line (n)
747 "Update the summary line for message N."
748 (when (rmail-summary-goto-msg n t t)
749 (let* ((buffer-read-only nil)
750 (start (line-beginning-position))
751 (end (line-beginning-position 2))
752 (overlays (overlays-in start end))
753 high ov)
754 (while (and (setq ov (car overlays))
755 (not (setq high (overlay-get ov 'rmail-summary))))
756 (setq overlays (cdr overlays)))
757 (delete-region (line-beginning-position) (line-beginning-position 2))
758 (princ
759 (with-current-buffer rmail-buffer
760 (aset rmail-summary-vector (1- n) (rmail-create-summary-line n)))
761 (current-buffer))
762 (when high
763 (forward-line -1)
764 (rmail-summary-update-highlight nil)))))
765
746(defun rmail-summary-mark-undeleted (n) 766(defun rmail-summary-mark-undeleted (n)
747 (rmail-summary-mark-deleted n t)) 767 (rmail-summary-mark-deleted n t))
748 768
@@ -1141,7 +1161,8 @@ If N is nil, use the message corresponding to point in the summary
1141and move to that message in the Rmail buffer. 1161and move to that message in the Rmail buffer.
1142 1162
1143If NOWARN, don't say anything if N is out of range. 1163If NOWARN, don't say anything if N is out of range.
1144If SKIP-RMAIL, don't do anything to the Rmail buffer." 1164If SKIP-RMAIL, don't do anything to the Rmail buffer.
1165Returns non-nil if message N was found."
1145 (interactive "P") 1166 (interactive "P")
1146 (if (consp n) (setq n (prefix-numeric-value n))) 1167 (if (consp n) (setq n (prefix-numeric-value n)))
1147 (if (eobp) (forward-line -1)) 1168 (if (eobp) (forward-line -1))
@@ -1191,7 +1212,8 @@ If SKIP-RMAIL, don't do anything to the Rmail buffer."
1191 (rmail-show-message-maybe n)) 1212 (rmail-show-message-maybe n))
1192 (select-window selwin) 1213 (select-window selwin)
1193 ;; The actions above can alter the current buffer. Preserve it. 1214 ;; The actions above can alter the current buffer. Preserve it.
1194 (set-buffer obuf)))))) 1215 (set-buffer obuf))))
1216 (not message-not-found)))
1195 1217
1196;; Update the highlighted line in an rmail summary buffer. 1218;; Update the highlighted line in an rmail summary buffer.
1197;; That should be current. We highlight the line point is on. 1219;; That should be current. We highlight the line point is on.
@@ -1201,7 +1223,8 @@ If SKIP-RMAIL, don't do anything to the Rmail buffer."
1201 (or rmail-summary-overlay 1223 (or rmail-summary-overlay
1202 (progn 1224 (progn
1203 (make-local-variable 'rmail-summary-overlay) 1225 (make-local-variable 'rmail-summary-overlay)
1204 (setq rmail-summary-overlay (make-overlay (point) (point))))) 1226 (setq rmail-summary-overlay (make-overlay (point) (point)))
1227 (overlay-put rmail-summary-overlay 'rmail-summary t)))
1205 ;; If this message is in the summary, use the overlay to highlight it. 1228 ;; If this message is in the summary, use the overlay to highlight it.
1206 ;; Otherwise, don't highlight anything. 1229 ;; Otherwise, don't highlight anything.
1207 (if not-found 1230 (if not-found
@@ -1210,7 +1233,7 @@ If SKIP-RMAIL, don't do anything to the Rmail buffer."
1210 (save-excursion (beginning-of-line) 1233 (save-excursion (beginning-of-line)
1211 (skip-chars-forward " ") 1234 (skip-chars-forward " ")
1212 (point)) 1235 (point))
1213 (save-excursion (end-of-line) (point))) 1236 (line-end-position))
1214 (overlay-put rmail-summary-overlay 'face 'highlight))) 1237 (overlay-put rmail-summary-overlay 'face 'highlight)))
1215 1238
1216(defun rmail-summary-scroll-msg-up (&optional dist) 1239(defun rmail-summary-scroll-msg-up (&optional dist)