diff options
| author | Juanma Barranquero | 2006-02-02 12:04:23 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2006-02-02 12:04:23 +0000 |
| commit | 3db4118f6c453455a30366a6f44cecbe71e3ff6d (patch) | |
| tree | 661ddbdee32f125ccae263e738dc5e3b0d9a7b3c | |
| parent | d33544d3796f2b63df17299ebdaca3481c14e32d (diff) | |
| download | emacs-3db4118f6c453455a30366a6f44cecbe71e3ff6d.tar.gz emacs-3db4118f6c453455a30366a6f44cecbe71e3ff6d.zip | |
(mailclient-place-body-on-clipboard-flag): Fix typo in docstring.
| -rw-r--r-- | lisp/mail/mailclient.el | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/lisp/mail/mailclient.el b/lisp/mail/mailclient.el index eb12d97f576..45afbd782d9 100644 --- a/lisp/mail/mailclient.el +++ b/lisp/mail/mailclient.el | |||
| @@ -24,21 +24,21 @@ | |||
| 24 | 24 | ||
| 25 | ;;; Commentary: | 25 | ;;; Commentary: |
| 26 | 26 | ||
| 27 | ;; This package allows to hand over a buffer to be sent off | 27 | ;; This package allows to hand over a buffer to be sent off |
| 28 | ;; via the system's designated e-mail client. | 28 | ;; via the system's designated e-mail client. |
| 29 | ;; Note that the e-mail client will display the contents of the buffer | 29 | ;; Note that the e-mail client will display the contents of the buffer |
| 30 | ;; again for editing. | 30 | ;; again for editing. |
| 31 | ;; The e-mail client is taken to be whoever handles a mailto: URL | 31 | ;; The e-mail client is taken to be whoever handles a mailto: URL |
| 32 | ;; via `browse-url'. | 32 | ;; via `browse-url'. |
| 33 | ;; Mailto: URLs are composed according to RFC2368. | 33 | ;; Mailto: URLs are composed according to RFC2368. |
| 34 | 34 | ||
| 35 | ;; MIME bodies are not supported - we rather expect the mail client | 35 | ;; MIME bodies are not supported - we rather expect the mail client |
| 36 | ;; to encode the body and add, for example, a digital signature. | 36 | ;; to encode the body and add, for example, a digital signature. |
| 37 | ;; The mailto URL RFC calls for "short text messages that are | 37 | ;; The mailto URL RFC calls for "short text messages that are |
| 38 | ;; actually the content of automatic processing." | 38 | ;; actually the content of automatic processing." |
| 39 | ;; So mailclient.el is ideal for situations where an e-mail is | 39 | ;; So mailclient.el is ideal for situations where an e-mail is |
| 40 | ;; generated automatically, and the user can edit it in the | 40 | ;; generated automatically, and the user can edit it in the |
| 41 | ;; mail client (e.g. bug-reports). | 41 | ;; mail client (e.g. bug-reports). |
| 42 | 42 | ||
| 43 | ;; To activate: | 43 | ;; To activate: |
| 44 | ;; (setq send-mail-function 'mailclient-send-it) ; if you use `mail' | 44 | ;; (setq send-mail-function 'mailclient-send-it) ; if you use `mail' |
| @@ -49,11 +49,11 @@ | |||
| 49 | (require 'sendmail) ;; for mail-sendmail-undelimit-header | 49 | (require 'sendmail) ;; for mail-sendmail-undelimit-header |
| 50 | (require 'mail-utils) ;; for mail-fetch-field | 50 | (require 'mail-utils) ;; for mail-fetch-field |
| 51 | 51 | ||
| 52 | (defcustom mailclient-place-body-on-clipboard-flag | 52 | (defcustom mailclient-place-body-on-clipboard-flag |
| 53 | (fboundp 'w32-set-clipboard-data) | 53 | (fboundp 'w32-set-clipboard-data) |
| 54 | "If non-nil, put the e-mail body on the clipboard in mailclient. | 54 | "If non-nil, put the e-mail body on the clipboard in mailclient. |
| 55 | This is useful on systems where only short mailto:// URLs are | 55 | This is useful on systems where only short mailto:// URLs are |
| 56 | supported. Defaults to non-nil on Windows, nil otherwise." | 56 | supported. Defaults to non-nil on Windows, nil otherwise." |
| 57 | :type 'boolean | 57 | :type 'boolean |
| 58 | :group 'mail) | 58 | :group 'mail) |
| 59 | 59 | ||
| @@ -64,7 +64,7 @@ supported. Defaults to non-nil on Windows, nil otherwise." | |||
| 64 | (lambda (char) | 64 | (lambda (char) |
| 65 | (cond | 65 | (cond |
| 66 | ((eq char ?\x20) "%20") ;; space | 66 | ((eq char ?\x20) "%20") ;; space |
| 67 | ((eq char ?\n) "%0D%0A") ;; newline | 67 | ((eq char ?\n) "%0D%0A") ;; newline |
| 68 | ((string-match "[-a-zA-Z0-9_:/.@]" (char-to-string char)) | 68 | ((string-match "[-a-zA-Z0-9_:/.@]" (char-to-string char)) |
| 69 | (char-to-string char)) ;; printable | 69 | (char-to-string char)) ;; printable |
| 70 | (t ;; everything else | 70 | (t ;; everything else |
| @@ -75,33 +75,33 @@ supported. Defaults to non-nil on Windows, nil otherwise." | |||
| 75 | (defvar mailclient-delim-static "?") | 75 | (defvar mailclient-delim-static "?") |
| 76 | (defun mailclient-url-delim () | 76 | (defun mailclient-url-delim () |
| 77 | (let ((current mailclient-delim-static)) | 77 | (let ((current mailclient-delim-static)) |
| 78 | (setq mailclient-delim-static "&") | 78 | (setq mailclient-delim-static "&") |
| 79 | current)) | 79 | current)) |
| 80 | 80 | ||
| 81 | (defun mailclient-gather-addresses (str &optional drop-first-name) | 81 | (defun mailclient-gather-addresses (str &optional drop-first-name) |
| 82 | (let ((field (mail-fetch-field str nil t))) | 82 | (let ((field (mail-fetch-field str nil t))) |
| 83 | (if field | 83 | (if field |
| 84 | (save-excursion | 84 | (save-excursion |
| 85 | (let ((first t) | 85 | (let ((first t) |
| 86 | (result "")) | 86 | (result "")) |
| 87 | (mapc | 87 | (mapc |
| 88 | (lambda (recp) | 88 | (lambda (recp) |
| 89 | (setq result | 89 | (setq result |
| 90 | (concat | 90 | (concat |
| 91 | result | 91 | result |
| 92 | (if (and drop-first-name | 92 | (if (and drop-first-name |
| 93 | first) | 93 | first) |
| 94 | "" | 94 | "" |
| 95 | (concat (mailclient-url-delim) str "=")) | 95 | (concat (mailclient-url-delim) str "=")) |
| 96 | (mailclient-encode-string-as-url | 96 | (mailclient-encode-string-as-url |
| 97 | recp))) | 97 | recp))) |
| 98 | (setq first nil)) | 98 | (setq first nil)) |
| 99 | (split-string | 99 | (split-string |
| 100 | (mail-strip-quoted-names field) "\, *")) | 100 | (mail-strip-quoted-names field) "\, *")) |
| 101 | result))))) | 101 | result))))) |
| 102 | 102 | ||
| 103 | ;;;###autoload | 103 | ;;;###autoload |
| 104 | (defun mailclient-send-it () | 104 | (defun mailclient-send-it () |
| 105 | "Pass current buffer on to the system's mail client. | 105 | "Pass current buffer on to the system's mail client. |
| 106 | Suitable value for `send-mail-function'. | 106 | Suitable value for `send-mail-function'. |
| 107 | The mail client is taken to be the handler of mailto URLs." | 107 | The mail client is taken to be the handler of mailto URLs." |
| @@ -122,19 +122,19 @@ The mail client is taken to be the handler of mailto URLs." | |||
| 122 | (while (and (re-search-forward "\n\n\n*" delimline t) | 122 | (while (and (re-search-forward "\n\n\n*" delimline t) |
| 123 | (< (point) delimline)) | 123 | (< (point) delimline)) |
| 124 | (replace-match "\n")) | 124 | (replace-match "\n")) |
| 125 | (let ((case-fold-search t)) | 125 | (let ((case-fold-search t)) |
| 126 | ;; initialize limiter | 126 | ;; initialize limiter |
| 127 | (setq mailclient-delim-static "?") | 127 | (setq mailclient-delim-static "?") |
| 128 | ;; construct and call up mailto URL | 128 | ;; construct and call up mailto URL |
| 129 | (browse-url | 129 | (browse-url |
| 130 | (concat | 130 | (concat |
| 131 | (save-excursion | 131 | (save-excursion |
| 132 | (narrow-to-region (point-min) delimline) | 132 | (narrow-to-region (point-min) delimline) |
| 133 | (concat | 133 | (concat |
| 134 | "mailto:" | 134 | "mailto:" |
| 135 | ;; some of the headers according to RFC822 | 135 | ;; some of the headers according to RFC822 |
| 136 | (mailclient-gather-addresses "To" | 136 | (mailclient-gather-addresses "To" |
| 137 | 'drop-first-name) | 137 | 'drop-first-name) |
| 138 | (mailclient-gather-addresses "cc" ) | 138 | (mailclient-gather-addresses "cc" ) |
| 139 | (mailclient-gather-addresses "bcc" ) | 139 | (mailclient-gather-addresses "bcc" ) |
| 140 | (mailclient-gather-addresses "Resent-To" ) | 140 | (mailclient-gather-addresses "Resent-To" ) |
| @@ -151,16 +151,16 @@ The mail client is taken to be the handler of mailto URLs." | |||
| 151 | (if subj ;; if non-blank | 151 | (if subj ;; if non-blank |
| 152 | ;; the mail client will deal with | 152 | ;; the mail client will deal with |
| 153 | ;; warning the user etc. | 153 | ;; warning the user etc. |
| 154 | (concat (mailclient-url-delim) "subject=" | 154 | (concat (mailclient-url-delim) "subject=" |
| 155 | (mailclient-encode-string-as-url subj)) | 155 | (mailclient-encode-string-as-url subj)) |
| 156 | "")))) | 156 | "")))) |
| 157 | ;; body | 157 | ;; body |
| 158 | (concat | 158 | (concat |
| 159 | (mailclient-url-delim) "body=" | 159 | (mailclient-url-delim) "body=" |
| 160 | (mailclient-encode-string-as-url | 160 | (mailclient-encode-string-as-url |
| 161 | (if mailclient-place-body-on-clipboard-flag | 161 | (if mailclient-place-body-on-clipboard-flag |
| 162 | (progn | 162 | (progn |
| 163 | (clipboard-kill-ring-save | 163 | (clipboard-kill-ring-save |
| 164 | (+ 1 delimline) (point-max)) | 164 | (+ 1 delimline) (point-max)) |
| 165 | (concat | 165 | (concat |
| 166 | "*** E-Mail body has been placed on clipboard, " | 166 | "*** E-Mail body has been placed on clipboard, " |