aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2008-03-03 04:06:03 +0000
committerStefan Monnier2008-03-03 04:06:03 +0000
commitc7a91ce13240d429d2187d5b494594e3e4b7efc8 (patch)
tree57192c612423cd3a16c21e614368e4511700eece
parentef1b088ac607d88c519cbfb3b0a4bd76214605a3 (diff)
downloademacs-c7a91ce13240d429d2187d5b494594e3e4b7efc8.tar.gz
emacs-c7a91ce13240d429d2187d5b494594e3e4b7efc8.zip
Use inhibit-read-only and with-current-buffer.
(gnus-summary-jump-to-group): Consider windows on other displayed frames as well. Similar changes might be needed elsewhere, but that's the one I've bumped into during my use.
-rw-r--r--lisp/gnus/ChangeLog5
-rw-r--r--lisp/gnus/gnus-sum.el166
2 files changed, 71 insertions, 100 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 392833a2cba..44d6de5be07 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,5 +1,10 @@
12008-03-03 Stefan Monnier <monnier@iro.umontreal.ca> 12008-03-03 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * gnus-sum.el: Use inhibit-read-only and with-current-buffer.
4 (gnus-summary-jump-to-group): Consider windows on other displayed frames as
5 well. Similar changes might be needed elsewhere, but that's the one I've
6 bumped into during my use.
7
3 * gnus-msg.el (gnus-debug): 8 * gnus-msg.el (gnus-debug):
4 * gnus-group.el (gnus-update-group-mark-positions): 9 * gnus-group.el (gnus-update-group-mark-positions):
5 Use mm-string-to-multibyte. 10 Use mm-string-to-multibyte.
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 9f206803450..c68632c04ff 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -3359,7 +3359,7 @@ marks of articles."
3359(defun gnus-restore-hidden-threads-configuration (config) 3359(defun gnus-restore-hidden-threads-configuration (config)
3360 "Restore hidden threads configuration from CONFIG." 3360 "Restore hidden threads configuration from CONFIG."
3361 (save-excursion 3361 (save-excursion
3362 (let (point buffer-read-only) 3362 (let (point (inhibit-read-only t))
3363 (while (setq point (pop config)) 3363 (while (setq point (pop config))
3364 (when (and (< point (point-max)) 3364 (when (and (< point (point-max))
3365 (goto-char point) 3365 (goto-char point)
@@ -3682,7 +3682,7 @@ buffer that was in action when the last article was fetched."
3682 (gnus-tmp-subject (mail-header-subject gnus-tmp-header)) 3682 (gnus-tmp-subject (mail-header-subject gnus-tmp-header))
3683 (gnus-tmp-opening-bracket (if gnus-tmp-dummy ?\< ?\[)) 3683 (gnus-tmp-opening-bracket (if gnus-tmp-dummy ?\< ?\[))
3684 (gnus-tmp-closing-bracket (if gnus-tmp-dummy ?\> ?\])) 3684 (gnus-tmp-closing-bracket (if gnus-tmp-dummy ?\> ?\]))
3685 (buffer-read-only nil)) 3685 (inhibit-read-only t))
3686 (when (string= gnus-tmp-name "") 3686 (when (string= gnus-tmp-name "")
3687 (setq gnus-tmp-name gnus-tmp-from)) 3687 (setq gnus-tmp-name gnus-tmp-from))
3688 (unless (numberp gnus-tmp-lines) 3688 (unless (numberp gnus-tmp-lines)
@@ -3988,7 +3988,7 @@ If NO-DISPLAY, don't generate a summary buffer."
3988(defun gnus-summary-prepare () 3988(defun gnus-summary-prepare ()
3989 "Generate the summary buffer." 3989 "Generate the summary buffer."
3990 (interactive) 3990 (interactive)
3991 (let ((buffer-read-only nil)) 3991 (let ((inhibit-read-only t))
3992 (erase-buffer) 3992 (erase-buffer)
3993 (setq gnus-newsgroup-data nil 3993 (setq gnus-newsgroup-data nil
3994 gnus-newsgroup-data-reverse nil) 3994 gnus-newsgroup-data-reverse nil)
@@ -4396,8 +4396,7 @@ the id of the parent article (if any)."
4396 (let ((deps gnus-newsgroup-dependencies) 4396 (let ((deps gnus-newsgroup-dependencies)
4397 found header) 4397 found header)
4398 (prog1 4398 (prog1
4399 (save-excursion 4399 (with-current-buffer nntp-server-buffer
4400 (set-buffer nntp-server-buffer)
4401 (let ((case-fold-search nil)) 4400 (let ((case-fold-search nil))
4402 (goto-char (point-min)) 4401 (goto-char (point-min))
4403 (while (and (not found) 4402 (while (and (not found)
@@ -4432,8 +4431,7 @@ the id of the parent article (if any)."
4432 (mail-parse-charset gnus-newsgroup-charset) 4431 (mail-parse-charset gnus-newsgroup-charset)
4433 (dependencies gnus-newsgroup-dependencies) 4432 (dependencies gnus-newsgroup-dependencies)
4434 header article) 4433 header article)
4435 (save-excursion 4434 (with-current-buffer nntp-server-buffer
4436 (set-buffer nntp-server-buffer)
4437 (let ((case-fold-search nil)) 4435 (let ((case-fold-search nil))
4438 (goto-char (point-min)) 4436 (goto-char (point-min))
4439 (while (not (eobp)) 4437 (while (not (eobp))
@@ -4465,7 +4463,7 @@ the id of the parent article (if any)."
4465 (gnus-summary-goto-subject article) 4463 (gnus-summary-goto-subject article)
4466 (let* ((datal (gnus-data-find-list article)) 4464 (let* ((datal (gnus-data-find-list article))
4467 (data (car datal)) 4465 (data (car datal))
4468 (buffer-read-only nil) 4466 (inhibit-read-only t)
4469 (level (gnus-summary-thread-level))) 4467 (level (gnus-summary-thread-level)))
4470 (gnus-delete-line) 4468 (gnus-delete-line)
4471 (let ((inserted (- (point) 4469 (let ((inserted (- (point)
@@ -4516,7 +4514,7 @@ the id of the parent article (if any)."
4516 (not (equal "" references))) 4514 (not (equal "" references)))
4517 references)) 4515 references))
4518 "none"))) 4516 "none")))
4519 (buffer-read-only nil) 4517 (inhibit-read-only t)
4520 (old (car thread))) 4518 (old (car thread)))
4521 (when thread 4519 (when thread
4522 (unless iheader 4520 (unless iheader
@@ -4532,7 +4530,7 @@ the id of the parent article (if any)."
4532(defun gnus-rebuild-thread (id &optional line) 4530(defun gnus-rebuild-thread (id &optional line)
4533 "Rebuild the thread containing ID. 4531 "Rebuild the thread containing ID.
4534If LINE, insert the rebuilt thread starting on line LINE." 4532If LINE, insert the rebuilt thread starting on line LINE."
4535 (let ((buffer-read-only nil) 4533 (let ((inhibit-read-only t)
4536 old-pos current thread data) 4534 old-pos current thread data)
4537 (if (not gnus-show-threads) 4535 (if (not gnus-show-threads)
4538 (setq thread (list (car (gnus-id-to-thread id)))) 4536 (setq thread (list (car (gnus-id-to-thread id))))
@@ -5936,11 +5934,10 @@ If WHERE is `summary', the summary mode line format will be used."
5936 (symbol-value 5934 (symbol-value
5937 (intern (format "gnus-%s-mode-line-format-spec" where)))) 5935 (intern (format "gnus-%s-mode-line-format-spec" where))))
5938 (let (mode-string) 5936 (let (mode-string)
5939 (save-excursion 5937 ;; We evaluate this in the summary buffer since these
5940 ;; We evaluate this in the summary buffer since these 5938 ;; variables are buffer-local to that buffer.
5941 ;; variables are buffer-local to that buffer. 5939 (with-current-buffer gnus-summary-buffer
5942 (set-buffer gnus-summary-buffer) 5940 ;; We bind all these variables that are used in the `eval' form
5943 ;; We bind all these variables that are used in the `eval' form
5944 ;; below. 5941 ;; below.
5945 (let* ((mformat (symbol-value 5942 (let* ((mformat (symbol-value
5946 (intern 5943 (intern
@@ -6145,12 +6142,11 @@ The resulting hash table is returned, or nil if no Xrefs were found."
6145 headers id end ref number 6142 headers id end ref number
6146 (mail-parse-charset gnus-newsgroup-charset) 6143 (mail-parse-charset gnus-newsgroup-charset)
6147 (mail-parse-ignored-charsets 6144 (mail-parse-ignored-charsets
6148 (save-excursion (condition-case nil 6145 (save-current-buffer (condition-case nil
6149 (set-buffer gnus-summary-buffer) 6146 (set-buffer gnus-summary-buffer)
6150 (error)) 6147 (error))
6151 gnus-newsgroup-ignored-charsets))) 6148 gnus-newsgroup-ignored-charsets)))
6152 (save-excursion 6149 (with-current-buffer nntp-server-buffer
6153 (set-buffer nntp-server-buffer)
6154 ;; Translate all TAB characters into SPACE characters. 6150 ;; Translate all TAB characters into SPACE characters.
6155 (subst-char-in-region (point-min) (point-max) ?\t ? t) 6151 (subst-char-in-region (point-min) (point-max) ?\t ? t)
6156 (subst-char-in-region (point-min) (point-max) ?\r ? t) 6152 (subst-char-in-region (point-min) (point-max) ?\r ? t)
@@ -6316,8 +6312,7 @@ Return a list of headers that match SEQUENCE (see
6316 (t 6312 (t
6317 nil))) 6313 nil)))
6318 number headers header) 6314 number headers header)
6319 (save-excursion 6315 (with-current-buffer nntp-server-buffer
6320 (set-buffer nntp-server-buffer)
6321 (subst-char-in-region (point-min) (point-max) ?\r ? t) 6316 (subst-char-in-region (point-min) (point-max) ?\r ? t)
6322 ;; Allow the user to mangle the headers before parsing them. 6317 ;; Allow the user to mangle the headers before parsing them.
6323 (gnus-run-hooks 'gnus-parse-headers-hook) 6318 (gnus-run-hooks 'gnus-parse-headers-hook)
@@ -6441,8 +6436,7 @@ the subject line on."
6441 "Return a list of articles to be worked upon. 6436 "Return a list of articles to be worked upon.
6442The prefix argument, the list of process marked articles, and the 6437The prefix argument, the list of process marked articles, and the
6443current article will be taken into consideration." 6438current article will be taken into consideration."
6444 (save-excursion 6439 (with-current-buffer gnus-summary-buffer
6445 (set-buffer gnus-summary-buffer)
6446 (cond 6440 (cond
6447 (n 6441 (n
6448 ;; A numerical prefix has been given. 6442 ;; A numerical prefix has been given.
@@ -6526,8 +6520,7 @@ executed with point over the summary line of the articles."
6526(defun gnus-summary-search-group (&optional backward use-level) 6520(defun gnus-summary-search-group (&optional backward use-level)
6527 "Search for next unread newsgroup. 6521 "Search for next unread newsgroup.
6528If optional argument BACKWARD is non-nil, search backward instead." 6522If optional argument BACKWARD is non-nil, search backward instead."
6529 (save-excursion 6523 (with-current-buffer gnus-group-buffer
6530 (set-buffer gnus-group-buffer)
6531 (when (gnus-group-search-forward 6524 (when (gnus-group-search-forward
6532 backward nil (if use-level (gnus-group-group-level) nil)) 6525 backward nil (if use-level (gnus-group-group-level) nil))
6533 (gnus-group-group-name)))) 6526 (gnus-group-group-name))))
@@ -6713,7 +6706,7 @@ displayed, no centering will be performed."
6713 (gnus-group-jump-to-group newsgroup)) 6706 (gnus-group-jump-to-group newsgroup))
6714 (save-excursion 6707 (save-excursion
6715 ;; Take care of tree window mode. 6708 ;; Take care of tree window mode.
6716 (if (get-buffer-window gnus-group-buffer) 6709 (if (get-buffer-window gnus-group-buffer 0)
6717 (pop-to-buffer gnus-group-buffer) 6710 (pop-to-buffer gnus-group-buffer)
6718 (set-buffer gnus-group-buffer)) 6711 (set-buffer gnus-group-buffer))
6719 (gnus-group-jump-to-group newsgroup)))) 6712 (gnus-group-jump-to-group newsgroup))))
@@ -6964,8 +6957,7 @@ If FORCE (the prefix), also save the .newsrc file(s)."
6964 (interactive) 6957 (interactive)
6965 (gnus-set-global-variables) 6958 (gnus-set-global-variables)
6966 (when (gnus-buffer-live-p gnus-article-buffer) 6959 (when (gnus-buffer-live-p gnus-article-buffer)
6967 (save-excursion 6960 (with-current-buffer gnus-article-buffer
6968 (set-buffer gnus-article-buffer)
6969 (mm-destroy-parts gnus-article-mime-handles) 6961 (mm-destroy-parts gnus-article-mime-handles)
6970 ;; Set it to nil for safety reason. 6962 ;; Set it to nil for safety reason.
6971 (setq gnus-article-mime-handle-alist nil) 6963 (setq gnus-article-mime-handle-alist nil)
@@ -7071,8 +7063,7 @@ If FORCE (the prefix), also save the .newsrc file(s)."
7071 (gnus-async-halt-prefetch) 7063 (gnus-async-halt-prefetch)
7072 (run-hooks 'gnus-summary-prepare-exit-hook) 7064 (run-hooks 'gnus-summary-prepare-exit-hook)
7073 (when (gnus-buffer-live-p gnus-article-buffer) 7065 (when (gnus-buffer-live-p gnus-article-buffer)
7074 (save-excursion 7066 (with-current-buffer gnus-article-buffer
7075 (set-buffer gnus-article-buffer)
7076 (mm-destroy-parts gnus-article-mime-handles) 7067 (mm-destroy-parts gnus-article-mime-handles)
7077 ;; Set it to nil for safety reason. 7068 ;; Set it to nil for safety reason.
7078 (setq gnus-article-mime-handle-alist nil) 7069 (setq gnus-article-mime-handle-alist nil)
@@ -7116,7 +7107,7 @@ The state which existed when entering the ephemeral is reset."
7116 (cond ((eq major-mode 'gnus-summary-mode) 7107 (cond ((eq major-mode 'gnus-summary-mode)
7117 (gnus-set-global-variables)) 7108 (gnus-set-global-variables))
7118 ((eq major-mode 'gnus-article-mode) 7109 ((eq major-mode 'gnus-article-mode)
7119 (save-excursion 7110 (save-current-buffer
7120 ;; The `gnus-summary-buffer' variable may point 7111 ;; The `gnus-summary-buffer' variable may point
7121 ;; to the old summary buffer when using a single 7112 ;; to the old summary buffer when using a single
7122 ;; article buffer. 7113 ;; article buffer.
@@ -7211,14 +7202,12 @@ The state which existed when entering the ephemeral is reset."
7211 (gnus-kill-summary-on-exit 7202 (gnus-kill-summary-on-exit
7212 (when (and gnus-use-trees 7203 (when (and gnus-use-trees
7213 (gnus-buffer-exists-p buffer)) 7204 (gnus-buffer-exists-p buffer))
7214 (save-excursion 7205 (with-current-buffer buffer
7215 (set-buffer buffer)
7216 (gnus-tree-close gnus-newsgroup-name))) 7206 (gnus-tree-close gnus-newsgroup-name)))
7217 (gnus-kill-buffer buffer)) 7207 (gnus-kill-buffer buffer))
7218 ;; Deaden the buffer. 7208 ;; Deaden the buffer.
7219 ((gnus-buffer-exists-p buffer) 7209 ((gnus-buffer-exists-p buffer)
7220 (save-excursion 7210 (with-current-buffer buffer
7221 (set-buffer buffer)
7222 (gnus-deaden-summary)))))) 7211 (gnus-deaden-summary))))))
7223 7212
7224(defun gnus-summary-wake-up-the-dead (&rest args) 7213(defun gnus-summary-wake-up-the-dead (&rest args)
@@ -7499,8 +7488,7 @@ be displayed."
7499 (and (not pseudo) 7488 (and (not pseudo)
7500 (gnus-summary-article-pseudo-p article) 7489 (gnus-summary-article-pseudo-p article)
7501 (error "This is a pseudo-article")) 7490 (error "This is a pseudo-article"))
7502 (save-excursion 7491 (with-current-buffer gnus-summary-buffer
7503 (set-buffer gnus-summary-buffer)
7504 (if (or (and gnus-single-article-buffer 7492 (if (or (and gnus-single-article-buffer
7505 (or (null gnus-current-article) 7493 (or (null gnus-current-article)
7506 (null gnus-article-current) 7494 (null gnus-article-current)
@@ -7609,8 +7597,7 @@ If BACKWARD, the previous article is selected instead of the next."
7609 (?\C-p (gnus-group-prev-unread-group 1)))) 7597 (?\C-p (gnus-group-prev-unread-group 1))))
7610 (cursor-in-echo-area t) 7598 (cursor-in-echo-area t)
7611 keve key group ended prompt) 7599 keve key group ended prompt)
7612 (save-excursion 7600 (with-current-buffer gnus-group-buffer
7613 (set-buffer gnus-group-buffer)
7614 (goto-char start) 7601 (goto-char start)
7615 (setq group 7602 (setq group
7616 (if (eq gnus-keep-same-level 'best) 7603 (if (eq gnus-keep-same-level 'best)
@@ -8714,8 +8701,7 @@ The difference between N and the number of articles fetched is returned."
8714 ;; References header, since this is slightly more 8701 ;; References header, since this is slightly more
8715 ;; reliable than the References field we got from the 8702 ;; reliable than the References field we got from the
8716 ;; server. 8703 ;; server.
8717 (save-excursion 8704 (with-current-buffer gnus-original-article-buffer
8718 (set-buffer gnus-original-article-buffer)
8719 (nnheader-narrow-to-headers) 8705 (nnheader-narrow-to-headers)
8720 (unless (setq ref (message-fetch-field "references")) 8706 (unless (setq ref (message-fetch-field "references"))
8721 (when (setq ref (message-fetch-field "in-reply-to")) 8707 (when (setq ref (message-fetch-field "in-reply-to"))
@@ -8890,8 +8876,7 @@ to guess what the document format is."
8890 (case-fold-search t) 8876 (case-fold-search t)
8891 (buf (current-buffer)) 8877 (buf (current-buffer))
8892 dig to-address) 8878 dig to-address)
8893 (save-excursion 8879 (with-current-buffer gnus-original-article-buffer
8894 (set-buffer gnus-original-article-buffer)
8895 ;; Have the digest group inherit the main mail address of 8880 ;; Have the digest group inherit the main mail address of
8896 ;; the parent article. 8881 ;; the parent article.
8897 (when (setq to-address (or (gnus-fetch-field "reply-to") 8882 (when (setq to-address (or (gnus-fetch-field "reply-to")
@@ -8961,7 +8946,7 @@ Obeys the standard process/prefix convention."
8961 (nndoc-article-type guess)) 8946 (nndoc-article-type guess))
8962 t nil t)) 8947 t nil t))
8963 (progn 8948 (progn
8964 ;; Make all postings to this group go to the parent group. 8949 ;; Make all postings to this group go to the parent group.
8965 (nconc (gnus-info-params (gnus-get-info egroup)) 8950 (nconc (gnus-info-params (gnus-get-info egroup))
8966 params) 8951 params)
8967 (push egroup groups)) 8952 (push egroup groups))
@@ -9116,6 +9101,7 @@ Optional argument BACKWARD means do search for backward.
9116This search includes all articles in the current group that Gnus has 9101This search includes all articles in the current group that Gnus has
9117fetched headers for, whether they are displayed or not." 9102fetched headers for, whether they are displayed or not."
9118 (let ((articles nil) 9103 (let ((articles nil)
9104 ;; Can't eta-reduce because it's a macro.
9119 (func `(lambda (h) (,(intern (concat "mail-header-" header)) h))) 9105 (func `(lambda (h) (,(intern (concat "mail-header-" header)) h)))
9120 (case-fold-search t)) 9106 (case-fold-search t))
9121 (dolist (header gnus-newsgroup-headers) 9107 (dolist (header gnus-newsgroup-headers)
@@ -9314,8 +9300,7 @@ strokes are `C-u g'."
9314 (gnus-summary-select-article nil 'force) 9300 (gnus-summary-select-article nil 'force)
9315 (let ((deps gnus-newsgroup-dependencies) 9301 (let ((deps gnus-newsgroup-dependencies)
9316 head header lines) 9302 head header lines)
9317 (save-excursion 9303 (with-current-buffer gnus-original-article-buffer
9318 (set-buffer gnus-original-article-buffer)
9319 (save-restriction 9304 (save-restriction
9320 (message-narrow-to-head) 9305 (message-narrow-to-head)
9321 (setq head (buffer-string)) 9306 (setq head (buffer-string))
@@ -9355,8 +9340,7 @@ strokes are `C-u g'."
9355 gnus-break-pages) 9340 gnus-break-pages)
9356 ;; Destroy any MIME parts. 9341 ;; Destroy any MIME parts.
9357 (when (gnus-buffer-live-p gnus-article-buffer) 9342 (when (gnus-buffer-live-p gnus-article-buffer)
9358 (save-excursion 9343 (with-current-buffer gnus-article-buffer
9359 (set-buffer gnus-article-buffer)
9360 (mm-destroy-parts gnus-article-mime-handles) 9344 (mm-destroy-parts gnus-article-mime-handles)
9361 ;; Set it to nil for safety reason. 9345 ;; Set it to nil for safety reason.
9362 (setq gnus-article-mime-handle-alist nil) 9346 (setq gnus-article-mime-handle-alist nil)
@@ -9393,7 +9377,7 @@ If ARG is a negative number, hide the unwanted header lines."
9393 (with-current-buffer gnus-article-buffer 9377 (with-current-buffer gnus-article-buffer
9394 (widen) 9378 (widen)
9395 (article-narrow-to-head) 9379 (article-narrow-to-head)
9396 (let* ((buffer-read-only nil) 9380 (let* ((inhibit-read-only t)
9397 (inhibit-point-motion-hooks t) 9381 (inhibit-point-motion-hooks t)
9398 (hidden (if (numberp arg) 9382 (hidden (if (numberp arg)
9399 (>= arg 0) 9383 (>= arg 0)
@@ -9420,7 +9404,7 @@ If ARG is a negative number, hide the unwanted header lines."
9420 (if gnus-break-pages 9404 (if gnus-break-pages
9421 (gnus-narrow-to-page) 9405 (gnus-narrow-to-page)
9422 (when (gnus-visual-p 'page-marker) 9406 (when (gnus-visual-p 'page-marker)
9423 (let ((buffer-read-only nil)) 9407 (let ((inhibit-read-only t))
9424 (gnus-remove-text-with-property 'gnus-prev) 9408 (gnus-remove-text-with-property 'gnus-prev)
9425 (gnus-remove-text-with-property 'gnus-next)))) 9409 (gnus-remove-text-with-property 'gnus-next))))
9426 (gnus-set-mode-line 'article))))) 9410 (gnus-set-mode-line 'article)))))
@@ -9441,7 +9425,7 @@ prefix specifies how many places to rotate each letter forward."
9441 (save-restriction 9425 (save-restriction
9442 (widen) 9426 (widen)
9443 (let ((start (window-start)) 9427 (let ((start (window-start))
9444 buffer-read-only) 9428 (inhibit-read-only t))
9445 (if (equal arg '(4)) 9429 (if (equal arg '(4))
9446 (message-caesar-buffer-body nil t) 9430 (message-caesar-buffer-body nil t)
9447 (message-caesar-buffer-body arg)) 9431 (message-caesar-buffer-body arg))
@@ -9487,7 +9471,7 @@ installed for this command to work."
9487 (save-restriction 9471 (save-restriction
9488 (widen) 9472 (widen)
9489 (let ((pos (window-start)) 9473 (let ((pos (window-start))
9490 buffer-read-only) 9474 (inhibit-read-only t))
9491 (goto-char (point-min)) 9475 (goto-char (point-min))
9492 (when (message-goto-body) 9476 (when (message-goto-body)
9493 (gnus-narrow-to-body)) 9477 (gnus-narrow-to-body))
@@ -9505,7 +9489,7 @@ installed for this command to work."
9505 (gnus-eval-in-buffer-window gnus-article-buffer 9489 (gnus-eval-in-buffer-window gnus-article-buffer
9506 (widen) 9490 (widen)
9507 (when (gnus-visual-p 'page-marker) 9491 (when (gnus-visual-p 'page-marker)
9508 (let ((buffer-read-only nil)) 9492 (let ((inhibit-read-only t))
9509 (gnus-remove-text-with-property 'gnus-prev) 9493 (gnus-remove-text-with-property 'gnus-prev)
9510 (gnus-remove-text-with-property 'gnus-next)) 9494 (gnus-remove-text-with-property 'gnus-next))
9511 (setq gnus-page-broken nil)))) 9495 (setq gnus-page-broken nil))))
@@ -9630,8 +9614,7 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
9630 move-is-internal))) ; is this move internal? 9614 move-is-internal))) ; is this move internal?
9631 ;; Copy the article. 9615 ;; Copy the article.
9632 ((eq action 'copy) 9616 ((eq action 'copy)
9633 (save-excursion 9617 (with-current-buffer copy-buf
9634 (set-buffer copy-buf)
9635 (when (gnus-request-article-this-buffer article gnus-newsgroup-name) 9618 (when (gnus-request-article-this-buffer article gnus-newsgroup-name)
9636 (save-restriction 9619 (save-restriction
9637 (nnheader-narrow-to-headers) 9620 (nnheader-narrow-to-headers)
@@ -9654,8 +9637,7 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
9654 (delete "Xref:" (delete new-xref xref)) 9637 (delete "Xref:" (delete new-xref xref))
9655 " ") 9638 " ")
9656 " " new-xref)) 9639 " " new-xref))
9657 (save-excursion 9640 (with-current-buffer copy-buf
9658 (set-buffer copy-buf)
9659 ;; First put the article in the destination group. 9641 ;; First put the article in the destination group.
9660 (gnus-request-article-this-buffer article gnus-newsgroup-name) 9642 (gnus-request-article-this-buffer article gnus-newsgroup-name)
9661 (when (consp (setq art-group 9643 (when (consp (setq art-group
@@ -9759,8 +9741,7 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
9759 ;; Update the Xref header in this article to point to 9741 ;; Update the Xref header in this article to point to
9760 ;; the new crossposted article we have just created. 9742 ;; the new crossposted article we have just created.
9761 (when (eq action 'crosspost) 9743 (when (eq action 'crosspost)
9762 (save-excursion 9744 (with-current-buffer copy-buf
9763 (set-buffer copy-buf)
9764 (gnus-request-article-this-buffer article gnus-newsgroup-name) 9745 (gnus-request-article-this-buffer article gnus-newsgroup-name)
9765 (nnheader-replace-header "Xref" new-xref) 9746 (nnheader-replace-header "Xref" new-xref)
9766 (gnus-request-replace-article 9747 (gnus-request-replace-article
@@ -9785,8 +9766,7 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
9785 9766
9786 (apply 'gnus-summary-remove-process-mark articles-to-update-marks) 9767 (apply 'gnus-summary-remove-process-mark articles-to-update-marks)
9787 ;; Re-activate all groups that have been moved to. 9768 ;; Re-activate all groups that have been moved to.
9788 (save-excursion 9769 (with-current-buffer gnus-group-buffer
9789 (set-buffer gnus-group-buffer)
9790 (let ((gnus-group-marked to-groups)) 9770 (let ((gnus-group-marked to-groups))
9791 (gnus-group-get-new-news-this-group nil t))) 9771 (gnus-group-get-new-news-this-group nil t)))
9792 9772
@@ -9881,8 +9861,7 @@ latter case, they will be copied into the relevant groups."
9881 (or (file-readable-p file) 9861 (or (file-readable-p file)
9882 (not (file-regular-p file)) 9862 (not (file-regular-p file))
9883 (error "Can't read %s" file)) 9863 (error "Can't read %s" file))
9884 (save-excursion 9864 (with-current-buffer (gnus-get-buffer-create " *import file*")
9885 (set-buffer (gnus-get-buffer-create " *import file*"))
9886 (erase-buffer) 9865 (erase-buffer)
9887 (nnheader-insert-file-contents file) 9866 (nnheader-insert-file-contents file)
9888 (goto-char (point-min)) 9867 (goto-char (point-min))
@@ -9920,8 +9899,7 @@ latter case, they will be copied into the relevant groups."
9920 group-art) 9899 group-art)
9921 (unless (gnus-check-backend-function 'request-accept-article group) 9900 (unless (gnus-check-backend-function 'request-accept-article group)
9922 (error "%s does not support article importing" group)) 9901 (error "%s does not support article importing" group))
9923 (save-excursion 9902 (with-current-buffer (gnus-get-buffer-create " *import file*")
9924 (set-buffer (gnus-get-buffer-create " *import file*"))
9925 (erase-buffer) 9903 (erase-buffer)
9926 (goto-char (point-min)) 9904 (goto-char (point-min))
9927 ;; This doesn't look like an article, so we fudge some headers. 9905 ;; This doesn't look like an article, so we fudge some headers.
@@ -10104,8 +10082,7 @@ groups."
10104 "nndraft:queue"))) 10082 "nndraft:queue")))
10105 (error "Can't edit the raw article in group %s" 10083 (error "Can't edit the raw article in group %s"
10106 gnus-newsgroup-name)) 10084 gnus-newsgroup-name))
10107 (save-excursion 10085 (with-current-buffer gnus-summary-buffer
10108 (set-buffer gnus-summary-buffer)
10109 (let ((mail-parse-charset gnus-newsgroup-charset) 10086 (let ((mail-parse-charset gnus-newsgroup-charset)
10110 (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets)) 10087 (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets))
10111 (gnus-set-global-variables) 10088 (gnus-set-global-variables)
@@ -10212,8 +10189,7 @@ groups."
10212 (let ((nntp-server-buffer (current-buffer))) 10189 (let ((nntp-server-buffer (current-buffer)))
10213 (setq header (car (gnus-get-newsgroup-headers 10190 (setq header (car (gnus-get-newsgroup-headers
10214 nil t)))) 10191 nil t))))
10215 (save-excursion 10192 (with-current-buffer gnus-summary-buffer
10216 (set-buffer gnus-summary-buffer)
10217 (gnus-data-set-header 10193 (gnus-data-set-header
10218 (gnus-data-find (cdr gnus-article-current)) 10194 (gnus-data-find (cdr gnus-article-current))
10219 header) 10195 header)
@@ -10231,8 +10207,7 @@ groups."
10231 (cdr gnus-article-current)))) 10207 (cdr gnus-article-current))))
10232 ;; Prettify the article buffer again. 10208 ;; Prettify the article buffer again.
10233 (unless no-highlight 10209 (unless no-highlight
10234 (save-excursion 10210 (with-current-buffer gnus-article-buffer
10235 (set-buffer gnus-article-buffer)
10236 ;;;!!! Fix this -- article should be rehighlighted. 10211 ;;;!!! Fix this -- article should be rehighlighted.
10237 ;;;(gnus-run-hooks 'gnus-article-display-hook) 10212 ;;;(gnus-run-hooks 'gnus-article-display-hook)
10238 (set-buffer gnus-original-article-buffer) 10213 (set-buffer gnus-original-article-buffer)
@@ -10262,8 +10237,7 @@ groups."
10262 (interactive) 10237 (interactive)
10263 (let (gnus-mark-article-hook) 10238 (let (gnus-mark-article-hook)
10264 (gnus-summary-select-article) 10239 (gnus-summary-select-article)
10265 (save-excursion 10240 (with-current-buffer gnus-original-article-buffer
10266 (set-buffer gnus-original-article-buffer)
10267 (let ((groups (nnmail-article-group 'identity trace))) 10241 (let ((groups (nnmail-article-group 'identity trace)))
10268 (unless silent 10242 (unless silent
10269 (if groups 10243 (if groups
@@ -10424,7 +10398,7 @@ ARTICLE can also be a list of articles."
10424 (unless (numberp article) 10398 (unless (numberp article)
10425 (error "%s is not a number" article)) 10399 (error "%s is not a number" article))
10426 (push article gnus-newsgroup-replied) 10400 (push article gnus-newsgroup-replied)
10427 (let ((buffer-read-only nil)) 10401 (let ((inhibit-read-only t))
10428 (when (gnus-summary-goto-subject article nil t) 10402 (when (gnus-summary-goto-subject article nil t)
10429 (gnus-summary-update-secondary-mark article)))))) 10403 (gnus-summary-update-secondary-mark article))))))
10430 10404
@@ -10434,7 +10408,7 @@ ARTICLE can also be a list of articles."
10434 (let ((articles (if (listp article) article (list article)))) 10408 (let ((articles (if (listp article) article (list article))))
10435 (dolist (article articles) 10409 (dolist (article articles)
10436 (push article gnus-newsgroup-forwarded) 10410 (push article gnus-newsgroup-forwarded)
10437 (let ((buffer-read-only nil)) 10411 (let ((inhibit-read-only t))
10438 (when (gnus-summary-goto-subject article nil t) 10412 (when (gnus-summary-goto-subject article nil t)
10439 (gnus-summary-update-secondary-mark article)))))) 10413 (gnus-summary-update-secondary-mark article))))))
10440 10414
@@ -10653,7 +10627,7 @@ If NO-EXPIRE, auto-expiry will be inhibited."
10653 (= mark gnus-dormant-mark) (= mark gnus-unread-mark)))) 10627 (= mark gnus-dormant-mark) (= mark gnus-unread-mark))))
10654 10628
10655 (when (gnus-summary-goto-subject article nil t) 10629 (when (gnus-summary-goto-subject article nil t)
10656 (let ((buffer-read-only nil)) 10630 (let ((inhibit-read-only t))
10657 (gnus-summary-show-thread) 10631 (gnus-summary-show-thread)
10658 ;; Fix the mark. 10632 ;; Fix the mark.
10659 (gnus-summary-update-mark mark 'unread) 10633 (gnus-summary-update-mark mark 'unread)
@@ -10697,7 +10671,7 @@ If NO-EXPIRE, auto-expiry will be inhibited."
10697 10671
10698(defun gnus-summary-update-mark (mark type) 10672(defun gnus-summary-update-mark (mark type)
10699 (let ((forward (cdr (assq type gnus-summary-mark-positions))) 10673 (let ((forward (cdr (assq type gnus-summary-mark-positions)))
10700 (buffer-read-only nil)) 10674 (inhibit-read-only t))
10701 (re-search-backward "[\n\r]" (point-at-bol) 'move-to-limit) 10675 (re-search-backward "[\n\r]" (point-at-bol) 'move-to-limit)
10702 (when forward 10676 (when forward
10703 (when (looking-at "\r") 10677 (when (looking-at "\r")
@@ -10882,8 +10856,7 @@ even ticked and dormant ones."
10882 (setq score (if score 10856 (setq score (if score
10883 (prefix-numeric-value score) 10857 (prefix-numeric-value score)
10884 (or gnus-summary-default-score 0))) 10858 (or gnus-summary-default-score 0)))
10885 (save-excursion 10859 (with-current-buffer gnus-summary-buffer
10886 (set-buffer gnus-summary-buffer)
10887 (goto-char (point-min)) 10860 (goto-char (point-min))
10888 (while 10861 (while
10889 (progn 10862 (progn
@@ -10912,8 +10885,7 @@ even ticked and dormant ones."
10912 (setq score (if score 10885 (setq score (if score
10913 (prefix-numeric-value score) 10886 (prefix-numeric-value score)
10914 (or gnus-summary-default-score 0))) 10887 (or gnus-summary-default-score 0)))
10915 (save-excursion 10888 (with-current-buffer gnus-summary-buffer
10916 (set-buffer gnus-summary-buffer)
10917 (goto-char (point-min)) 10889 (goto-char (point-min))
10918 (while (and (progn 10890 (while (and (progn
10919 (when (> (gnus-summary-article-score) score) 10891 (when (> (gnus-summary-article-score) score)
@@ -10926,7 +10898,7 @@ even ticked and dormant ones."
10926(defun gnus-summary-limit-include-expunged (&optional no-error) 10898(defun gnus-summary-limit-include-expunged (&optional no-error)
10927 "Display all the hidden articles that were expunged for low scores." 10899 "Display all the hidden articles that were expunged for low scores."
10928 (interactive) 10900 (interactive)
10929 (let ((buffer-read-only nil)) 10901 (let ((inhibit-read-only t))
10930 (let ((scored gnus-newsgroup-scored) 10902 (let ((scored gnus-newsgroup-scored)
10931 headers h) 10903 headers h)
10932 (while scored 10904 (while scored
@@ -11302,8 +11274,7 @@ Returns nil if no threads were there to be hidden."
11302 (start (point)) 11274 (start (point))
11303 (article (gnus-summary-article-number))) 11275 (article (gnus-summary-article-number)))
11304 (goto-char start) 11276 (goto-char start)
11305 ;; Go forward until either the buffer ends or the subthread 11277 ;; Go forward until either the buffer ends or the subthread ends.
11306 ;; ends.
11307 (when (and (not (eobp)) 11278 (when (and (not (eobp))
11308 (or (zerop (gnus-summary-next-thread 1 t)) 11279 (or (zerop (gnus-summary-next-thread 1 t))
11309 (goto-char (point-max)))) 11280 (goto-char (point-max))))
@@ -11508,7 +11479,7 @@ Argument REVERSE means reverse order."
11508 "Sort the summary buffer using the default sorting method. 11479 "Sort the summary buffer using the default sorting method.
11509Argument REVERSE means reverse order." 11480Argument REVERSE means reverse order."
11510 (interactive "P") 11481 (interactive "P")
11511 (let* ((buffer-read-only) 11482 (let* ((inhibit-read-only t)
11512 (gnus-summary-prepare-hook nil)) 11483 (gnus-summary-prepare-hook nil))
11513 ;; We do the sorting by regenerating the threads. 11484 ;; We do the sorting by regenerating the threads.
11514 (gnus-summary-prepare) 11485 (gnus-summary-prepare)
@@ -11531,7 +11502,7 @@ Argument REVERSE means reverse order."
11531 article 11502 article
11532 `(lambda (t1 t2) 11503 `(lambda (t1 t2)
11533 (,article t2 t1)))) 11504 (,article t2 t1))))
11534 (buffer-read-only) 11505 (inhibit-read-only t)
11535 (gnus-summary-prepare-hook nil)) 11506 (gnus-summary-prepare-hook nil))
11536 ;; We do the sorting by regenerating the threads. 11507 ;; We do the sorting by regenerating the threads.
11537 (gnus-summary-prepare) 11508 (gnus-summary-prepare)
@@ -11582,8 +11553,7 @@ will not be marked as saved."
11582 gnus-article-prepare-hook))) 11553 gnus-article-prepare-hook)))
11583 (gnus-summary-select-article t nil nil article) 11554 (gnus-summary-select-article t nil nil article)
11584 (gnus-summary-goto-subject article))) 11555 (gnus-summary-goto-subject article)))
11585 (save-excursion 11556 (with-current-buffer save-buffer
11586 (set-buffer save-buffer)
11587 (erase-buffer) 11557 (erase-buffer)
11588 (insert-buffer-substring (if decode 11558 (insert-buffer-substring (if decode
11589 gnus-article-buffer 11559 gnus-article-buffer
@@ -11703,7 +11673,7 @@ save those articles instead."
11703 (save-restriction 11673 (save-restriction
11704 (widen) 11674 (widen)
11705 (let ((start (window-start)) 11675 (let ((start (window-start))
11706 buffer-read-only) 11676 (inhibit-read-only t))
11707 (message-pipe-buffer-body program) 11677 (message-pipe-buffer-body program)
11708 (set-window-start (get-buffer-window (current-buffer)) start)))))) 11678 (set-window-start (get-buffer-window (current-buffer)) start))))))
11709 11679
@@ -11711,8 +11681,7 @@ save those articles instead."
11711 "Return a value based on the split METHODS." 11681 "Return a value based on the split METHODS."
11712 (let (split-name method result match) 11682 (let (split-name method result match)
11713 (when methods 11683 (when methods
11714 (save-excursion 11684 (with-current-buffer gnus-original-article-buffer
11715 (set-buffer gnus-original-article-buffer)
11716 (save-restriction 11685 (save-restriction
11717 (nnheader-narrow-to-headers) 11686 (nnheader-narrow-to-headers)
11718 (while (and methods (not split-name)) 11687 (while (and methods (not split-name))
@@ -11825,8 +11794,7 @@ If REVERSE, save parts that do not match TYPE."
11825 (let ((gnus-display-mime-function nil) 11794 (let ((gnus-display-mime-function nil)
11826 (gnus-inhibit-treatment t)) 11795 (gnus-inhibit-treatment t))
11827 (gnus-summary-select-article)) 11796 (gnus-summary-select-article))
11828 (save-excursion 11797 (with-current-buffer gnus-article-buffer
11829 (set-buffer gnus-article-buffer)
11830 (let ((handles (or gnus-article-mime-handles 11798 (let ((handles (or gnus-article-mime-handles
11831 (mm-dissect-buffer nil gnus-article-loose-mime) 11799 (mm-dissect-buffer nil gnus-article-loose-mime)
11832 (and gnus-article-emulate-mime 11800 (and gnus-article-emulate-mime
@@ -11864,7 +11832,7 @@ If REVERSE, save parts that do not match TYPE."
11864;; Summary extract commands 11832;; Summary extract commands
11865 11833
11866(defun gnus-summary-insert-pseudos (pslist &optional not-view) 11834(defun gnus-summary-insert-pseudos (pslist &optional not-view)
11867 (let ((buffer-read-only nil) 11835 (let ((inhibit-read-only t)
11868 (article (gnus-summary-article-number)) 11836 (article (gnus-summary-article-number))
11869 after-article b e) 11837 after-article b e)
11870 (unless (gnus-summary-goto-subject article) 11838 (unless (gnus-summary-goto-subject article)
@@ -11992,8 +11960,7 @@ If REVERSE, save parts that do not match TYPE."
11992 ;; We have found the header. 11960 ;; We have found the header.
11993 header 11961 header
11994 ;; We have to really fetch the header to this article. 11962 ;; We have to really fetch the header to this article.
11995 (save-excursion 11963 (with-current-buffer nntp-server-buffer
11996 (set-buffer nntp-server-buffer)
11997 (when (setq where (gnus-request-head id group)) 11964 (when (setq where (gnus-request-head id group))
11998 (nnheader-fold-continuation-lines) 11965 (nnheader-fold-continuation-lines)
11999 (goto-char (point-max)) 11966 (goto-char (point-max))
@@ -12021,8 +11988,7 @@ If REVERSE, save parts that do not match TYPE."
12021 ;; a different group (or server), we fudge some bogus 11988 ;; a different group (or server), we fudge some bogus
12022 ;; article numbers for this article. 11989 ;; article numbers for this article.
12023 (mail-header-set-number header gnus-reffed-article-number)) 11990 (mail-header-set-number header gnus-reffed-article-number))
12024 (save-excursion 11991 (with-current-buffer gnus-summary-buffer
12025 (set-buffer gnus-summary-buffer)
12026 (decf gnus-reffed-article-number) 11992 (decf gnus-reffed-article-number)
12027 (gnus-remove-header (mail-header-number header)) 11993 (gnus-remove-header (mail-header-number header))
12028 (push header gnus-newsgroup-headers) 11994 (push header gnus-newsgroup-headers)