changeset 101991:22fabdb9d445

(rmail-summary-vector, rmail-mode-map): Add doc string. (rmail-set-header-1): If VALUE is nil, remove the header altogether. (rmail-set-header): Doc fix.
author Glenn Morris <rgm@gnu.org>
date Fri, 13 Feb 2009 03:51:16 +0000
parents aaaaf30ab036
children ef7ed7efa61c
files lisp/ChangeLog lisp/mail/rmail.el
diffstat 2 files changed, 41 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Feb 13 03:49:58 2009 +0000
+++ b/lisp/ChangeLog	Fri Feb 13 03:51:16 2009 +0000
@@ -1,3 +1,27 @@
+2009-02-13  Glenn Morris  <rgm@gnu.org>
+
+	* mail/rmailsum.el (msgnum): Remove declaration.
+	(rmail-summary-redo): Add missing initialization value.
+	(rmail-summary-overlay, rmail-summary-mode-map): Add doc string.
+	(rmail-summary-mark-deleted, rmail-summary-deleted-p):
+	Fix skip-chars-forward calls.
+	(rmail-summary-mark-seen): New function.  As well as removing the '-'
+	mark, update the summary-vector.  (Bug#2135)
+	(rmail-summary-rmail-update, rmail-summary-goto-msg):
+	Use rmail-summary-mark-seen.
+
+	* mail/rmail.el (rmail-summary-vector, rmail-mode-map): Add doc string.
+
+	* mail/unrmail.el (unrmail): When getting message keywords, don't
+	include a leading space, but do include the space after the separating
+	comma.  (Bug#2303)
+
+	* mail/rmail.el (rmail-set-header-1): If VALUE is nil, remove the
+	header altogether.
+	(rmail-set-header): Doc fix.
+	* mail/rmailkwd.el (rmail-set-label): Delete the keyword header if all
+	labels are removed.  (Bug#2302)
+
 2009-02-12  Juri Linkov  <juri@jurta.org>
 
 	* image-mode.el (image-toggle-display):
--- a/lisp/mail/rmail.el	Fri Feb 13 03:49:58 2009 +0000
+++ b/lisp/mail/rmail.el	Fri Feb 13 03:51:16 2009 +0000
@@ -564,7 +564,9 @@
 
 (defvar rmail-summary-buffer nil)
 (put 'rmail-summary-buffer 'permanent-local t)
-(defvar rmail-summary-vector nil)
+(defvar rmail-summary-vector nil
+  "In an Rmail buffer, vector of (newline-terminated) strings.
+Element N specifies the summary line for message N+1.")
 (put 'rmail-summary-vector 'permanent-local t)
 
 ;; Rmail buffer swapping variables.
@@ -1130,7 +1132,8 @@
     (define-key map [menu-bar move next]
       '("Next" . rmail-next-message))
 
-    map))
+   map)
+  "Keymap used in Rmail mode.")
 
 ;; Rmail toolbar
 (defvar rmail-tool-bar-map
@@ -2010,23 +2013,27 @@
 
 (defun rmail-set-header-1 (name value)
   "Subroutine of `rmail-set-header'.
-Narrow to header, set header NAME to VALUE, replacing existing if present."
+Narrow to header, set header NAME to VALUE, replacing existing if present.
+VALUE nil means to remove NAME altogether."
   (if (search-forward "\n\n" nil t)
       (progn
 	(forward-char -1)
 	(narrow-to-region (point-min) (point))
 	(goto-char (point-min))
 	(if (re-search-forward (concat "^" (regexp-quote name) ":") nil 'move)
-	    (progn
-	      (delete-region (point) (line-end-position))
-	      (insert " " value))
-	  (insert name ": " value "\n")))
+            (if value
+                (progn
+                  (delete-region (point) (line-end-position))
+                  (insert " " value))
+              (delete-region (line-beginning-position)
+                             (line-beginning-position 2)))
+          (if value (insert name ": " value "\n"))))
     (rmail-error-bad-format)))
 
 (defun rmail-set-header (name &optional msgnum value)
-  "Store VALUE in message header NAME, nil if it has none.
-MSGNUM specifies the message number to operate on.
-If MSGNUM is nil, use the current message."
+  "Set message header NAME to VALUE in message number MSGNUM.
+If MSGNUM is nil, use the current message.  NAME and VALUE are strings.
+VALUE may also be nil, meaning to remove the header."
   (rmail-apply-in-message msgnum 'rmail-set-header-1 name value)
   ;; Ensure header changes get saved.
   ;; (Note replacing a header with an identical copy modifies.)