diff options
| author | Stefan Monnier | 2007-11-22 20:12:45 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-11-22 20:12:45 +0000 |
| commit | 82816ba1c9cff077ec6ef15cdc47a8f0b77cab52 (patch) | |
| tree | c259d20fc40327169ed436f9e62a19dd92ce26ce | |
| parent | 569c11e30659c45af971a5e02df008cb238fcaa5 (diff) | |
| download | emacs-82816ba1c9cff077ec6ef15cdc47a8f0b77cab52.tar.gz emacs-82816ba1c9cff077ec6ef15cdc47a8f0b77cab52.zip | |
(message-send-mail-function): Fix error convention.
(message-mailer-swallows-blank-line, message-send-mail-with-sendmail)
(message-widen-reply, message-send-mail, message-talkative-question)
(message-with-reply-buffer, message-generate-new-buffer-clone-locals)
(message-clone-locals, message-send-news): Use with-current-buffer.
(message-insert-or-toggle-importance): Remove unused var `valid'.
(message-make-references): Remove unused var `new-references'.
(message-make-mail-followup-to): Remove unused var `subscribed-lists'.
| -rw-r--r-- | lisp/gnus/ChangeLog | 11 | ||||
| -rw-r--r-- | lisp/gnus/message.el | 47 |
2 files changed, 28 insertions, 30 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index a48a277df05..5a0b435ead8 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2007-11-22 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * message.el (message-send-mail-function): Fix error convention. | ||
| 4 | (message-mailer-swallows-blank-line, message-send-mail-with-sendmail) | ||
| 5 | (message-widen-reply, message-send-mail, message-talkative-question) | ||
| 6 | (message-with-reply-buffer, message-generate-new-buffer-clone-locals) | ||
| 7 | (message-clone-locals, message-send-news): Use with-current-buffer. | ||
| 8 | (message-insert-or-toggle-importance): Remove unused var `valid'. | ||
| 9 | (message-make-references): Remove unused var `new-references'. | ||
| 10 | (message-make-mail-followup-to): Remove unused var `subscribed-lists'. | ||
| 11 | |||
| 1 | 2007-11-22 Juanma Barranquero <lekktu@gmail.com> | 12 | 2007-11-22 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 13 | ||
| 3 | * spam.el (spam-find-spam, spam-enter-list): Doc fixes. | 14 | * spam.el (spam-find-spam, spam-enter-list): Doc fixes. |
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index ef49e29d2cb..33cd64ec047 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el | |||
| @@ -638,7 +638,7 @@ Done before generating the new subject of a forward." | |||
| 638 | 'message-send-mail-with-mailclient) | 638 | 'message-send-mail-with-mailclient) |
| 639 | (t | 639 | (t |
| 640 | (lambda () | 640 | (lambda () |
| 641 | (error "Don't know how to send mail. Please customize `message-send-mail-function'."))))) | 641 | (error "Don't know how to send mail. Please customize `message-send-mail-function'"))))) |
| 642 | 642 | ||
| 643 | ;; Useful to set in site-init.el | 643 | ;; Useful to set in site-init.el |
| 644 | (defcustom message-send-mail-function (message-send-mail-function) | 644 | (defcustom message-send-mail-function (message-send-mail-function) |
| @@ -1136,8 +1136,7 @@ these lines." | |||
| 1136 | (file-readable-p "/etc/sendmail.cf") | 1136 | (file-readable-p "/etc/sendmail.cf") |
| 1137 | (let ((buffer (get-buffer-create " *temp*"))) | 1137 | (let ((buffer (get-buffer-create " *temp*"))) |
| 1138 | (unwind-protect | 1138 | (unwind-protect |
| 1139 | (save-excursion | 1139 | (with-current-buffer buffer |
| 1140 | (set-buffer buffer) | ||
| 1141 | (insert-file-contents "/etc/sendmail.cf") | 1140 | (insert-file-contents "/etc/sendmail.cf") |
| 1142 | (goto-char (point-min)) | 1141 | (goto-char (point-min)) |
| 1143 | (let ((case-fold-search nil)) | 1142 | (let ((case-fold-search nil)) |
| @@ -1219,7 +1218,7 @@ If nil, you might be asked to input the charset." | |||
| 1219 | (defcustom message-dont-reply-to-names | 1218 | (defcustom message-dont-reply-to-names |
| 1220 | (and (boundp 'rmail-dont-reply-to-names) rmail-dont-reply-to-names) | 1219 | (and (boundp 'rmail-dont-reply-to-names) rmail-dont-reply-to-names) |
| 1221 | "*Addresses to prune when doing wide replies. | 1220 | "*Addresses to prune when doing wide replies. |
| 1222 | This can be a regexp or a list of regexps. Also, a value of nil means | 1221 | This can be a regexp or a list of regexps. Also, a value of nil means |
| 1223 | exclude your own user name only." | 1222 | exclude your own user name only." |
| 1224 | :version "21.1" | 1223 | :version "21.1" |
| 1225 | :group 'message | 1224 | :group 'message |
| @@ -1631,7 +1630,7 @@ functionality to work." | |||
| 1631 | 1630 | ||
| 1632 | (defcustom message-generate-hashcash (if (executable-find "hashcash") t) | 1631 | (defcustom message-generate-hashcash (if (executable-find "hashcash") t) |
| 1633 | "*Whether to generate X-Hashcash: headers. | 1632 | "*Whether to generate X-Hashcash: headers. |
| 1634 | If `t', always generate hashcash headers. If `opportunistic', | 1633 | If t, always generate hashcash headers. If `opportunistic', |
| 1635 | only generate hashcash headers if it can be done without the user | 1634 | only generate hashcash headers if it can be done without the user |
| 1636 | waiting (i.e., only asynchronously). | 1635 | waiting (i.e., only asynchronously). |
| 1637 | 1636 | ||
| @@ -1929,8 +1928,7 @@ see `message-narrow-to-headers-or-head'." | |||
| 1929 | "Evaluate FORMS in the reply buffer, if it exists." | 1928 | "Evaluate FORMS in the reply buffer, if it exists." |
| 1930 | `(when (and message-reply-buffer | 1929 | `(when (and message-reply-buffer |
| 1931 | (buffer-name message-reply-buffer)) | 1930 | (buffer-name message-reply-buffer)) |
| 1932 | (save-excursion | 1931 | (with-current-buffer message-reply-buffer |
| 1933 | (set-buffer message-reply-buffer) | ||
| 1934 | ,@forms))) | 1932 | ,@forms))) |
| 1935 | 1933 | ||
| 1936 | (put 'message-with-reply-buffer 'lisp-indent-function 0) | 1934 | (put 'message-with-reply-buffer 'lisp-indent-function 0) |
| @@ -3096,8 +3094,7 @@ or in the synonym headers, defined by `message-header-synonyms'." | |||
| 3096 | (let ((follow-to | 3094 | (let ((follow-to |
| 3097 | (and message-reply-buffer | 3095 | (and message-reply-buffer |
| 3098 | (buffer-name message-reply-buffer) | 3096 | (buffer-name message-reply-buffer) |
| 3099 | (save-excursion | 3097 | (with-current-buffer message-reply-buffer |
| 3100 | (set-buffer message-reply-buffer) | ||
| 3101 | (message-get-reply-headers t))))) | 3098 | (message-get-reply-headers t))))) |
| 3102 | (save-excursion | 3099 | (save-excursion |
| 3103 | (save-restriction | 3100 | (save-restriction |
| @@ -3349,8 +3346,7 @@ The three allowed values according to RFC 1327 are `high', `normal' | |||
| 3349 | and `low'." | 3346 | and `low'." |
| 3350 | (interactive) | 3347 | (interactive) |
| 3351 | (save-excursion | 3348 | (save-excursion |
| 3352 | (let ((valid '("high" "normal" "low")) | 3349 | (let ((new "high") |
| 3353 | (new "high") | ||
| 3354 | cur) | 3350 | cur) |
| 3355 | (save-restriction | 3351 | (save-restriction |
| 3356 | (message-narrow-to-headers) | 3352 | (message-narrow-to-headers) |
| @@ -3624,7 +3620,7 @@ Really top post? "))) | |||
| 3624 | (defun message-buffers () | 3620 | (defun message-buffers () |
| 3625 | "Return a list of active message buffers." | 3621 | "Return a list of active message buffers." |
| 3626 | (let (buffers) | 3622 | (let (buffers) |
| 3627 | (save-excursion | 3623 | (save-current-buffer |
| 3628 | (dolist (buffer (buffer-list t)) | 3624 | (dolist (buffer (buffer-list t)) |
| 3629 | (set-buffer buffer) | 3625 | (set-buffer buffer) |
| 3630 | (when (and (eq major-mode 'message-mode) | 3626 | (when (and (eq major-mode 'message-mode) |
| @@ -4314,8 +4310,7 @@ This function could be useful in `message-setup-hook'." | |||
| 4314 | ;; Let the user do all of the above. | 4310 | ;; Let the user do all of the above. |
| 4315 | (run-hooks 'message-header-hook)) | 4311 | (run-hooks 'message-header-hook)) |
| 4316 | (unwind-protect | 4312 | (unwind-protect |
| 4317 | (save-excursion | 4313 | (with-current-buffer tembuf |
| 4318 | (set-buffer tembuf) | ||
| 4319 | (erase-buffer) | 4314 | (erase-buffer) |
| 4320 | ;; Avoid copying text props (except hard newlines). | 4315 | ;; Avoid copying text props (except hard newlines). |
| 4321 | (insert (with-current-buffer mailbuf | 4316 | (insert (with-current-buffer mailbuf |
| @@ -4460,8 +4455,7 @@ If you always want Gnus to send messages in one piece, set | |||
| 4460 | (unless (or (null cpr) (and (numberp cpr) (zerop cpr))) | 4455 | (unless (or (null cpr) (and (numberp cpr) (zerop cpr))) |
| 4461 | (error "Sending...failed with exit value %d" cpr))) | 4456 | (error "Sending...failed with exit value %d" cpr))) |
| 4462 | (when message-interactive | 4457 | (when message-interactive |
| 4463 | (save-excursion | 4458 | (with-current-buffer errbuf |
| 4464 | (set-buffer errbuf) | ||
| 4465 | (goto-char (point-min)) | 4459 | (goto-char (point-min)) |
| 4466 | (while (re-search-forward "\n+ *" nil t) | 4460 | (while (re-search-forward "\n+ *" nil t) |
| 4467 | (replace-match "; ")) | 4461 | (replace-match "; ")) |
| @@ -4631,8 +4625,7 @@ Otherwise, generate and save a value for `canlock-password' first." | |||
| 4631 | (message-check-news-syntax))) | 4625 | (message-check-news-syntax))) |
| 4632 | nil | 4626 | nil |
| 4633 | (unwind-protect | 4627 | (unwind-protect |
| 4634 | (save-excursion | 4628 | (with-current-buffer tembuf |
| 4635 | (set-buffer tembuf) | ||
| 4636 | (buffer-disable-undo) | 4629 | (buffer-disable-undo) |
| 4637 | (erase-buffer) | 4630 | (erase-buffer) |
| 4638 | ;; Avoid copying text props (except hard newlines). | 4631 | ;; Avoid copying text props (except hard newlines). |
| @@ -5295,8 +5288,7 @@ In posting styles use `(\"Expires\" (make-expires-date 30))'." | |||
| 5295 | "Return the References header for this message." | 5288 | "Return the References header for this message." |
| 5296 | (when message-reply-headers | 5289 | (when message-reply-headers |
| 5297 | (let ((message-id (mail-header-message-id message-reply-headers)) | 5290 | (let ((message-id (mail-header-message-id message-reply-headers)) |
| 5298 | (references (mail-header-references message-reply-headers)) | 5291 | (references (mail-header-references message-reply-headers))) |
| 5299 | new-references) | ||
| 5300 | (if (or references message-id) | 5292 | (if (or references message-id) |
| 5301 | (concat (or references "") (and references " ") | 5293 | (concat (or references "") (and references " ") |
| 5302 | (or message-id "")) | 5294 | (or message-id "")) |
| @@ -5544,8 +5536,7 @@ subscribed address (and not the additional To and Cc header contents)." | |||
| 5544 | (mapcar 'funcall | 5536 | (mapcar 'funcall |
| 5545 | message-subscribed-address-functions)))) | 5537 | message-subscribed-address-functions)))) |
| 5546 | (save-match-data | 5538 | (save-match-data |
| 5547 | (let ((subscribed-lists nil) | 5539 | (let ((list |
| 5548 | (list | ||
| 5549 | (loop for recipient in recipients | 5540 | (loop for recipient in recipients |
| 5550 | when (loop for regexp in mft-regexps | 5541 | when (loop for regexp in mft-regexps |
| 5551 | when (string-match regexp recipient) return t) | 5542 | when (string-match regexp recipient) return t) |
| @@ -7569,9 +7560,8 @@ The following arguments may contain lists of values." | |||
| 7569 | (if (and show | 7560 | (if (and show |
| 7570 | (setq text (message-flatten-list text))) | 7561 | (setq text (message-flatten-list text))) |
| 7571 | (save-window-excursion | 7562 | (save-window-excursion |
| 7572 | (save-excursion | 7563 | (with-output-to-temp-buffer " *MESSAGE information message*" |
| 7573 | (with-output-to-temp-buffer " *MESSAGE information message*" | 7564 | (with-current-buffer " *MESSAGE information message*" |
| 7574 | (set-buffer " *MESSAGE information message*") | ||
| 7575 | (fundamental-mode) ; for Emacs 20.4+ | 7565 | (fundamental-mode) ; for Emacs 20.4+ |
| 7576 | (mapc 'princ text) | 7566 | (mapc 'princ text) |
| 7577 | (goto-char (point-min)))) | 7567 | (goto-char (point-min)))) |
| @@ -7594,16 +7584,13 @@ Then clone the local variables and values from the old buffer to the | |||
| 7594 | new one, cloning only the locals having a substring matching the | 7584 | new one, cloning only the locals having a substring matching the |
| 7595 | regexp VARSTR." | 7585 | regexp VARSTR." |
| 7596 | (let ((oldbuf (current-buffer))) | 7586 | (let ((oldbuf (current-buffer))) |
| 7597 | (save-excursion | 7587 | (with-current-buffer (generate-new-buffer name) |
| 7598 | (set-buffer (generate-new-buffer name)) | ||
| 7599 | (message-clone-locals oldbuf varstr) | 7588 | (message-clone-locals oldbuf varstr) |
| 7600 | (current-buffer)))) | 7589 | (current-buffer)))) |
| 7601 | 7590 | ||
| 7602 | (defun message-clone-locals (buffer &optional varstr) | 7591 | (defun message-clone-locals (buffer &optional varstr) |
| 7603 | "Clone the local variables from BUFFER to the current buffer." | 7592 | "Clone the local variables from BUFFER to the current buffer." |
| 7604 | (let ((locals (save-excursion | 7593 | (let ((locals (with-current-buffer buffer (buffer-local-variables))) |
| 7605 | (set-buffer buffer) | ||
| 7606 | (buffer-local-variables))) | ||
| 7607 | (regexp "^gnus\\|^nn\\|^message\\|^sendmail\\|^smtp\\|^user-mail-address")) | 7594 | (regexp "^gnus\\|^nn\\|^message\\|^sendmail\\|^smtp\\|^user-mail-address")) |
| 7608 | (mapcar | 7595 | (mapcar |
| 7609 | (lambda (local) | 7596 | (lambda (local) |