Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
7dad528a
Commit
7dad528a
authored
Jul 01, 1995
by
Richard M. Stallman
Browse files
(sendmail-send-it): If mail-from-style is parens,
don't escape all parentheses; escape only the nonmatching ones.
parent
b0d77652
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
lisp/mail/sendmail.el
lisp/mail/sendmail.el
+18
-6
No files found.
lisp/mail/sendmail.el
View file @
7dad528a
...
...
@@ -537,12 +537,24 @@ the user from the mailer."
(
insert
"\""
))))
(
insert
" <"
login
">\n"
))
((
eq
mail-from-style
'parens
)
(
insert
"From: "
login
" ("
fullname
)
(
let
((
fullname-end
(
point-marker
)))
(
backward-char
(
length
fullname
))
;; RFC 822 says ()\ must be escaped in comments.
(
while
(
re-search-forward
"[()\\]"
fullname-end
1
)
(
replace-match
"\\\\\\&"
t
)))
(
insert
"From: "
login
" ("
)
(
let
((
fullname-start
(
point
)))
(
insert
fullname
)
(
let
((
fullname-end
(
point-marker
)))
(
goto-char
fullname-start
)
;; RFC 822 says \ and nonmatching parentheses
;; must be escaped in comments.
;; Escape every instance of ()\ ...
(
while
(
re-search-forward
"[()\\]"
fullname-end
1
)
(
replace-match
"\\\\\\&"
t
))
;; ... then undo escaping of matching parentheses,
;; including matching nested parentheses.
(
goto-char
fullname-start
)
(
while
(
re-search-forward
"\\(\\=\\|[^\\]\\(\\\\\\\\\\)*\\)\\\\(\\(\\([^\\]\\|\\\\\\\\\\)*\\)\\\\)"
fullname-end
1
)
(
replace-match
"\\1(\\3)"
t
)
(
goto-char
fullname-start
))))
(
insert
")\n"
))
((
null
mail-from-style
)
(
insert
"From: "
login
"\n"
)))))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment