diff options
| author | Richard M. Stallman | 2014-01-02 17:30:32 -0500 |
|---|---|---|
| committer | Richard M. Stallman | 2014-01-02 17:30:32 -0500 |
| commit | a574edbec9c9de37d04fffcace178e873bd41245 (patch) | |
| tree | 630f7c00bc7d83028ac4b7a7b1eec3acbb2063eb | |
| parent | b66b98fe412a97008778b34fa76ada7d1609631c (diff) | |
| download | emacs-a574edbec9c9de37d04fffcace178e873bd41245.tar.gz emacs-a574edbec9c9de37d04fffcace178e873bd41245.zip | |
Minor rmail fixes.
* mail/rmail.el (rmail-get-coding-function): Variable.
(rmail-get-coding-system): Use it.
* mail/rmail.el (rmail-make-in-reply-to-field):
Add parens in message-id.
* mail/rmailmm.el (rmail-mime-message-p): Moved to rmail.el.
* mail/rmail.el (rmail-mime-message-p): Moved from rmailmm.el.
(rmail-epa-decrypt): Turn off mime processing.
| -rw-r--r-- | lisp/ChangeLog | 12 | ||||
| -rw-r--r-- | lisp/mail/rmail.el | 44 | ||||
| -rw-r--r-- | lisp/mail/rmailmm.el | 5 |
3 files changed, 40 insertions, 21 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 32fa519242d..bea33b8dd17 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2014-01-02 Richard Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * mail/rmailmm.el (rmail-mime-message-p): Moved to rmail.el. | ||
| 4 | * mail/rmail.el (rmail-mime-message-p): Moved from rmailmm.el. | ||
| 5 | (rmail-epa-decrypt): Turn off mime processing. | ||
| 6 | |||
| 7 | * mail/rmail.el (rmail-make-in-reply-to-field): | ||
| 8 | Add parens in message-id. | ||
| 9 | |||
| 10 | * mail/rmail.el (rmail-get-coding-function): Variable. | ||
| 11 | (rmail-get-coding-system): Use it. | ||
| 12 | |||
| 1 | 2014-01-02 Vincent Belaïche <vincentb1@users.sourceforge.net> | 13 | 2014-01-02 Vincent Belaïche <vincentb1@users.sourceforge.net> |
| 2 | 14 | ||
| 3 | * ses.el (ses-initial-global-parameters-re): New defconst, a | 15 | * ses.el (ses-initial-global-parameters-re): New defconst, a |
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 9dea204e532..0f02a668402 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el | |||
| @@ -104,6 +104,11 @@ its character representation and its display representation.") | |||
| 104 | "Non-nil if message has been processed by `rmail-show-mime-function'.") | 104 | "Non-nil if message has been processed by `rmail-show-mime-function'.") |
| 105 | (put 'rmail-mime-decoded 'permanent-local t) ; for rmail-edit | 105 | (put 'rmail-mime-decoded 'permanent-local t) ; for rmail-edit |
| 106 | 106 | ||
| 107 | (defsubst rmail-mime-message-p () | ||
| 108 | "Non-nil if and only if the current message is a MIME." | ||
| 109 | (or (get-text-property (point) 'rmail-mime-entity) | ||
| 110 | (get-text-property (point-min) 'rmail-mime-entity))) | ||
| 111 | |||
| 107 | (defgroup rmail nil | 112 | (defgroup rmail nil |
| 108 | "Mail reader for Emacs." | 113 | "Mail reader for Emacs." |
| 109 | :group 'mail) | 114 | :group 'mail) |
| @@ -686,6 +691,12 @@ Element N specifies the summary line for message N+1.") | |||
| 686 | 691 | ||
| 687 | This is set to nil by default.") | 692 | This is set to nil by default.") |
| 688 | 693 | ||
| 694 | (defcustom rmail-get-coding-function nil | ||
| 695 | "Function of no args to try to determine coding system for a message." | ||
| 696 | :type 'function | ||
| 697 | :group 'rmail | ||
| 698 | :version "24.4") | ||
| 699 | |||
| 689 | (defcustom rmail-enable-mime t | 700 | (defcustom rmail-enable-mime t |
| 690 | "If non-nil, RMAIL automatically displays decoded MIME messages. | 701 | "If non-nil, RMAIL automatically displays decoded MIME messages. |
| 691 | For this to work, the feature specified by `rmail-mime-feature' must | 702 | For this to work, the feature specified by `rmail-mime-feature' must |
| @@ -1029,9 +1040,10 @@ This function also reinitializes local variables used by Rmail." | |||
| 1029 | The buffer is expected to be narrowed to just the header of the message." | 1040 | The buffer is expected to be narrowed to just the header of the message." |
| 1030 | (save-excursion | 1041 | (save-excursion |
| 1031 | (goto-char (point-min)) | 1042 | (goto-char (point-min)) |
| 1032 | (if (re-search-forward rmail-mime-charset-pattern nil t) | 1043 | (or (funcall rmail-get-coding-function) |
| 1033 | (coding-system-from-name (match-string 1)) | 1044 | (if (re-search-forward rmail-mime-charset-pattern nil t) |
| 1034 | 'undecided))) | 1045 | (coding-system-from-name (match-string 1)) |
| 1046 | 'undecided)))) | ||
| 1035 | 1047 | ||
| 1036 | ;;; Set up Rmail mode keymaps | 1048 | ;;; Set up Rmail mode keymaps |
| 1037 | 1049 | ||
| @@ -3863,16 +3875,18 @@ which is an element of rmail-msgref-vector." | |||
| 3863 | message-id)) | 3875 | message-id)) |
| 3864 | ;; missing From, or Message-ID is sufficiently informative | 3876 | ;; missing From, or Message-ID is sufficiently informative |
| 3865 | message-id | 3877 | message-id |
| 3866 | (concat message-id " (" tem ")")) | 3878 | (concat message-id " (" tem ")")) |
| 3879 | ;; Message has no Message-ID field. | ||
| 3867 | ;; Copy TEM, discarding text properties. | 3880 | ;; Copy TEM, discarding text properties. |
| 3868 | (setq tem (copy-sequence tem)) | 3881 | (setq tem (copy-sequence tem)) |
| 3869 | (set-text-properties 0 (length tem) nil tem) | 3882 | (set-text-properties 0 (length tem) nil tem) |
| 3870 | (setq tem (copy-sequence tem)) | 3883 | (setq tem (copy-sequence tem)) |
| 3871 | ;; Use prin1 to fake RFC822 quoting | 3884 | ;; Use prin1 to fake RFC822 quoting |
| 3872 | (let ((field (prin1-to-string tem))) | 3885 | (let ((field (prin1-to-string tem))) |
| 3886 | ;; Wrap it in parens to make it a comment according to RFC822 | ||
| 3873 | (if date | 3887 | (if date |
| 3874 | (concat field "'s message of " date) | 3888 | (concat "(" field "'s message of " date ")") |
| 3875 | field))))) | 3889 | (concat "(" field ")")))))) |
| 3876 | ((let* ((foo "[^][\000-\037()<>@,;:\\\" ]+") | 3890 | ((let* ((foo "[^][\000-\037()<>@,;:\\\" ]+") |
| 3877 | (bar "[^][\000-\037()<>@,;:\\\"]+")) | 3891 | (bar "[^][\000-\037()<>@,;:\\\"]+")) |
| 3878 | ;; These strings both match all non-ASCII characters. | 3892 | ;; These strings both match all non-ASCII characters. |
| @@ -3898,7 +3912,8 @@ which is an element of rmail-msgref-vector." | |||
| 3898 | (if message-id | 3912 | (if message-id |
| 3899 | ;; "<AA259@bar.edu> (message from Unix Loser on 1-Apr-89)" | 3913 | ;; "<AA259@bar.edu> (message from Unix Loser on 1-Apr-89)" |
| 3900 | (concat message-id " (" field ")") | 3914 | (concat message-id " (" field ")") |
| 3901 | field)))) | 3915 | ;; Wrap in parens to make it a comment, for RFC822. |
| 3916 | (concat "(" field ")"))))) | ||
| 3902 | (t | 3917 | (t |
| 3903 | ;; If we can't kludge it simply, do it correctly | 3918 | ;; If we can't kludge it simply, do it correctly |
| 3904 | (let ((mail-use-rfc822 t)) | 3919 | (let ((mail-use-rfc822 t)) |
| @@ -4483,7 +4498,7 @@ encoded string (and the same mask) will decode the string." | |||
| 4483 | ;; There doesn't really seem to be an appropriate menu. | 4498 | ;; There doesn't really seem to be an appropriate menu. |
| 4484 | ;; Eg the edit command is not in a menu either. | 4499 | ;; Eg the edit command is not in a menu either. |
| 4485 | (defun rmail-epa-decrypt () | 4500 | (defun rmail-epa-decrypt () |
| 4486 | "Decrypt OpenPGP armors in current message." | 4501 | "Decrypt GnuPG or OpenPGP armors in current message." |
| 4487 | (interactive) | 4502 | (interactive) |
| 4488 | 4503 | ||
| 4489 | ;; Save the current buffer here for cleanliness, in case we | 4504 | ;; Save the current buffer here for cleanliness, in case we |
| @@ -4493,14 +4508,10 @@ encoded string (and the same mask) will decode the string." | |||
| 4493 | (let (decrypts) | 4508 | (let (decrypts) |
| 4494 | (goto-char (point-min)) | 4509 | (goto-char (point-min)) |
| 4495 | 4510 | ||
| 4496 | ;; In case the encrypted data is inside a mime attachment, | 4511 | ;; Turn off mime processing. |
| 4497 | ;; show it. This is a kludge; to be clean, it should not | 4512 | (when (and (rmail-mime-message-p) |
| 4498 | ;; modify the buffer, but I don't see how to do that. | 4513 | (not (get-text-property (point-min) 'rmail-mime-hidden))) |
| 4499 | (when (search-forward "octet-stream" nil t) | 4514 | (rmail-mime)) |
| 4500 | (beginning-of-line) | ||
| 4501 | (forward-button 1) | ||
| 4502 | (if (looking-at "Show") | ||
| 4503 | (rmail-mime-toggle-hidden))) | ||
| 4504 | 4515 | ||
| 4505 | ;; Now find all armored messages in the buffer | 4516 | ;; Now find all armored messages in the buffer |
| 4506 | ;; and decrypt them one by one. | 4517 | ;; and decrypt them one by one. |
| @@ -4560,6 +4571,7 @@ encoded string (and the same mask) will decode the string." | |||
| 4560 | (when armor-end | 4571 | (when armor-end |
| 4561 | (delete-region armor-start armor-end) | 4572 | (delete-region armor-start armor-end) |
| 4562 | (insert-buffer-substring from-buffer (nth 0 d) (nth 1 d))))))))))))) | 4573 | (insert-buffer-substring from-buffer (nth 0 d) (nth 1 d))))))))))))) |
| 4574 | |||
| 4563 | 4575 | ||
| 4564 | ;;;; Desktop support | 4576 | ;;;; Desktop support |
| 4565 | 4577 | ||
diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el index c9b9dc28f72..5ea85848e5a 100644 --- a/lisp/mail/rmailmm.el +++ b/lisp/mail/rmailmm.el | |||
| @@ -230,11 +230,6 @@ TRUNCATED is non-nil if the text of this entity was truncated." | |||
| 230 | (defsubst rmail-mime-entity-set-truncated (entity truncated) | 230 | (defsubst rmail-mime-entity-set-truncated (entity truncated) |
| 231 | (aset entity 9 truncated)) | 231 | (aset entity 9 truncated)) |
| 232 | 232 | ||
| 233 | (defsubst rmail-mime-message-p () | ||
| 234 | "Non-nil if and only if the current message is a MIME." | ||
| 235 | (or (get-text-property (point) 'rmail-mime-entity) | ||
| 236 | (get-text-property (point-min) 'rmail-mime-entity))) | ||
| 237 | |||
| 238 | ;;; Buttons | 233 | ;;; Buttons |
| 239 | 234 | ||
| 240 | (defun rmail-mime-save (button) | 235 | (defun rmail-mime-save (button) |