diff options
| author | Glenn Morris | 2011-11-19 18:23:48 -0800 |
|---|---|---|
| committer | Glenn Morris | 2011-11-19 18:23:48 -0800 |
| commit | 7fb18e9ef9edb3b47cf463babe83922f9310a473 (patch) | |
| tree | 5d10a9ae4938ce7da8807e804422b2f9be6375dd /lisp | |
| parent | d5a6b3badfc6e09c4bbda97f4ccf089952d57e5a (diff) | |
| download | emacs-7fb18e9ef9edb3b47cf463babe83922f9310a473.tar.gz emacs-7fb18e9ef9edb3b47cf463babe83922f9310a473.zip | |
Small rmail fixes.
* lisp/mail/rmail.el (rmail-enable-mime-composing): Make it a defcustom.
(rmail-insert-mime-forwarded-message-function, rmail-mime-feature):
Doc fixes.
(rmail-decode-mime-charset): Mark as obsolete.
* lisp/mail/rmailsum.el (rmail-message-regexp-p-1):
* lisp/mail/rmail.el (rmail-search-message, rmail-forward, rmail-resend):
Before using mime functions, check they are set.
Fixes: debbugs:10077
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 11 | ||||
| -rw-r--r-- | lisp/mail/rmail.el | 42 | ||||
| -rw-r--r-- | lisp/mail/rmailsum.el | 7 |
3 files changed, 40 insertions, 20 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e38f3c98637..68c9173efca 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2011-11-20 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * mail/rmail.el (rmail-enable-mime-composing): Make it a defcustom. | ||
| 4 | (rmail-insert-mime-forwarded-message-function, rmail-mime-feature): | ||
| 5 | Doc fixes. | ||
| 6 | (rmail-decode-mime-charset): Mark as obsolete. | ||
| 7 | |||
| 8 | * mail/rmailsum.el (rmail-message-regexp-p-1): | ||
| 9 | * mail/rmail.el (rmail-search-message, rmail-forward, rmail-resend): | ||
| 10 | Before using mime functions, check they are set. (Bug#10077) | ||
| 11 | |||
| 1 | 2011-11-19 Juri Linkov <juri@jurta.org> | 12 | 2011-11-19 Juri Linkov <juri@jurta.org> |
| 2 | 13 | ||
| 3 | * info.el (Info-finder-find-node): Use `package--builtins' instead | 14 | * info.el (Info-finder-find-node): Use `package--builtins' instead |
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 5d219c0084f..a8efe10ec76 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el | |||
| @@ -638,8 +638,11 @@ be available." | |||
| 638 | :version "23.3" | 638 | :version "23.3" |
| 639 | :group 'rmail) | 639 | :group 'rmail) |
| 640 | 640 | ||
| 641 | (defvar rmail-enable-mime-composing t | 641 | (defcustom rmail-enable-mime-composing t |
| 642 | "*If non-nil, RMAIL uses `rmail-insert-mime-forwarded-message-function' to forward.") | 642 | "If non-nil, use `rmail-insert-mime-forwarded-message-function' to forward." |
| 643 | :type 'boolean | ||
| 644 | :version "24.1" ; nil -> t | ||
| 645 | :group 'rmail) | ||
| 643 | 646 | ||
| 644 | (defvar rmail-show-mime-function nil | 647 | (defvar rmail-show-mime-function nil |
| 645 | "Function of no argument called to show a decoded MIME message. | 648 | "Function of no argument called to show a decoded MIME message. |
| @@ -649,8 +652,8 @@ The package providing MIME support should set this.") | |||
| 649 | ;;;###autoload | 652 | ;;;###autoload |
| 650 | (defvar rmail-insert-mime-forwarded-message-function nil | 653 | (defvar rmail-insert-mime-forwarded-message-function nil |
| 651 | "Function to insert a message in MIME format so it can be forwarded. | 654 | "Function to insert a message in MIME format so it can be forwarded. |
| 652 | This function is called if `rmail-enable-mime' or | 655 | This function is called if `rmail-enable-mime' and |
| 653 | `rmail-enable-mime-composing' is non-nil. | 656 | `rmail-enable-mime-composing' are non-nil. |
| 654 | It is called with one argument FORWARD-BUFFER, which is a | 657 | It is called with one argument FORWARD-BUFFER, which is a |
| 655 | buffer containing the message to forward. The current buffer | 658 | buffer containing the message to forward. The current buffer |
| 656 | is the outgoing mail buffer.") | 659 | is the outgoing mail buffer.") |
| @@ -681,12 +684,17 @@ expression, LIMIT is the position specifying the end of header.") | |||
| 681 | 684 | ||
| 682 | (defvar rmail-mime-feature 'rmailmm | 685 | (defvar rmail-mime-feature 'rmailmm |
| 683 | "Feature to require for MIME support in Rmail. | 686 | "Feature to require for MIME support in Rmail. |
| 684 | When starting Rmail, if `rmail-enable-mime' is non-nil, | 687 | When starting Rmail, if `rmail-enable-mime' is non-nil, this |
| 685 | this feature is required with `require'. | 688 | feature is loaded with `require'. The default value is `rmailmm'. |
| 686 | 689 | ||
| 687 | The default value is `rmailmm'") | 690 | The library should set the variable `rmail-show-mime-function' |
| 691 | to an appropriate value, and optionally also set | ||
| 692 | `rmail-search-mime-message-function', | ||
| 693 | `rmail-search-mime-header-function', | ||
| 694 | `rmail-insert-mime-forwarded-message-function', and | ||
| 695 | `rmail-insert-mime-resent-message-function'.") | ||
| 688 | 696 | ||
| 689 | ;; FIXME this is unused. | 697 | ;; FIXME this is unused since 23.1. |
| 690 | (defvar rmail-decode-mime-charset t | 698 | (defvar rmail-decode-mime-charset t |
| 691 | "*Non-nil means a message is decoded by MIME's charset specification. | 699 | "*Non-nil means a message is decoded by MIME's charset specification. |
| 692 | If this variable is nil, or the message has not MIME specification, | 700 | If this variable is nil, or the message has not MIME specification, |
| @@ -696,6 +704,9 @@ If the variable `rmail-enable-mime' is non-nil, this variable is | |||
| 696 | ignored, and all the decoding work is done by a feature specified by | 704 | ignored, and all the decoding work is done by a feature specified by |
| 697 | the variable `rmail-mime-feature'.") | 705 | the variable `rmail-mime-feature'.") |
| 698 | 706 | ||
| 707 | (make-obsolete-variable 'rmail-decode-mime-charset | ||
| 708 | "it does nothing." "23.1") | ||
| 709 | |||
| 699 | (defvar rmail-mime-charset-pattern | 710 | (defvar rmail-mime-charset-pattern |
| 700 | (concat "^content-type:[ \t]*text/plain;" | 711 | (concat "^content-type:[ \t]*text/plain;" |
| 701 | "\\(?:[ \t\n]*\\(?:format\\|delsp\\)=\"?[-a-z0-9]+\"?;\\)*" | 712 | "\\(?:[ \t\n]*\\(?:format\\|delsp\\)=\"?[-a-z0-9]+\"?;\\)*" |
| @@ -3128,10 +3139,9 @@ but probably is garbage." | |||
| 3128 | ;; This is adequate because its only caller, rmail-search, | 3139 | ;; This is adequate because its only caller, rmail-search, |
| 3129 | ;; unswaps the buffers. | 3140 | ;; unswaps the buffers. |
| 3130 | (goto-char (rmail-msgbeg msg)) | 3141 | (goto-char (rmail-msgbeg msg)) |
| 3131 | (if rmail-enable-mime | 3142 | (if (and rmail-enable-mime |
| 3132 | (if rmail-search-mime-message-function | 3143 | rmail-search-mime-message-function) |
| 3133 | (funcall rmail-search-mime-message-function msg regexp) | 3144 | (funcall rmail-search-mime-message-function msg regexp) |
| 3134 | (error "You must set `rmail-search-mime-message-function'")) | ||
| 3135 | (re-search-forward regexp (rmail-msgend msg) t))) | 3145 | (re-search-forward regexp (rmail-msgend msg) t))) |
| 3136 | 3146 | ||
| 3137 | (defvar rmail-search-last-regexp nil) | 3147 | (defvar rmail-search-last-regexp nil) |
| @@ -3798,7 +3808,8 @@ see the documentation of `rmail-resend'." | |||
| 3798 | ;; Insert after header separator--before signature if any. | 3808 | ;; Insert after header separator--before signature if any. |
| 3799 | (rfc822-goto-eoh) | 3809 | (rfc822-goto-eoh) |
| 3800 | (forward-line 1) | 3810 | (forward-line 1) |
| 3801 | (if (and rmail-enable-mime rmail-enable-mime-composing) | 3811 | (if (and rmail-enable-mime rmail-enable-mime-composing |
| 3812 | rmail-insert-mime-forwarded-message-function) | ||
| 3802 | (prog1 | 3813 | (prog1 |
| 3803 | (funcall rmail-insert-mime-forwarded-message-function | 3814 | (funcall rmail-insert-mime-forwarded-message-function |
| 3804 | forward-buffer) | 3815 | forward-buffer) |
| @@ -3854,10 +3865,9 @@ typically for purposes of moderating a list." | |||
| 3854 | (unwind-protect | 3865 | (unwind-protect |
| 3855 | (with-current-buffer tembuf | 3866 | (with-current-buffer tembuf |
| 3856 | ;;>> Copy message into temp buffer | 3867 | ;;>> Copy message into temp buffer |
| 3857 | (if rmail-enable-mime | 3868 | (if (and rmail-enable-mime |
| 3858 | (if rmail-insert-mime-resent-message-function | 3869 | rmail-insert-mime-resent-message-function) |
| 3859 | (funcall rmail-insert-mime-resent-message-function mailbuf) | 3870 | (funcall rmail-insert-mime-resent-message-function mailbuf) |
| 3860 | (error "You must set `rmail-insert-mime-resent-message-function'")) | ||
| 3861 | (insert-buffer-substring mailbuf)) | 3871 | (insert-buffer-substring mailbuf)) |
| 3862 | (goto-char (point-min)) | 3872 | (goto-char (point-min)) |
| 3863 | ;; Delete any Sender field, since that's not specifiable. | 3873 | ;; Delete any Sender field, since that's not specifiable. |
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index a3f722443dc..e6a0a34f33b 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el | |||
| @@ -342,10 +342,9 @@ Emacs will list the message in the summary." | |||
| 342 | (defun rmail-message-regexp-p-1 (msg regexp) | 342 | (defun rmail-message-regexp-p-1 (msg regexp) |
| 343 | ;; Search functions can expect to start from the beginning. | 343 | ;; Search functions can expect to start from the beginning. |
| 344 | (narrow-to-region (point) (save-excursion (search-forward "\n\n") (point))) | 344 | (narrow-to-region (point) (save-excursion (search-forward "\n\n") (point))) |
| 345 | (if rmail-enable-mime | 345 | (if (and rmail-enable-mime |
| 346 | (if rmail-search-mime-header-function | 346 | rmail-search-mime-header-function) |
| 347 | (funcall rmail-search-mime-header-function msg regexp (point)) | 347 | (funcall rmail-search-mime-header-function msg regexp (point)) |
| 348 | (error "You must set `rmail-search-mime-header-function'")) | ||
| 349 | (re-search-forward regexp nil t))) | 348 | (re-search-forward regexp nil t))) |
| 350 | 349 | ||
| 351 | ;;;###autoload | 350 | ;;;###autoload |