diff options
| author | Chong Yidong | 2008-12-20 07:03:06 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-12-20 07:03:06 +0000 |
| commit | 07be10d88f4560a3e7cf3d6867e8ef37f4cdf919 (patch) | |
| tree | 1a6f9d68a7dccfbed84cad93a1176cb03a494830 | |
| parent | bbf92dadcd6f06e259a28c9bfd3fd1766ef0c9c8 (diff) | |
| download | emacs-07be10d88f4560a3e7cf3d6867e8ef37f4cdf919.tar.gz emacs-07be10d88f4560a3e7cf3d6867e8ef37f4cdf919.zip | |
(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.
| -rw-r--r-- | lisp/mail/pmail.el | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/lisp/mail/pmail.el b/lisp/mail/pmail.el index 689639316f0..76949ff95ce 100644 --- a/lisp/mail/pmail.el +++ b/lisp/mail/pmail.el | |||
| @@ -79,7 +79,7 @@ | |||
| 79 | (?S "stored") | 79 | (?S "stored") |
| 80 | (?U "unseen")] | 80 | (?U "unseen")] |
| 81 | "An array that provides a mapping between an attribute index, | 81 | "An array that provides a mapping between an attribute index, |
| 82 | it's character representation and it's display representation.") | 82 | its character representation and its display representation.") |
| 83 | 83 | ||
| 84 | (defvar deleted-head) | 84 | (defvar deleted-head) |
| 85 | (defvar font-lock-fontified) | 85 | (defvar font-lock-fontified) |
| @@ -1942,16 +1942,6 @@ is non-nil if the user has supplied the password interactively. | |||
| 1942 | (setq last-coding-system-used | 1942 | (setq last-coding-system-used |
| 1943 | (coding-system-change-eol-conversion coding 0)))) | 1943 | (coding-system-change-eol-conversion coding 0)))) |
| 1944 | 1944 | ||
| 1945 | (defun pmail-add-header (name value) | ||
| 1946 | "Add a message header named NAME with value VALUE. | ||
| 1947 | The current buffer is narrowed to the headers for some | ||
| 1948 | message (including the blank line separator)." | ||
| 1949 | ;; Position point at the end of the headers but before the blank | ||
| 1950 | ;; line separating the headers from the body. | ||
| 1951 | (goto-char (point-max)) | ||
| 1952 | (forward-char -1) | ||
| 1953 | (insert name ": " value "\n")) | ||
| 1954 | |||
| 1955 | (defun pmail-add-mbox-headers () | 1945 | (defun pmail-add-mbox-headers () |
| 1956 | "Validate the RFC2822 format for the new messages. | 1946 | "Validate the RFC2822 format for the new messages. |
| 1957 | Point should be at the first new message. | 1947 | Point should be at the first new message. |
| @@ -1977,7 +1967,8 @@ new messages. Return the number of new messages." | |||
| 1977 | (setq count (1+ count)) | 1967 | (setq count (1+ count)) |
| 1978 | (narrow-to-region start (point)) | 1968 | (narrow-to-region start (point)) |
| 1979 | (unless (mail-fetch-field pmail-attribute-header) | 1969 | (unless (mail-fetch-field pmail-attribute-header) |
| 1980 | (pmail-add-header pmail-attribute-header value)) | 1970 | (backward-char 1) |
| 1971 | (insert pmail-attribute-header ": " value "\n")) | ||
| 1981 | (widen)) | 1972 | (widen)) |
| 1982 | (pmail-error-bad-format)) | 1973 | (pmail-error-bad-format)) |
| 1983 | ;; Move to the next message. | 1974 | ;; Move to the next message. |
| @@ -2114,9 +2105,9 @@ for the current message." | |||
| 2114 | keywords (pmail-get-keywords pmail-current-message)) | 2105 | keywords (pmail-get-keywords pmail-current-message)) |
| 2115 | (setq blurb | 2106 | (setq blurb |
| 2116 | (cond | 2107 | (cond |
| 2117 | ((and attr-names keywords) (concat attr-names ", " keywords)) | 2108 | ((and attr-names keywords) (concat " " attr-names ", " keywords)) |
| 2118 | (attr-names attr-names) | 2109 | (attr-names (concat " " attr-names)) |
| 2119 | (keywords keywords) | 2110 | (keywords (concat " " keywords)) |
| 2120 | (t ""))) | 2111 | (t ""))) |
| 2121 | (setq mode-line-process | 2112 | (setq mode-line-process |
| 2122 | (format " %d/%d%s" | 2113 | (format " %d/%d%s" |
| @@ -2146,6 +2137,7 @@ with the state (nil represents off and non-nil represents on). | |||
| 2146 | ATTR is the index of the attribute. MSGNUM is message number to | 2137 | ATTR is the index of the attribute. MSGNUM is message number to |
| 2147 | change; nil means current message." | 2138 | change; nil means current message." |
| 2148 | (set-buffer pmail-buffer) | 2139 | (set-buffer pmail-buffer) |
| 2140 | (pmail-swap-buffers-maybe) | ||
| 2149 | (let ((value (pmail-get-attr-value attr state)) | 2141 | (let ((value (pmail-get-attr-value attr state)) |
| 2150 | (omax (point-max-marker)) | 2142 | (omax (point-max-marker)) |
| 2151 | (omin (point-min-marker)) | 2143 | (omin (point-min-marker)) |
| @@ -2160,11 +2152,15 @@ change; nil means current message." | |||
| 2160 | (goto-char (pmail-msgbeg msgnum)) | 2152 | (goto-char (pmail-msgbeg msgnum)) |
| 2161 | (save-excursion | 2153 | (save-excursion |
| 2162 | (setq limit (search-forward "\n\n" nil t))) | 2154 | (setq limit (search-forward "\n\n" nil t))) |
| 2163 | (when (search-forward (concat pmail-attribute-header ": ") limit t) | 2155 | (if (search-forward (concat pmail-attribute-header ": ") limit t) |
| 2164 | (forward-char attr) | 2156 | (progn (forward-char attr) |
| 2165 | (when (/= value (char-after)) | 2157 | (when (/= value (char-after)) |
| 2166 | (delete-char 1) | 2158 | (delete-char 1) |
| 2167 | (insert value))) | 2159 | (insert value))) |
| 2160 | (let ((header-value "-------")) | ||
| 2161 | (aset header-value attr value) | ||
| 2162 | (goto-char (if limit (- limit 1) (point-max))) | ||
| 2163 | (insert pmail-attribute-header ": " header-value "\n"))) | ||
| 2168 | (if (= attr pmail-deleted-attr-index) | 2164 | (if (= attr pmail-deleted-attr-index) |
| 2169 | (pmail-set-message-deleted-p msgnum state))) | 2165 | (pmail-set-message-deleted-p msgnum state))) |
| 2170 | ;; Note: we don't use save-restriction because that does not work right | 2166 | ;; Note: we don't use save-restriction because that does not work right |