emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp/mail pmail.el


From: Chong Yidong
Subject: [Emacs-diffs] emacs/lisp/mail pmail.el
Date: Sat, 20 Dec 2008 07:03:06 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      08/12/20 07:03:06

Modified files:
        lisp/mail      : pmail.el 

Log message:
        (pmail-add-header): Function deleted.
        (pmail-add-mbox-headers): Insert header directly instead of
        calling pmail-add-header.
        (pmail-display-labels): Add leading space to attribute string.
        (pmail-set-attribute): Call pmail-swap-buffers-maybe.  Insert
        header directly instead of calling pmail-add-header.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/mail/pmail.el?cvsroot=emacs&r1=1.34&r2=1.35

Patches:
Index: pmail.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/mail/pmail.el,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- pmail.el    20 Dec 2008 04:29:26 -0000      1.34
+++ pmail.el    20 Dec 2008 07:03:06 -0000      1.35
@@ -79,7 +79,7 @@
     (?S "stored")
     (?U "unseen")]
   "An array that provides a mapping between an attribute index,
-it's character representation and it's display representation.")
+its character representation and its display representation.")
 
 (defvar deleted-head)
 (defvar font-lock-fontified)
@@ -1942,16 +1942,6 @@
        (setq last-coding-system-used
              (coding-system-change-eol-conversion coding 0))))
 
-(defun pmail-add-header (name value)
-  "Add a message header named NAME with value VALUE.
-The current buffer is narrowed to the headers for some
-message (including the blank line separator)."
-  ;; Position point at the end of the headers but before the blank
-  ;; line separating the headers from the body.
-  (goto-char (point-max))
-  (forward-char -1)
-  (insert name ": " value "\n"))
-
 (defun pmail-add-mbox-headers ()
   "Validate the RFC2822 format for the new messages.
 Point should be at the first new message.
@@ -1977,7 +1967,8 @@
                  (setq count (1+ count))
                  (narrow-to-region start (point))
                  (unless (mail-fetch-field pmail-attribute-header)
-                   (pmail-add-header pmail-attribute-header value))
+                   (backward-char 1)
+                   (insert pmail-attribute-header ": " value "\n"))
                  (widen))
              (pmail-error-bad-format))
            ;; Move to the next message.
@@ -2114,9 +2105,9 @@
          keywords (pmail-get-keywords pmail-current-message))
     (setq blurb
          (cond
-          ((and attr-names keywords) (concat attr-names ", " keywords))
-          (attr-names attr-names)
-          (keywords keywords)
+          ((and attr-names keywords) (concat " " attr-names ", " keywords))
+          (attr-names (concat " " attr-names))
+          (keywords (concat " " keywords))
           (t "")))
     (setq mode-line-process
          (format " %d/%d%s"
@@ -2146,6 +2137,7 @@
 ATTR is the index of the attribute.  MSGNUM is message number to
 change; nil means current message."
   (set-buffer pmail-buffer)
+  (pmail-swap-buffers-maybe)
   (let ((value (pmail-get-attr-value attr state))
        (omax (point-max-marker))
        (omin (point-min-marker))
@@ -2160,11 +2152,15 @@
              (goto-char (pmail-msgbeg msgnum))
              (save-excursion
                (setq limit (search-forward "\n\n" nil t)))
-             (when (search-forward (concat pmail-attribute-header ": ") limit 
t)
-               (forward-char attr)
+             (if (search-forward (concat pmail-attribute-header ": ") limit t)
+                 (progn (forward-char attr)
                (when (/= value (char-after))
                  (delete-char 1)
                  (insert value)))
+               (let ((header-value "-------"))
+                 (aset header-value attr value)
+                 (goto-char (if limit (- limit 1) (point-max)))
+                 (insert pmail-attribute-header ": " header-value "\n")))
              (if (= attr pmail-deleted-attr-index)
                  (pmail-set-message-deleted-p msgnum state)))
          ;; Note: we don't use save-restriction because that does not work 
right




reply via email to

[Prev in Thread] Current Thread [Next in Thread]