aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1993-11-16 08:45:56 +0000
committerRichard M. Stallman1993-11-16 08:45:56 +0000
commit708bfd4f815c92f5afbfea57bce304314dbfe5b9 (patch)
tree68a7f4a3fc10f69e4bfb3cc7e1bc55913dedfdc5
parent827534ea93fc953423de8a8d8b6c25a80a7ed4ec (diff)
downloademacs-708bfd4f815c92f5afbfea57bce304314dbfe5b9.tar.gz
emacs-708bfd4f815c92f5afbfea57bce304314dbfe5b9.zip
(rmail-set-attribute): Do nothing if MSGNUM is 0.
-rw-r--r--lisp/mail/rmail.el49
1 files changed, 25 insertions, 24 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 69e4b39e45d..8279adaad24 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -1109,30 +1109,31 @@ argument causes us to read a file name and use that file as the inbox."
1109 (omin (point-min-marker)) 1109 (omin (point-min-marker))
1110 (buffer-read-only nil)) 1110 (buffer-read-only nil))
1111 (or msgnum (setq msgnum rmail-current-message)) 1111 (or msgnum (setq msgnum rmail-current-message))
1112 (unwind-protect 1112 (if (> msgnum 0)
1113 (save-excursion 1113 (unwind-protect
1114 (widen) 1114 (save-excursion
1115 (goto-char (+ 3 (rmail-msgbeg msgnum))) 1115 (widen)
1116 (let ((curstate 1116 (goto-char (+ 3 (rmail-msgbeg msgnum)))
1117 (not 1117 (let ((curstate
1118 (null (search-backward (concat ", " attr ",") 1118 (not
1119 (prog1 (point) (end-of-line)) t))))) 1119 (null (search-backward (concat ", " attr ",")
1120 (or (eq curstate (not (not state))) 1120 (prog1 (point) (end-of-line)) t)))))
1121 (if curstate 1121 (or (eq curstate (not (not state)))
1122 (delete-region (point) (1- (match-end 0))) 1122 (if curstate
1123 (beginning-of-line) 1123 (delete-region (point) (1- (match-end 0)))
1124 (forward-char 2) 1124 (beginning-of-line)
1125 (insert " " attr ",")))) 1125 (forward-char 2)
1126 (if (string= attr "deleted") 1126 (insert " " attr ","))))
1127 (rmail-set-message-deleted-p msgnum state))) 1127 (if (string= attr "deleted")
1128 ;; Note: we don't use save-restriction because that does not work right 1128 (rmail-set-message-deleted-p msgnum state)))
1129 ;; if changes are made outside the saved restriction 1129 ;; Note: we don't use save-restriction because that does not work right
1130 ;; before that restriction is restored. 1130 ;; if changes are made outside the saved restriction
1131 (narrow-to-region omin omax) 1131 ;; before that restriction is restored.
1132 (set-marker omin nil) 1132 (narrow-to-region omin omax)
1133 (set-marker omax nil) 1133 (set-marker omin nil)
1134 (if (= msgnum rmail-current-message) 1134 (set-marker omax nil)
1135 (rmail-display-labels))))) 1135 (if (= msgnum rmail-current-message)
1136 (rmail-display-labels))))))
1136 1137
1137;; Return t if the attributes/keywords line of msg number MSG 1138;; Return t if the attributes/keywords line of msg number MSG
1138;; contains a match for the regexp LABELS. 1139;; contains a match for the regexp LABELS.