diff options
| author | Joakim Verona | 2012-12-07 10:06:46 +0100 |
|---|---|---|
| committer | Joakim Verona | 2012-12-07 10:06:46 +0100 |
| commit | 26a08c56955a479c71e34af0734a76352045e62d (patch) | |
| tree | 20cd76ee98109809bf7b7b6dcc0709f4653662b5 | |
| parent | 205f607d2a505ab60395d204924b5f22a559ed43 (diff) | |
| parent | 54c8b5baf18adfb42599a59b73d63e03673916ef (diff) | |
| download | emacs-26a08c56955a479c71e34af0734a76352045e62d.tar.gz emacs-26a08c56955a479c71e34af0734a76352045e62d.zip | |
auto upstream
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/mail/rmail.el | 7 | ||||
| -rw-r--r-- | lisp/mail/rmailedit.el | 24 |
3 files changed, 31 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 940dc62fedf..36fc8eea448 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2012-12-07 Glenn Morris <rgm@gnu.org> | 1 | 2012-12-07 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * mail/rmail.el (rmail-mime-decoded): New permanent local. | ||
| 4 | (rmail-show-message-1): Set rmail-mime-decoded when appropriate. | ||
| 5 | * mail/rmailedit.el (rmail-cease-edit): Respect rmail-mbox-format | ||
| 6 | and rmail-mime-decoded. (Bug#9841) | ||
| 7 | |||
| 3 | * mail/unrmail.el (unrmail-mbox-format): New option. (Bug#6574) | 8 | * mail/unrmail.el (unrmail-mbox-format): New option. (Bug#6574) |
| 4 | (batch-unrmail, unrmail): Doc fixes. | 9 | (batch-unrmail, unrmail): Doc fixes. |
| 5 | (unrmail): Respect unrmail-mbox-format. | 10 | (unrmail): Respect unrmail-mbox-format. |
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 446ea4de0f3..eec96f4c0b6 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el | |||
| @@ -100,6 +100,10 @@ its character representation and its display representation.") | |||
| 100 | "The current header display style choice, one of | 100 | "The current header display style choice, one of |
| 101 | 'normal (selected headers) or 'full (all headers).") | 101 | 'normal (selected headers) or 'full (all headers).") |
| 102 | 102 | ||
| 103 | (defvar rmail-mime-decoded nil | ||
| 104 | "Non-nil if message has been processed by `rmail-show-mime-function'.") | ||
| 105 | (put 'rmail-mime-decoded 'permanent-local t) ; for rmail-edit | ||
| 106 | |||
| 103 | (defgroup rmail nil | 107 | (defgroup rmail nil |
| 104 | "Mail reader for Emacs." | 108 | "Mail reader for Emacs." |
| 105 | :group 'mail) | 109 | :group 'mail) |
| @@ -2768,6 +2772,7 @@ The current mail message becomes the message displayed." | |||
| 2768 | (re-search-forward "mime-version: 1.0" nil t)) | 2772 | (re-search-forward "mime-version: 1.0" nil t)) |
| 2769 | (let ((rmail-buffer mbox-buf) | 2773 | (let ((rmail-buffer mbox-buf) |
| 2770 | (rmail-view-buffer view-buf)) | 2774 | (rmail-view-buffer view-buf)) |
| 2775 | (set (make-local-variable 'rmail-mime-decoded) t) | ||
| 2771 | (funcall rmail-show-mime-function)) | 2776 | (funcall rmail-show-mime-function)) |
| 2772 | (setq body-start (search-forward "\n\n" nil t)) | 2777 | (setq body-start (search-forward "\n\n" nil t)) |
| 2773 | (narrow-to-region beg (point)) | 2778 | (narrow-to-region beg (point)) |
| @@ -4576,7 +4581,7 @@ encoded string (and the same mask) will decode the string." | |||
| 4576 | ;;; Start of automatically extracted autoloads. | 4581 | ;;; Start of automatically extracted autoloads. |
| 4577 | 4582 | ||
| 4578 | ;;;### (autoloads (rmail-edit-current-message) "rmailedit" "rmailedit.el" | 4583 | ;;;### (autoloads (rmail-edit-current-message) "rmailedit" "rmailedit.el" |
| 4579 | ;;;;;; "78b8b7d5c679935c118d595d473d7c5e") | 4584 | ;;;;;; "791ea184628feb6335fe3e29f7234934") |
| 4580 | ;;; Generated autoloads from rmailedit.el | 4585 | ;;; Generated autoloads from rmailedit.el |
| 4581 | 4586 | ||
| 4582 | (autoload 'rmail-edit-current-message "rmailedit" "\ | 4587 | (autoload 'rmail-edit-current-message "rmailedit" "\ |
diff --git a/lisp/mail/rmailedit.el b/lisp/mail/rmailedit.el index e4e066bd642..004eb2e3247 100644 --- a/lisp/mail/rmailedit.el +++ b/lisp/mail/rmailedit.el | |||
| @@ -167,10 +167,25 @@ This function runs the hooks `text-mode-hook' and `rmail-edit-mode-hook'. | |||
| 167 | (if (or rmail-old-mime-state | 167 | (if (or rmail-old-mime-state |
| 168 | (not rmail-old-pruned)) | 168 | (not rmail-old-pruned)) |
| 169 | (forward-line 1)) | 169 | (forward-line 1)) |
| 170 | (while (re-search-forward "^>*From " nil t) | 170 | ;; When editing a non-MIME message, rmail-show-message-1 has unescaped |
| 171 | (beginning-of-line) | 171 | ;; ^>*From lines according to rmail-mbox-format. We are editing |
| 172 | (insert ">") | 172 | ;; the message as it was displayed, and need to put the escapes when done. |
| 173 | (forward-line)) | 173 | ;; When editing a MIME message, we are editing the "raw" message. |
| 174 | ;; ^>*From lines have not been escaped, but we still need to ensure | ||
| 175 | ;; a "^From " line is escaped so as not to break later parsing (?). | ||
| 176 | ;; With ^>+From lines, we have no way of knowing whether the person | ||
| 177 | ;; doing the editing escaped them or not, so it seems best to leave | ||
| 178 | ;; them alone. (This all assumes you are using rmailmm rather than | ||
| 179 | ;; something else that behaves differently.) | ||
| 180 | (let ((fromline (if (or (eq 'mboxo rmail-mbox-format) | ||
| 181 | rmail-mime-decoded) | ||
| 182 | "^From " | ||
| 183 | "^>*From ")) | ||
| 184 | case-fold-search) | ||
| 185 | (while (re-search-forward fromline nil t) | ||
| 186 | (beginning-of-line) | ||
| 187 | (insert ">") | ||
| 188 | (forward-line))) | ||
| 174 | ;; Make sure buffer ends with a blank line so as not to run this | 189 | ;; Make sure buffer ends with a blank line so as not to run this |
| 175 | ;; message together with the following one. | 190 | ;; message together with the following one. |
| 176 | (goto-char (point-max)) | 191 | (goto-char (point-max)) |
| @@ -201,6 +216,7 @@ This function runs the hooks `text-mode-hook' and `rmail-edit-mode-hook'. | |||
| 201 | (setq buffer-undo-list t) | 216 | (setq buffer-undo-list t) |
| 202 | (rmail-variables)) | 217 | (rmail-variables)) |
| 203 | ;; If text has really changed, mark message as edited. | 218 | ;; If text has really changed, mark message as edited. |
| 219 | ;; FIXME we should do the comparison before escaping From lines. | ||
| 204 | (unless (and (= (length old) (- (point-max) (point-min))) | 220 | (unless (and (= (length old) (- (point-max) (point-min))) |
| 205 | (string= old (buffer-substring (point-min) (point-max)))) | 221 | (string= old (buffer-substring (point-min) (point-max)))) |
| 206 | (setq old nil) | 222 | (setq old nil) |