aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2009-11-19 16:48:30 +0000
committerChong Yidong2009-11-19 16:48:30 +0000
commit0b8ee42164cc45691ad14f67055a3d41b7d40e78 (patch)
tree80f5a9659e06a036b05732cee8097d1c0c72f514
parent4332f3eceacc4da828801cd366a4d219f3befa6b (diff)
downloademacs-0b8ee42164cc45691ad14f67055a3d41b7d40e78.tar.gz
emacs-0b8ee42164cc45691ad14f67055a3d41b7d40e78.zip
* mail/sendmail.el (mail-yank-prefix): Change default to "> ".
(mail-signature): Change default to t. (mail-from-style): Deprecate `system-default' value. (mail-insert-from-field): For default value of mail-from-style, default to `angles' unless `angles' needs quoting and `parens' does not. (mail-citation-prefix-regexp): Use citation regexp from message-mode.
-rw-r--r--lisp/ChangeLog11
-rw-r--r--lisp/mail/sendmail.el52
2 files changed, 42 insertions, 21 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c7525de9c73..ee53e709a1e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,14 @@
12009-11-19 Chong Yidong <cyd@stupidchicken.com>
2
3 * mail/sendmail.el (mail-yank-prefix): Change default to "> ".
4 (mail-signature): Change default to t.
5 (mail-from-style): Deprecate `system-default' value.
6 (mail-insert-from-field): For default value of mail-from-style,
7 default to `angles' unless `angles' needs quoting and `parens'
8 does not.
9 (mail-citation-prefix-regexp): Use citation regexp from
10 message-mode.
11
12009-11-19 Michael Albinus <michael.albinus@gmx.de> 122009-11-19 Michael Albinus <michael.albinus@gmx.de>
2 13
3 * net/tramp.el (tramp-do-copy-or-rename-file-out-of-band): Set 14 * net/tramp.el (tramp-do-copy-or-rename-file-out-of-band): Set
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 34d5f4af7a5..59cd70aa578 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -58,7 +58,7 @@
58 :type 'file) 58 :type 'file)
59 59
60;;;###autoload 60;;;###autoload
61(defcustom mail-from-style 'angles 61(defcustom mail-from-style 'default
62 "Specifies how \"From:\" fields look. 62 "Specifies how \"From:\" fields look.
63 63
64If `nil', they contain just the return address like: 64If `nil', they contain just the return address like:
@@ -67,15 +67,14 @@ If `parens', they look like:
67 king@grassland.com (Elvis Parsley) 67 king@grassland.com (Elvis Parsley)
68If `angles', they look like: 68If `angles', they look like:
69 Elvis Parsley <king@grassland.com> 69 Elvis Parsley <king@grassland.com>
70If `system-default', allows the mailer to insert its default From field 70
71derived from the envelope-from address. 71Otherwise, most addresses look like `angles', but they look like
72 72`parens' if `angles' would need quoting and `parens' would not."
73In old versions of Emacs, the `system-default' setting also caused 73 ;; The value `system-default' is now deprecated.
74Emacs to pass the proper email address from `user-mail-address' 74 :type '(choice (const :tag "simple" nil)
75to the mailer to specify the envelope-from address. But that is now 75 (const parens)
76controlled by a separate variable, `mail-specify-envelope-from'." 76 (const angles)
77 :type '(choice (const nil) (const parens) (const angles) 77 (const default))
78 (const system-default))
79 :version "20.3" 78 :version "20.3"
80 :group 'sendmail) 79 :group 'sendmail)
81 80
@@ -241,7 +240,7 @@ The alias definitions in the file have this form:
241 "The modification time of your mail alias file when it was last examined.") 240 "The modification time of your mail alias file when it was last examined.")
242 241
243;;;###autoload 242;;;###autoload
244(defcustom mail-yank-prefix nil 243(defcustom mail-yank-prefix "> "
245 "Prefix insert on lines of yanked message being replied to. 244 "Prefix insert on lines of yanked message being replied to.
246If this is nil, use indentation, as specified by `mail-indentation-spaces'." 245If this is nil, use indentation, as specified by `mail-indentation-spaces'."
247 :type '(choice (const nil) string) 246 :type '(choice (const nil) string)
@@ -284,7 +283,8 @@ This enables the hook functions to see the whole message header
284regardless of what part of it (if any) is included in the cited text.") 283regardless of what part of it (if any) is included in the cited text.")
285 284
286;;;###autoload 285;;;###autoload
287(defcustom mail-citation-prefix-regexp (purecopy "[ \t]*[-a-z0-9A-Z]*>+[ \t]*\\|[ \t]*") 286(defcustom mail-citation-prefix-regexp
287 (purecopy "\\([ \t]*\\(\\w\\|[_.]\\)+>+\\|[ \t]*[]>|}]\\)+")
288 "Regular expression to match a citation prefix plus whitespace. 288 "Regular expression to match a citation prefix plus whitespace.
289It should match whatever sort of citation prefixes you want to handle, 289It should match whatever sort of citation prefixes you want to handle,
290with whitespace before and after; it should also match just whitespace. 290with whitespace before and after; it should also match just whitespace.
@@ -393,7 +393,7 @@ removed from alias expansions."
393 nil) 393 nil)
394 394
395;;;###autoload 395;;;###autoload
396(defcustom mail-signature nil 396(defcustom mail-signature t
397 "Text inserted at end of mail buffer when a message is initialized. 397 "Text inserted at end of mail buffer when a message is initialized.
398If t, it means to insert the contents of the file `mail-signature-file'. 398If t, it means to insert the contents of the file `mail-signature-file'.
399If a string, that string is inserted. 399If a string, that string is inserted.
@@ -955,7 +955,21 @@ See also the function `select-message-coding-system'.")
955 (if (string-match "[^\0-\177]" fullname) 955 (if (string-match "[^\0-\177]" fullname)
956 (setq fullname (rfc2047-encode-string fullname) 956 (setq fullname (rfc2047-encode-string fullname)
957 quote-fullname t)) 957 quote-fullname t))
958 (cond ((eq mail-from-style 'angles) 958 (cond ((null mail-from-style)
959 (insert "From: " login "\n"))
960 ;; This is deprecated.
961 ((eq mail-from-style 'system-default)
962 nil)
963 ((or (eq mail-from-style 'angles)
964 (and (not (eq mail-from-style 'parens))
965 ;; Use angles if no quoting is needed, or if
966 ;; parens would need quoting too.
967 (or (not (string-match "[^- !#-'*+/-9=?A-Z^-~]" fullname))
968 (let ((tmp (concat fullname nil)))
969 (while (string-match "([^()]*)" tmp)
970 (aset tmp (match-beginning 0) ?-)
971 (aset tmp (1- (match-end 0)) ?-))
972 (string-match "[\\()]" tmp)))))
959 (insert "From: " fullname) 973 (insert "From: " fullname)
960 (let ((fullname-start (+ (point-min) 6)) 974 (let ((fullname-start (+ (point-min) 6))
961 (fullname-end (point-marker))) 975 (fullname-end (point-marker)))
@@ -974,7 +988,8 @@ See also the function `select-message-coding-system'.")
974 (replace-match "\\\\\\&" t)) 988 (replace-match "\\\\\\&" t))
975 (insert "\"")))) 989 (insert "\""))))
976 (insert " <" login ">\n")) 990 (insert " <" login ">\n"))
977 ((eq mail-from-style 'parens) 991 ;; 'parens or default
992 (t
978 (insert "From: " login " (") 993 (insert "From: " login " (")
979 (let ((fullname-start (point))) 994 (let ((fullname-start (point)))
980 (if quote-fullname 995 (if quote-fullname
@@ -997,12 +1012,7 @@ See also the function `select-message-coding-system'.")
997 fullname-end 1) 1012 fullname-end 1)
998 (replace-match "\\1(\\3)" t) 1013 (replace-match "\\1(\\3)" t)
999 (goto-char fullname-start)))) 1014 (goto-char fullname-start))))
1000 (insert ")\n")) 1015 (insert ")\n")))))
1001 ((null mail-from-style)
1002 (insert "From: " login "\n"))
1003 ((eq mail-from-style 'system-default)
1004 nil)
1005 (t (error "Invalid value for `mail-from-style'")))))
1006 1016
1007;; Normally you will not need to modify these options unless you are 1017;; Normally you will not need to modify these options unless you are
1008;; using some non-genuine substitute for sendmail which does not 1018;; using some non-genuine substitute for sendmail which does not