changeset 88228:fc29854c8b18

(rmail-summary-mode): Fixed typo in doc string and keymap. (rmail-summary-update-attribute): Deleted. (rmail-summary-update): Simple defun regenerates the entire summary line.
author Alex Schroeder <alex@gnu.org>
date Thu, 19 Jan 2006 23:55:51 +0000
parents b589e7b4f4c4
children 1453476a5834
files lisp/mail/rmailsum.el
diffstat 1 files changed, 15 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/rmailsum.el	Thu Jan 19 23:54:03 2006 +0000
+++ b/lisp/mail/rmailsum.el	Thu Jan 19 23:55:51 2006 +0000
@@ -520,7 +520,7 @@
 \\[rmail-summary-by-topic] Filter by Subject.
       Filter by the entire message (header and body) if given a
       prefix argument.
-\\[rmail-summary-by-sender] Filter by From field.
+\\[rmail-summary-by-senders] Filter by From field.
 \\[rmail-summary-by-recipients] Filter by To, From, and Cc fields.
       Filter by To and From only if given a prefix argument.
 
@@ -667,7 +667,7 @@
   (define-key rmail-summary-mode-map "\e\C-h" 'rmail-summary)
   (define-key rmail-summary-mode-map "\e\C-l" 'rmail-summary-by-labels)
   (define-key rmail-summary-mode-map "\e\C-r" 'rmail-summary-by-recipients)
-  (define-key rmail-summary-mode-map "\e\C-f" 'rmail-summary-by-sender)
+  (define-key rmail-summary-mode-map "\e\C-f" 'rmail-summary-by-senders)
   (define-key rmail-summary-mode-map "\e\C-s" 'rmail-summary-by-regexp)
   (define-key rmail-summary-mode-map "\e\C-t" 'rmail-summary-by-topic)
   (define-key rmail-summary-mode-map "m"      'rmail-summary-mail)
@@ -1520,29 +1520,19 @@
 		     (rmail-summary-get-line-count n)
 		     (concat str (rmail-desc-get-subject n))))))
 
-(defun rmail-summary-update-attribute (attr-index n)
-  "Update the attribute denoted by ATTR-INDEX in message N."
-  (save-excursion
-    (let (offset)
-
-      ;; Position point at the beginning of the attributes.
-      (rmail-summary-goto-msg n)
-      (skip-chars-forward " ")
-      (skip-chars-forward "0-9")
-
-      ;; Determine if the attribute is represented on the summary
-      ;; line.
-      (setq offset (rmail-desc-get-summary-offset attr-index))
-      (if offset
-
-          ;; It is.  If necessary, replace the character code
-          ;; corresponding to ATTR-INDEX.
-          (let ((char (rmail-desc-get-attr-code attr-index n))
-                (buffer-read-only nil))
-            (goto-char (+ (point) offset))
-            (unless (looking-at char)
-              (delete-char 1)
-              (insert char)))))))
+(defun rmail-summary-update (n)
+  "Rewrite the summary line for message N."
+  (with-current-buffer rmail-buffer
+    ;; we need to do this in the rmail-buffer lest the keywords are
+    ;; not recognized
+    (let ((summary (rmail-summary-get-summary n)))
+      (with-current-buffer rmail-summary-buffer
+	(save-excursion
+	  (let ((buffer-read-only nil))
+	    (rmail-summary-goto-msg n)
+	    ;; summary line includes newline at the end
+	    (delete-region (point) (1+ (line-end-position)))
+	    (insert summary)))))))
 
 (provide 'rmailsum)