aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2009-01-10 23:18:08 +0000
committerRichard M. Stallman2009-01-10 23:18:08 +0000
commit367aa646a557914c550956fe0e736a5a5244d4b1 (patch)
tree819e15840d4be5a09c95ff21778e929648945002
parent841a91fe0d1a6367b42b99ff3dc6246f08fe40e3 (diff)
downloademacs-367aa646a557914c550956fe0e736a5a5244d4b1.tar.gz
emacs-367aa646a557914c550956fe0e736a5a5244d4b1.zip
(mail-quote-printable-region): New function.
-rw-r--r--lisp/mail/mail-utils.el20
1 files changed, 20 insertions, 0 deletions
diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el
index 9d7bea7807b..f939f19d06c 100644
--- a/lisp/mail/mail-utils.el
+++ b/lisp/mail/mail-utils.el
@@ -77,6 +77,26 @@ we add the wrapper characters =?ISO-8859-1?Q?....?=."
77 "?=") 77 "?=")
78 (concat result (substring string i)))))) 78 (concat result (substring string i))))))
79 79
80;;;###autoload
81(defun mail-quote-printable-region (beg end &optional wrapper)
82 "Convert the region to the \"quoted printable\" Q encoding.
83If the optional argument WRAPPER is non-nil,
84we add the wrapper characters =?ISO-8859-1?Q?....?=."
85 (interactive "r\nP")
86 (save-match-data
87 (save-excursion
88 (goto-char beg)
89 (save-restriction
90 (narrow-to-region beg end)
91 (while (re-search-forward "[?=\"\200-\377]" nil t)
92 (replace-match (upcase (format "=%02x" (preceding-char)))
93 t t))
94 (when wrapper
95 (goto-char beg)
96 (insert "=?ISO-8859-1?Q?")
97 (goto-char end)
98 (insert "?="))))))
99
80(defun mail-unquote-printable-hexdigit (char) 100(defun mail-unquote-printable-hexdigit (char)
81 (setq char (upcase char)) 101 (setq char (upcase char))
82 (if (>= char ?A) 102 (if (>= char ?A)