diff options
| author | Stefan Monnier | 2008-03-12 18:23:38 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-03-12 18:23:38 +0000 |
| commit | 228b6ecd21215cfb3296a643fb8fe065b1683c42 (patch) | |
| tree | f248eaea97e8dfba967e3cf05eb7dd3e736adb9a | |
| parent | 1c55ebd109fad7b6e3f9c61b6c666fd4fa6e381a (diff) | |
| download | emacs-228b6ecd21215cfb3296a643fb8fe065b1683c42.tar.gz emacs-228b6ecd21215cfb3296a643fb8fe065b1683c42.zip | |
Use with-current-buffer.
| -rw-r--r-- | lisp/gnus/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/gnus/gnus-msg.el | 42 |
2 files changed, 16 insertions, 28 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 3b71ec87101..e1ea5e7c6c5 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2008-03-12 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2008-03-12 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * gnus-msg.el: Use with-current-buffer. | ||
| 4 | |||
| 3 | * message.el (message-ignored-resent-headers): Add "Delivered-To". | 5 | * message.el (message-ignored-resent-headers): Add "Delivered-To". |
| 4 | 6 | ||
| 5 | 2008-03-08 Reiner Steib <Reiner.Steib@gmx.de> | 7 | 2008-03-08 Reiner Steib <Reiner.Steib@gmx.de> |
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index 9031790eec8..9a8b365a093 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el | |||
| @@ -552,8 +552,7 @@ Gcc: header for archiving purposes." | |||
| 552 | (t nil)))) | 552 | (t nil)))) |
| 553 | (message-add-action | 553 | (message-add-action |
| 554 | `(when (gnus-buffer-exists-p ,buffer) | 554 | `(when (gnus-buffer-exists-p ,buffer) |
| 555 | (save-excursion | 555 | (with-current-buffer ,buffer |
| 556 | (set-buffer ,buffer) | ||
| 557 | ,(when to-be-marked | 556 | ,(when to-be-marked |
| 558 | (if (eq config 'forward) | 557 | (if (eq config 'forward) |
| 559 | `(gnus-summary-mark-article-as-forwarded ',to-be-marked) | 558 | `(gnus-summary-mark-article-as-forwarded ',to-be-marked) |
| @@ -588,8 +587,7 @@ If ARG is 1, prompt for a group name to find the posting style." | |||
| 588 | "")) | 587 | "")) |
| 589 | ;; #### see comment in gnus-setup-message -- drv | 588 | ;; #### see comment in gnus-setup-message -- drv |
| 590 | (gnus-setup-message 'message (message-mail))) | 589 | (gnus-setup-message 'message (message-mail))) |
| 591 | (save-excursion | 590 | (with-current-buffer buffer |
| 592 | (set-buffer buffer) | ||
| 593 | (setq gnus-newsgroup-name group))))) | 591 | (setq gnus-newsgroup-name group))))) |
| 594 | 592 | ||
| 595 | (defun gnus-group-news (&optional arg) | 593 | (defun gnus-group-news (&optional arg) |
| @@ -620,8 +618,7 @@ network. The corresponding back end must have a 'request-post method." | |||
| 620 | ;; #### see comment in gnus-setup-message -- drv | 618 | ;; #### see comment in gnus-setup-message -- drv |
| 621 | (gnus-setup-message 'message | 619 | (gnus-setup-message 'message |
| 622 | (message-news (gnus-group-real-name gnus-newsgroup-name)))) | 620 | (message-news (gnus-group-real-name gnus-newsgroup-name)))) |
| 623 | (save-excursion | 621 | (with-current-buffer buffer |
| 624 | (set-buffer buffer) | ||
| 625 | (setq gnus-newsgroup-name group))))) | 622 | (setq gnus-newsgroup-name group))))) |
| 626 | 623 | ||
| 627 | (defun gnus-group-post-news (&optional arg) | 624 | (defun gnus-group-post-news (&optional arg) |
| @@ -667,8 +664,7 @@ posting style." | |||
| 667 | gnus-newsgroup-name)) | 664 | gnus-newsgroup-name)) |
| 668 | ;; #### see comment in gnus-setup-message -- drv | 665 | ;; #### see comment in gnus-setup-message -- drv |
| 669 | (gnus-setup-message 'message (message-mail))) | 666 | (gnus-setup-message 'message (message-mail))) |
| 670 | (save-excursion | 667 | (with-current-buffer buffer |
| 671 | (set-buffer buffer) | ||
| 672 | (setq gnus-newsgroup-name group))))) | 668 | (setq gnus-newsgroup-name group))))) |
| 673 | 669 | ||
| 674 | (defun gnus-summary-news-other-window (&optional arg) | 670 | (defun gnus-summary-news-other-window (&optional arg) |
| @@ -704,8 +700,7 @@ network. The corresponding back end must have a 'request-post method." | |||
| 704 | (remove | 700 | (remove |
| 705 | (car (gnus-find-method-for-group gnus-newsgroup-name)) | 701 | (car (gnus-find-method-for-group gnus-newsgroup-name)) |
| 706 | gnus-discouraged-post-methods))))) | 702 | gnus-discouraged-post-methods))))) |
| 707 | (save-excursion | 703 | (with-current-buffer buffer |
| 708 | (set-buffer buffer) | ||
| 709 | (setq gnus-newsgroup-name group))))) | 704 | (setq gnus-newsgroup-name group))))) |
| 710 | 705 | ||
| 711 | (defun gnus-summary-post-news (&optional arg) | 706 | (defun gnus-summary-post-news (&optional arg) |
| @@ -828,8 +823,7 @@ header line with the old Message-ID." | |||
| 828 | (push | 823 | (push |
| 829 | `((lambda () | 824 | `((lambda () |
| 830 | (when (gnus-buffer-exists-p ,gnus-summary-buffer) | 825 | (when (gnus-buffer-exists-p ,gnus-summary-buffer) |
| 831 | (save-excursion | 826 | (with-current-buffer ,gnus-summary-buffer |
| 832 | (set-buffer ,gnus-summary-buffer) | ||
| 833 | (gnus-cache-possibly-remove-article ,article nil nil nil t) | 827 | (gnus-cache-possibly-remove-article ,article nil nil nil t) |
| 834 | (gnus-summary-mark-as-read ,article gnus-canceled-mark))))) | 828 | (gnus-summary-mark-as-read ,article gnus-canceled-mark))))) |
| 835 | message-send-actions) | 829 | message-send-actions) |
| @@ -845,16 +839,14 @@ header line with the old Message-ID." | |||
| 845 | ;; if ARTICLE-BUFFER is nil, gnus-article-buffer is used | 839 | ;; if ARTICLE-BUFFER is nil, gnus-article-buffer is used |
| 846 | ;; this buffer should be passed to all mail/news reply/post routines. | 840 | ;; this buffer should be passed to all mail/news reply/post routines. |
| 847 | (setq gnus-article-copy (gnus-get-buffer-create " *gnus article copy*")) | 841 | (setq gnus-article-copy (gnus-get-buffer-create " *gnus article copy*")) |
| 848 | (save-excursion | 842 | (with-current-buffer gnus-article-copy |
| 849 | (set-buffer gnus-article-copy) | ||
| 850 | (mm-enable-multibyte)) | 843 | (mm-enable-multibyte)) |
| 851 | (let ((article-buffer (or article-buffer gnus-article-buffer)) | 844 | (let ((article-buffer (or article-buffer gnus-article-buffer)) |
| 852 | end beg) | 845 | end beg) |
| 853 | (if (not (and (get-buffer article-buffer) | 846 | (if (not (and (get-buffer article-buffer) |
| 854 | (gnus-buffer-exists-p article-buffer))) | 847 | (gnus-buffer-exists-p article-buffer))) |
| 855 | (error "Can't find any article buffer") | 848 | (error "Can't find any article buffer") |
| 856 | (save-excursion | 849 | (with-current-buffer article-buffer |
| 857 | (set-buffer article-buffer) | ||
| 858 | (let ((gnus-newsgroup-charset (or gnus-article-charset | 850 | (let ((gnus-newsgroup-charset (or gnus-article-charset |
| 859 | gnus-newsgroup-charset)) | 851 | gnus-newsgroup-charset)) |
| 860 | (gnus-newsgroup-ignored-charsets | 852 | (gnus-newsgroup-ignored-charsets |
| @@ -1120,8 +1112,7 @@ If VERY-WIDE, make a very wide reply." | |||
| 1120 | (gnus-summary-select-article) | 1112 | (gnus-summary-select-article) |
| 1121 | (dolist (article very-wide) | 1113 | (dolist (article very-wide) |
| 1122 | (gnus-summary-select-article nil nil nil article) | 1114 | (gnus-summary-select-article nil nil nil article) |
| 1123 | (save-excursion | 1115 | (with-current-buffer (gnus-copy-article-buffer) |
| 1124 | (set-buffer (gnus-copy-article-buffer)) | ||
| 1125 | (gnus-msg-treat-broken-reply-to) | 1116 | (gnus-msg-treat-broken-reply-to) |
| 1126 | (save-restriction | 1117 | (save-restriction |
| 1127 | (message-narrow-to-head) | 1118 | (message-narrow-to-head) |
| @@ -1144,8 +1135,7 @@ If VERY-WIDE, make a very wide reply." | |||
| 1144 | "Check the various replysign variables and take action accordingly." | 1135 | "Check the various replysign variables and take action accordingly." |
| 1145 | (when (or gnus-message-replysign gnus-message-replyencrypt) | 1136 | (when (or gnus-message-replysign gnus-message-replyencrypt) |
| 1146 | (let (signed encrypted) | 1137 | (let (signed encrypted) |
| 1147 | (save-excursion | 1138 | (with-current-buffer gnus-article-buffer |
| 1148 | (set-buffer gnus-article-buffer) | ||
| 1149 | (setq signed (memq 'signed gnus-article-wash-types)) | 1139 | (setq signed (memq 'signed gnus-article-wash-types)) |
| 1150 | (setq encrypted (memq 'encrypted gnus-article-wash-types))) | 1140 | (setq encrypted (memq 'encrypted gnus-article-wash-types))) |
| 1151 | (cond ((and gnus-message-replyencrypt encrypted) | 1141 | (cond ((and gnus-message-replyencrypt encrypted) |
| @@ -1276,8 +1266,7 @@ For the `inline' alternatives, also see the variable | |||
| 1276 | current-prefix-arg)) | 1266 | current-prefix-arg)) |
| 1277 | (dolist (article (gnus-summary-work-articles n)) | 1267 | (dolist (article (gnus-summary-work-articles n)) |
| 1278 | (gnus-summary-select-article nil nil nil article) | 1268 | (gnus-summary-select-article nil nil nil article) |
| 1279 | (save-excursion | 1269 | (with-current-buffer gnus-original-article-buffer |
| 1280 | (set-buffer gnus-original-article-buffer) | ||
| 1281 | (message-resend address)) | 1270 | (message-resend address)) |
| 1282 | (gnus-summary-mark-article-as-forwarded article))) | 1271 | (gnus-summary-mark-article-as-forwarded article))) |
| 1283 | 1272 | ||
| @@ -1484,8 +1473,7 @@ If YANK is non-nil, include the original article." | |||
| 1484 | (insert nntp-server-type)) | 1473 | (insert nntp-server-type)) |
| 1485 | (insert "\n\n\n\n\n") | 1474 | (insert "\n\n\n\n\n") |
| 1486 | (let (text) | 1475 | (let (text) |
| 1487 | (save-excursion | 1476 | (with-current-buffer (gnus-get-buffer-create " *gnus environment info*") |
| 1488 | (set-buffer (gnus-get-buffer-create " *gnus environment info*")) | ||
| 1489 | (erase-buffer) | 1477 | (erase-buffer) |
| 1490 | (gnus-debug) | 1478 | (gnus-debug) |
| 1491 | (setq text (buffer-string))) | 1479 | (setq text (buffer-string))) |
| @@ -1506,8 +1494,7 @@ If YANK is non-nil, include the original article." | |||
| 1506 | (gnus-summary-iterate n | 1494 | (gnus-summary-iterate n |
| 1507 | (let ((gnus-inhibit-treatment t)) | 1495 | (let ((gnus-inhibit-treatment t)) |
| 1508 | (gnus-summary-select-article)) | 1496 | (gnus-summary-select-article)) |
| 1509 | (save-excursion | 1497 | (with-current-buffer buffer |
| 1510 | (set-buffer buffer) | ||
| 1511 | (message-yank-buffer gnus-article-buffer)))) | 1498 | (message-yank-buffer gnus-article-buffer)))) |
| 1512 | 1499 | ||
| 1513 | (defun gnus-debug () | 1500 | (defun gnus-debug () |
| @@ -1520,8 +1507,7 @@ The source file has to be in the Emacs load path." | |||
| 1520 | (gnus-message 4 "Please wait while we snoop your variables...") | 1507 | (gnus-message 4 "Please wait while we snoop your variables...") |
| 1521 | (sit-for 0) | 1508 | (sit-for 0) |
| 1522 | ;; Go through all the files looking for non-default values for variables. | 1509 | ;; Go through all the files looking for non-default values for variables. |
| 1523 | (save-excursion | 1510 | (with-current-buffer (gnus-get-buffer-create " *gnus bug info*") |
| 1524 | (set-buffer (gnus-get-buffer-create " *gnus bug info*")) | ||
| 1525 | (while files | 1511 | (while files |
| 1526 | (erase-buffer) | 1512 | (erase-buffer) |
| 1527 | (when (and (setq file (locate-library (pop files))) | 1513 | (when (and (setq file (locate-library (pop files))) |