Mercurial > emacs
changeset 100654:2fedbb810d01
(pmail-display-labels): Doc fix.
(pmail-set-attribute): Deleted unused vars.
Bind inhibit-read-only, not buffer-read-only.
(pmail-message-attr-p): Doc fix.
(pmail-message-labels-p, pmail-message-recipients-p)
(pmail-message-regexp-p): Mark as broken.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 23 Dec 2008 03:47:32 +0000 |
parents | 14070fe82d72 |
children | 4f54978ec0c5 |
files | lisp/mail/pmail.el |
diffstat | 1 files changed, 22 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/mail/pmail.el Tue Dec 23 03:46:03 2008 +0000 +++ b/lisp/mail/pmail.el Tue Dec 23 03:47:32 2008 +0000 @@ -2046,7 +2046,9 @@ (when (> msgnum 0) (let (msgbeg end) (setq msgbeg (pmail-msgbeg msgnum)) + ;; All access to the buffer's local variables is now finished... (save-excursion + ;; ... so it is ok to go to a different buffer. (if (pmail-buffers-swapped-p) (set-buffer pmail-view-buffer)) (save-restriction (widen) @@ -2083,11 +2085,10 @@ (pmail-get-header pmail-keyword-header msg)) (defun pmail-display-labels () - "Update the mode line with the (set) attributes and keywords -for the current message." + "Update the current messages's attributes and keywords in mode line." (let (blurb attr-names keywords) - ;; Combine the message attributes and keywords into a comma - ;; separated list. + ;; Combine the message attributes and keywords + ;; into a comma-separated list. (setq attr-names (pmail-get-attr-names pmail-current-message) keywords (pmail-get-keywords pmail-current-message)) (setq blurb @@ -2125,19 +2126,21 @@ change; nil means current message." (with-current-buffer pmail-buffer (let ((value (pmail-get-attr-value attr state)) - (omax (point-max-marker)) - (omin (point-min-marker)) - (buffer-read-only nil) + (inhibit-read-only t) limit msgbeg) (or msgnum (setq msgnum pmail-current-message)) (when (> msgnum 0) + ;; The "deleted" attribute is also stored in a special vector + ;; so update that too. (if (= attr pmail-deleted-attr-index) (pmail-set-message-deleted-p msgnum state)) (setq msgbeg (pmail-msgbeg msgnum)) + ;; All access to the buffer's local variables is now finished... (unwind-protect (save-excursion + ;; ... so it is ok to go to a different buffer. (if (pmail-buffers-swapped-p) (set-buffer pmail-view-buffer)) (save-restriction (widen) @@ -2147,10 +2150,14 @@ (save-excursion (setq limit (search-forward "\n\n" nil t))) (if (search-forward (concat pmail-attribute-header ": ") limit t) + ;; If this message already records attributes, + ;; just change the value for this one. (progn (forward-char attr) (when (/= value (char-after)) (delete-char 1) (insert value))) + ;; Otherwise add a header line to record the attributes + ;; and set all but this one to nil. (let ((header-value "-------")) (aset header-value attr value) (goto-char (if limit (- limit 1) (point-max))) @@ -2159,8 +2166,8 @@ (pmail-display-labels))))))) (defun pmail-message-attr-p (msg attrs) - "Return t if the attributes header for message MSG contains a -match for the regexp ATTRS." + "Return t if the attributes header for message MSG matches regexp ATTRS. +This function assumes the Pmail buffer is unswapped." (save-excursion (save-restriction (let ((start (pmail-msgbeg msg)) @@ -2181,6 +2188,8 @@ ;; Return t if the attributes/keywords line of msg number MSG ;; contains a match for the regexp LABELS. (defun pmail-message-labels-p (msg labels) + ;;;??? BROKEN + (error "pmail-message-labels-p has not been updated for Pmail") (save-excursion (save-restriction (widen) @@ -2716,6 +2725,8 @@ (if (>= where (pmail-msgbeg high)) high low))) (defun pmail-message-recipients-p (msg recipients &optional primary-only) + ;;;??? BROKEN + (error "pmail-message-recipients-p has not been updated for Pmail") (save-restriction (goto-char (pmail-msgbeg msg)) (search-forward "\n*** EOOH ***\n") @@ -2727,6 +2738,8 @@ (defun pmail-message-regexp-p (n regexp) "Return t, if for message number N, regexp REGEXP matches in the header." + ;;;??? BROKEN + (error "pmail-message-regexp-p has not been updated for Pmail") (let ((beg (pmail-msgbeg n)) (end (pmail-msgend n))) (goto-char beg)