diff options
| author | Richard M. Stallman | 2009-01-10 23:18:08 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2009-01-10 23:18:08 +0000 |
| commit | 367aa646a557914c550956fe0e736a5a5244d4b1 (patch) | |
| tree | 819e15840d4be5a09c95ff21778e929648945002 | |
| parent | 841a91fe0d1a6367b42b99ff3dc6246f08fe40e3 (diff) | |
| download | emacs-367aa646a557914c550956fe0e736a5a5244d4b1.tar.gz emacs-367aa646a557914c550956fe0e736a5a5244d4b1.zip | |
(mail-quote-printable-region): New function.
| -rw-r--r-- | lisp/mail/mail-utils.el | 20 |
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. | ||
| 83 | If the optional argument WRAPPER is non-nil, | ||
| 84 | we 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) |