aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2011-05-23 20:54:18 -0700
committerGlenn Morris2011-05-23 20:54:18 -0700
commitdb0406bb64f7e5dceeb257c7e350f1e80ed9c1c1 (patch)
tree545e8024b913be01e1fb8cdab2a41a9db48dfc71
parent1c728a9d3c737cf0ed0344398363c6dd0769bc4f (diff)
parentb8d747b9bd6e8278349aa7faaf4bbbf0b9ce24db (diff)
downloademacs-db0406bb64f7e5dceeb257c7e350f1e80ed9c1c1.tar.gz
emacs-db0406bb64f7e5dceeb257c7e350f1e80ed9c1c1.zip
Merge from emacs-23; up to 2010-06-11T21:26:13Z!lekktu@gmail.com.
-rw-r--r--lisp/ChangeLog16
-rw-r--r--lisp/mail/sendmail.el25
-rw-r--r--lisp/mail/smtpmail.el2
-rw-r--r--lisp/mail/supercite.el4
4 files changed, 43 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index cdc2d65ebda..e9e7faa93d4 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,19 @@
12011-05-24 Kenichi Handa <handa@m17n.org>
2
3 * mail/sendmail.el: Require `rfc2047'.
4 (mail-insert-from-field): Do not perform RFC2047 encoding.
5 (mail-encode-header): New function.
6 (sendmail-send-it): Set buffer-file-coding-system of the work
7 buffer to the return value of select-message-coding-system. Call
8 mail-encode-header.
9
10 * mail/smtpmail.el (smtpmail-send-it): Call mail-encode-header.
11
122011-05-24 Sean Neakums <sneakums@zork.net> (tiny change)
13
14 * mail/supercite.el (sc-default-cite-frame): Handle
15 sc-nested-citation-p when sc-cite-blank-lines-p is non-nil.
16
12011-05-24 Glenn Morris <rgm@gnu.org> 172011-05-24 Glenn Morris <rgm@gnu.org>
2 18
3 * progmodes/python.el (brm-menu): Declare. 19 * progmodes/python.el (brm-menu): Declare.
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index cfacf5fad55..c6cd4c75ebd 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -29,7 +29,7 @@
29;;; Code: 29;;; Code:
30(require 'mail-utils) 30(require 'mail-utils)
31 31
32(autoload 'rfc2047-encode-string "rfc2047") 32(require 'rfc2047)
33 33
34(defgroup sendmail nil 34(defgroup sendmail nil
35 "Mail sending commands for Emacs." 35 "Mail sending commands for Emacs."
@@ -945,12 +945,14 @@ of outgoing mails regardless of the current language environment.
945See also the function `select-message-coding-system'.") 945See also the function `select-message-coding-system'.")
946 946
947(defun mail-insert-from-field () 947(defun mail-insert-from-field ()
948 "Insert the \"From:\" field of a mail header.
949The style of the field is determined by the variable `mail-from-style'.
950This function does not perform RFC2047 encoding."
948 (let* ((login user-mail-address) 951 (let* ((login user-mail-address)
949 (fullname (user-full-name)) 952 (fullname (user-full-name))
950 (quote-fullname nil)) 953 (quote-fullname nil))
951 (if (string-match "[^\0-\177]" fullname) 954 (if (string-match "[^\0-\177]" fullname)
952 (setq fullname (rfc2047-encode-string fullname) 955 (setq quote-fullname t))
953 quote-fullname t))
954 (cond ((null mail-from-style) 956 (cond ((null mail-from-style)
955 (insert "From: " login "\n")) 957 (insert "From: " login "\n"))
956 ;; This is deprecated. 958 ;; This is deprecated.
@@ -1010,6 +1012,20 @@ See also the function `select-message-coding-system'.")
1010 (goto-char fullname-start)))) 1012 (goto-char fullname-start))))
1011 (insert ")\n"))))) 1013 (insert ")\n")))))
1012 1014
1015(defun mail-encode-header (beg end)
1016 "Encode the mail header between BEG and END according to RFC2047.
1017Return non-nil if and only if some part of the header is encoded."
1018 (save-restriction
1019 (narrow-to-region beg end)
1020 (let* ((selected (select-message-coding-system))
1021 (mm-coding-system-priorities
1022 (if (and selected (coding-system-get selected :mime-charset))
1023 (cons selected mm-coding-system-priorities)
1024 mm-coding-system-priorities))
1025 (tick (buffer-chars-modified-tick)))
1026 (rfc2047-encode-message-header)
1027 (= tick (buffer-chars-modified-tick)))))
1028
1013;; Normally you will not need to modify these options unless you are 1029;; Normally you will not need to modify these options unless you are
1014;; using some non-genuine substitute for sendmail which does not 1030;; using some non-genuine substitute for sendmail which does not
1015;; implement each and every option that the original supports. 1031;; implement each and every option that the original supports.
@@ -1050,6 +1066,7 @@ external program defined by `sendmail-program'."
1050 (unless multibyte 1066 (unless multibyte
1051 (set-buffer-multibyte nil)) 1067 (set-buffer-multibyte nil))
1052 (insert-buffer-substring mailbuf) 1068 (insert-buffer-substring mailbuf)
1069 (set-buffer-file-coding-system selected-coding)
1053 (goto-char (point-max)) 1070 (goto-char (point-max))
1054 ;; require one newline at the end. 1071 ;; require one newline at the end.
1055 (or (= (preceding-char) ?\n) 1072 (or (= (preceding-char) ?\n)
@@ -1155,6 +1172,8 @@ external program defined by `sendmail-program'."
1155 (if mail-interactive 1172 (if mail-interactive
1156 (with-current-buffer errbuf 1173 (with-current-buffer errbuf
1157 (erase-buffer)))) 1174 (erase-buffer))))
1175 ;; Encode the header according to RFC2047.
1176 (mail-encode-header (point-min) delimline)
1158 (goto-char (point-min)) 1177 (goto-char (point-min))
1159 (if (let ((case-fold-search t)) 1178 (if (let ((case-fold-search t))
1160 (or resend-to-addresses 1179 (or resend-to-addresses
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index 427d9d17746..3eda3503adc 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -361,6 +361,8 @@ The list is in preference order.")
361 (if mail-interactive 361 (if mail-interactive
362 (with-current-buffer errbuf 362 (with-current-buffer errbuf
363 (erase-buffer)))) 363 (erase-buffer))))
364 ;; Encode the header according to RFC2047.
365 (mail-encode-header (point-min) delimline)
364 ;; 366 ;;
365 (setq smtpmail-address-buffer (generate-new-buffer "*smtp-mail*")) 367 (setq smtpmail-address-buffer (generate-new-buffer "*smtp-mail*"))
366 (setq smtpmail-recipient-address-list 368 (setq smtpmail-recipient-address-list
diff --git a/lisp/mail/supercite.el b/lisp/mail/supercite.el
index 084b623080a..3d754c08f83 100644
--- a/lisp/mail/supercite.el
+++ b/lisp/mail/supercite.el
@@ -184,7 +184,9 @@ See the variable `sc-cite-frame-alist' for details."
184 ;; paragraph, unless sc-cite-blank-lines-p is non-nil, in which 184 ;; paragraph, unless sc-cite-blank-lines-p is non-nil, in which
185 ;; case we treat blank lines just like any other line. 185 ;; case we treat blank lines just like any other line.
186 ("^[ \t]*$" (if sc-cite-blank-lines-p 186 ("^[ \t]*$" (if sc-cite-blank-lines-p
187 (sc-cite-line) 187 (if sc-nested-citation-p
188 (sc-add-citation-level)
189 (sc-cite-line))
188 (sc-fill-if-different ""))) 190 (sc-fill-if-different "")))
189 ;; do nothing if looking at a reference tag. make sure that the 191 ;; do nothing if looking at a reference tag. make sure that the
190 ;; tag string isn't the empty string since this will match every 192 ;; tag string isn't the empty string since this will match every