Mercurial > emacs
comparison lisp/mail/rmailout.el @ 5278:92268e08c166
(rmail-output-to-rmail-file): Call rmail-update-summary.
(rmail-output-to-rmail-file): Turn off the deleted
attribute outside of the save-restriction.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 23 Dec 1993 03:30:12 +0000 |
parents | 26abd5d13762 |
children | a74ffe260236 |
comparison
equal
deleted
inserted
replaced
5277:9e91acab81e9 | 5278:92268e08c166 |
---|---|
59 (setq answer (eval (cdr (car tail))))) | 59 (setq answer (eval (cdr (car tail))))) |
60 (setq tail (cdr tail)))) | 60 (setq tail (cdr tail)))) |
61 ;; If not suggestions, use same file as last time. | 61 ;; If not suggestions, use same file as last time. |
62 (or answer rmail-last-rmail-file)))) | 62 (or answer rmail-last-rmail-file)))) |
63 (list (setq rmail-last-rmail-file | 63 (list (setq rmail-last-rmail-file |
64 (read-file-name | 64 (expand-file-name |
65 (concat "Output message to Rmail file: (default " | 65 (or |
66 (file-name-nondirectory default-file) | 66 (read-file-name |
67 ") ") | 67 (concat "Output message to Rmail file: (default " |
68 (file-name-directory default-file) | 68 (file-name-nondirectory default-file) |
69 default-file)) | 69 ") ") |
70 (file-name-directory default-file) | |
71 default-file) | |
72 default-file) | |
73 (file-name-directory default-file))) | |
70 (prefix-numeric-value current-prefix-arg)))) | 74 (prefix-numeric-value current-prefix-arg)))) |
71 (or count (setq count 1)) | 75 (or count (setq count 1)) |
72 (setq file-name | 76 (setq file-name |
73 (expand-file-name file-name | 77 (expand-file-name file-name |
74 (file-name-directory rmail-last-rmail-file))) | 78 (file-name-directory rmail-last-rmail-file))) |
90 (error "Output file does not exist"))) | 94 (error "Output file does not exist"))) |
91 (while (> count 0) | 95 (while (> count 0) |
92 (let (redelete) | 96 (let (redelete) |
93 (unwind-protect | 97 (unwind-protect |
94 (progn | 98 (progn |
99 ;; Temporarily turn off Deleted attribute. | |
100 ;; Do this outside the save-restriction, since it would | |
101 ;; shift the place in the buffer where the visible text starts. | |
102 (if (rmail-message-deleted-p rmail-current-message) | |
103 (progn (setq redelete t) | |
104 (rmail-set-attribute "deleted" nil))) | |
95 (save-restriction | 105 (save-restriction |
96 (widen) | 106 (widen) |
97 (if (rmail-message-deleted-p rmail-current-message) | |
98 (progn (setq redelete t) | |
99 (rmail-set-attribute "deleted" nil))) | |
100 ;; Decide whether to append to a file or to an Emacs buffer. | 107 ;; Decide whether to append to a file or to an Emacs buffer. |
101 (save-excursion | 108 (save-excursion |
102 (let ((buf (get-file-buffer file-name)) | 109 (let ((buf (get-file-buffer file-name)) |
103 (cur (current-buffer)) | 110 (cur (current-buffer)) |
104 (beg (1+ (rmail-msgbeg rmail-current-message))) | 111 (beg (1+ (rmail-msgbeg rmail-current-message))) |
122 (goto-char (point-min)) | 129 (goto-char (point-min)) |
123 (widen) | 130 (widen) |
124 (search-backward "\n\^_") | 131 (search-backward "\n\^_") |
125 (narrow-to-region (point) (point-max)) | 132 (narrow-to-region (point) (point-max)) |
126 (rmail-count-new-messages t) | 133 (rmail-count-new-messages t) |
134 (if (rmail-summary-exists) | |
135 (rmail-select-summary | |
136 (rmail-update-summary))) | |
127 (rmail-show-message msg)) | 137 (rmail-show-message msg)) |
128 ;; Output file not in rmail mode => just insert at the end. | 138 ;; Output file not in rmail mode => just insert at the end. |
129 (narrow-to-region (point-min) (1+ (buffer-size))) | 139 (narrow-to-region (point-min) (1+ (buffer-size))) |
130 (goto-char (point-max)) | 140 (goto-char (point-max)) |
131 (insert-buffer-substring cur beg end))))))) | 141 (insert-buffer-substring cur beg end))))))) |