;;; gnus-sum.el --- summary mode commands for Gnus
;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007 Free Software Foundation, Inc.
+;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: news
;;; Code:
+;; For Emacs < 22.2.
+(eval-and-compile
+ (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
(eval-when-compile
(require 'cl))
See `gnus-group-goto-unread'."
:link '(custom-manual "(gnus)Group Maneuvering")
:group 'gnus-summary-exit
- :version "23.0" ;; No Gnus
+ :version "23.1" ;; No Gnus
:type 'boolean)
(defcustom gnus-fetch-old-headers nil
If it has any other value or there is no next (unread) article, the
article selected before entering to the ephemeral group will appear."
- :version "23.0" ;; No Gnus
+ :version "23.1" ;; No Gnus
:group 'gnus-summary-maneuvering
:type '(choice :format "%{%t%}:\n %[Value Menu%] %v"
(const next) (const next-unread)
:type 'boolean
:group 'gnus-summary-marks)
+(defcustom gnus-propagate-marks t
+ "If non-nil, do not propagate marks to the backends."
+ :version "21.1"
+ :type 'boolean
+ :group 'gnus-summary-marks)
+
(defcustom gnus-alter-articles-to-read-function nil
"Function to be called to alter the list of articles to be selected."
:type '(choice (const nil) function)
(?E gnus-newsgroup-expunged-tally ?d)
(?s (gnus-current-score-file-nondirectory) ?s)))
+;; This is here rather than in gnus-art for compilation reasons.
+(defvar gnus-article-mode-line-format-alist
+ (nconc '((?w (gnus-article-wash-status) ?s)
+ (?m (gnus-article-mime-part-status) ?s))
+ gnus-summary-mode-line-format-alist))
+
(defvar gnus-last-search-regexp nil
"Default regexp for article search command.")
\"^From:\\\\|^Newsgroups:\\\\|^Subject:\\\\|^Date:\\\\|^To:\")))
")
-;; Byte-compiler warning.
(eval-when-compile
;; Bind features so that require will believe that gnus-sum has
;; already been loaded (avoids infinite recursion)
(let ((features (cons 'gnus-sum features)))
- ;; Several of the declarations in gnus-sum are needed to load the
- ;; following files. Right now, these definitions have been
- ;; compiled but not defined (evaluated). We could either do a
- ;; eval-and-compile about all of the declarations or evaluate the
- ;; source file.
- (if (boundp 'gnus-newsgroup-variables)
- nil
- (load "gnus-sum.el" t t t))
- (require 'gnus)
(require 'gnus-art)))
;; MIME stuff.
"O" gnus-uu-decode-save
"b" gnus-uu-decode-binhex
"B" gnus-uu-decode-binhex
+ "Y" gnus-uu-decode-yenc
"p" gnus-uu-decode-postscript
"P" gnus-uu-decode-postscript-and-save)
["Set mark below..." gnus-score-set-mark-below t]
["Set expunge below..." gnus-score-set-expunge-below t]
["Edit current score file" gnus-score-edit-current-scores t]
- ["Edit score file" gnus-score-edit-file t]
+ ["Edit score file..." gnus-score-edit-file t]
["Trace score" gnus-score-find-trace t]
["Find words" gnus-score-find-favourite-words t]
["Rescore buffer" gnus-summary-rescore t]
["Followup via news" gnus-summary-followup-to-mail t]
["Followup via news and yank"
gnus-summary-followup-to-mail-with-original t]
+ ["Strip signature on reply"
+ (lambda ()
+ (interactive)
+ (if (not (memq message-cite-function
+ '(message-cite-original-without-signature
+ message-cite-original)))
+ ;; Stupid workaround for XEmacs not honoring :visible.
+ (message "Can't toggle this value of `message-cite-function'")
+ (setq message-cite-function
+ (if (eq message-cite-function
+ 'message-cite-original-without-signature)
+ 'message-cite-original
+ 'message-cite-original-without-signature))))
+ ;; XEmacs barfs on :visible.
+ ,@(if (featurep 'xemacs) nil
+ '(:visible (memq message-cite-function
+ '(message-cite-original-without-signature
+ message-cite-original))))
+ :style toggle
+ :selected (eq message-cite-function
+ 'message-cite-original-without-signature)
+ ,@(if (featurep 'xemacs) nil
+ '(:help "Strip signature from cited article when replying."))]
;;("Draft"
;;["Send" gnus-summary-send-draft t]
;;["Send bounced" gnus-resend-bounced-mail t])
["Set expirable mark" gnus-summary-mark-as-expirable t]
["Set bookmark" gnus-summary-set-bookmark t]
["Remove bookmark" gnus-summary-remove-bookmark t])
+ ("Registry Mark"
+ ["Important" gnus-registry-set-article-Important-mark t]
+ ["Not Important" gnus-registry-remove-article-Important-mark t]
+ ["Work" gnus-registry-set-article-Work-mark t]
+ ["Not Work" gnus-registry-remove-article-Work-mark t]
+ ["Later" gnus-registry-set-article-Later-mark t]
+ ["Not Later" gnus-registry-remove-article-Later-mark t]
+ ["Personal" gnus-registry-set-article-Personal-mark t]
+ ["Not Personal" gnus-registry-remove-article-Personal-mark t]
+ ["To Do" gnus-registry-set-article-To-Do-mark t]
+ ["Not To Do" gnus-registry-remove-article-To-Do-mark t])
("Limit to"
["Marks..." gnus-summary-limit-to-marks t]
["Subject..." gnus-summary-limit-to-subject t]
(const :tag "Retro look" gnus-summary-tool-bar-retro)
(repeat :tag "User defined list" gmm-tool-bar-item)
(symbol))
- :version "23.0" ;; No Gnus
+ :version "23.1" ;; No Gnus
:initialize 'custom-initialize-default
:set 'gnus-summary-tool-bar-update
:group 'gnus-summary)
See `gmm-tool-bar-from-list' for the format of the list."
:type '(repeat gmm-tool-bar-item)
- :version "23.0" ;; No Gnus
+ :version "23.1" ;; No Gnus
:initialize 'custom-initialize-default
:set 'gnus-summary-tool-bar-update
:group 'gnus-summary)
See `gmm-tool-bar-from-list' for the format of the list."
:type '(repeat gmm-tool-bar-item)
- :version "23.0" ;; No Gnus
+ :version "23.1" ;; No Gnus
:initialize 'custom-initialize-default
:set 'gnus-summary-tool-bar-update
:group 'gnus-summary)
See `gmm-tool-bar-from-list' for the format of the list."
:type 'gmm-tool-bar-zap-list
- :version "23.0" ;; No Gnus
+ :version "23.1" ;; No Gnus
:initialize 'custom-initialize-default
:set 'gnus-summary-tool-bar-update
:group 'gnus-summary)
(setq headers (cdr headers)))
(list (nreverse outh))))))))
+
+(declare-function turn-on-gnus-mailing-list-mode "gnus-ml" ())
+
\f
(defun gnus-summary-mode (&optional group)
(defun gnus-restore-hidden-threads-configuration (config)
"Restore hidden threads configuration from CONFIG."
(save-excursion
- (let (point buffer-read-only)
+ (let (point (inhibit-read-only t))
(while (setq point (pop config))
(when (and (< point (point-max))
(goto-char point)
(gnus-tmp-subject (mail-header-subject gnus-tmp-header))
(gnus-tmp-opening-bracket (if gnus-tmp-dummy ?\< ?\[))
(gnus-tmp-closing-bracket (if gnus-tmp-dummy ?\> ?\]))
- (buffer-read-only nil))
+ (inhibit-read-only t))
(when (string= gnus-tmp-name "")
(setq gnus-tmp-name gnus-tmp-from))
(unless (numberp gnus-tmp-lines)
(defun gnus-summary-prepare ()
"Generate the summary buffer."
(interactive)
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
(erase-buffer)
(setq gnus-newsgroup-data nil
gnus-newsgroup-data-reverse nil)
"Query where the respool algorithm would put this article."
(interactive)
(gnus-summary-select-article)
- (message (gnus-general-simplify-subject (gnus-summary-article-subject))))
+ (message "%s" (gnus-general-simplify-subject (gnus-summary-article-subject))))
(defun gnus-gather-threads-by-subject (threads)
"Gather threads by looking at Subject headers."
(let ((deps gnus-newsgroup-dependencies)
found header)
(prog1
- (save-excursion
- (set-buffer nntp-server-buffer)
+ (with-current-buffer nntp-server-buffer
(let ((case-fold-search nil))
(goto-char (point-min))
(while (and (not found)
(mail-parse-charset gnus-newsgroup-charset)
(dependencies gnus-newsgroup-dependencies)
header article)
- (save-excursion
- (set-buffer nntp-server-buffer)
+ (with-current-buffer nntp-server-buffer
(let ((case-fold-search nil))
(goto-char (point-min))
(while (not (eobp))
(gnus-summary-goto-subject article)
(let* ((datal (gnus-data-find-list article))
(data (car datal))
- (buffer-read-only nil)
+ (inhibit-read-only t)
(level (gnus-summary-thread-level)))
(gnus-delete-line)
(let ((inserted (- (point)
(not (equal "" references)))
references))
"none")))
- (buffer-read-only nil)
+ (inhibit-read-only t)
(old (car thread)))
(when thread
(unless iheader
(defun gnus-rebuild-thread (id &optional line)
"Rebuild the thread containing ID.
If LINE, insert the rebuilt thread starting on line LINE."
- (let ((buffer-read-only nil)
+ (let ((inhibit-read-only t)
old-pos current thread data)
(if (not gnus-show-threads)
(setq thread (list (car (gnus-id-to-thread id))))
(gnus-thread-header h1) (gnus-thread-header h2)))
(defsubst gnus-article-sort-by-random (h1 h2)
- "Sort articles by article number."
+ "Sort articles randomly."
(zerop (random 2)))
(defun gnus-thread-sort-by-random (h1 h2)
- "Sort threads by root article number."
+ "Sort threads randomly."
(gnus-article-sort-by-random
(gnus-thread-header h1) (gnus-thread-header h2)))
:type 'string
:group 'gnus-thread)
+(defcustom gnus-summary-display-while-building nil
+ "If non-nil, show and update the summary buffer as it's being built.
+If the value is t, update the buffer after every line is inserted. If
+the value is an integer (N), update the display every N lines."
+ :version "22.1"
+ :group 'gnus-thread
+ :type '(choice (const :tag "off" nil)
+ number
+ (const :tag "frequently" t)))
+
(defun gnus-summary-prepare-threads (threads)
"Prepare summary buffer from THREADS and indentation LEVEL.
THREADS is either a list of `(PARENT [(CHILD1 [(GRANDCHILD ...]...) ...])'
(gnus-inverse-list-range-intersection
gnus-newsgroup-articles gnus-newsgroup-seen))))
+(declare-function gnus-get-predicate "gnus-agent" (predicate))
+
(defun gnus-summary-display-make-predicate (display)
(require 'gnus-agent)
(when (= (length display) 1)
(symbol-value
(intern (format "gnus-%s-mode-line-format-spec" where))))
(let (mode-string)
- (save-excursion
- ;; We evaluate this in the summary buffer since these
- ;; variables are buffer-local to that buffer.
- (set-buffer gnus-summary-buffer)
- ;; We bind all these variables that are used in the `eval' form
+ ;; We evaluate this in the summary buffer since these
+ ;; variables are buffer-local to that buffer.
+ (with-current-buffer gnus-summary-buffer
+ ;; We bind all these variables that are used in the `eval' form
;; below.
(let* ((mformat (symbol-value
(intern
headers id end ref number
(mail-parse-charset gnus-newsgroup-charset)
(mail-parse-ignored-charsets
- (save-excursion (condition-case nil
- (set-buffer gnus-summary-buffer)
- (error))
- gnus-newsgroup-ignored-charsets)))
- (save-excursion
- (set-buffer nntp-server-buffer)
+ (save-current-buffer (condition-case nil
+ (set-buffer gnus-summary-buffer)
+ (error))
+ gnus-newsgroup-ignored-charsets)))
+ (with-current-buffer nntp-server-buffer
;; Translate all TAB characters into SPACE characters.
(subst-char-in-region (point-min) (point-max) ?\t ? t)
(subst-char-in-region (point-min) (point-max) ?\r ? t)
(t
nil)))
number headers header)
- (save-excursion
- (set-buffer nntp-server-buffer)
+ (with-current-buffer nntp-server-buffer
(subst-char-in-region (point-min) (point-max) ?\r ? t)
;; Allow the user to mangle the headers before parsing them.
(gnus-run-hooks 'gnus-parse-headers-hook)
"Return a list of articles to be worked upon.
The prefix argument, the list of process marked articles, and the
current article will be taken into consideration."
- (save-excursion
- (set-buffer gnus-summary-buffer)
+ (with-current-buffer gnus-summary-buffer
(cond
(n
;; A numerical prefix has been given.
(defun gnus-summary-search-group (&optional backward use-level)
"Search for next unread newsgroup.
If optional argument BACKWARD is non-nil, search backward instead."
- (save-excursion
- (set-buffer gnus-group-buffer)
+ (with-current-buffer gnus-group-buffer
(when (gnus-group-search-forward
backward nil (if use-level (gnus-group-group-level) nil))
(gnus-group-group-name))))
(gnus-group-jump-to-group newsgroup))
(save-excursion
;; Take care of tree window mode.
- (if (get-buffer-window gnus-group-buffer)
+ (if (get-buffer-window gnus-group-buffer 0)
(pop-to-buffer gnus-group-buffer)
(set-buffer gnus-group-buffer))
(gnus-group-jump-to-group newsgroup))))
(gnus-save-newsrc-file)
(gnus-dribble-save)))
+(declare-function gnus-cache-write-active "gnus-cache" (&optional force))
+
(defun gnus-summary-exit (&optional temporary leave-hidden)
"Exit reading current newsgroup, and then return to group selection mode.
`gnus-exit-group-hook' is called with no arguments if that value is non-nil."
(interactive)
(gnus-set-global-variables)
(when (gnus-buffer-live-p gnus-article-buffer)
- (save-excursion
- (set-buffer gnus-article-buffer)
+ (with-current-buffer gnus-article-buffer
(mm-destroy-parts gnus-article-mime-handles)
;; Set it to nil for safety reason.
(setq gnus-article-mime-handle-alist nil)
(gnus-async-halt-prefetch)
(run-hooks 'gnus-summary-prepare-exit-hook)
(when (gnus-buffer-live-p gnus-article-buffer)
- (save-excursion
- (set-buffer gnus-article-buffer)
+ (with-current-buffer gnus-article-buffer
(mm-destroy-parts gnus-article-mime-handles)
;; Set it to nil for safety reason.
(setq gnus-article-mime-handle-alist nil)
(cond ((eq major-mode 'gnus-summary-mode)
(gnus-set-global-variables))
((eq major-mode 'gnus-article-mode)
- (save-excursion
+ (save-current-buffer
;; The `gnus-summary-buffer' variable may point
;; to the old summary buffer when using a single
;; article buffer.
(gnus-kill-summary-on-exit
(when (and gnus-use-trees
(gnus-buffer-exists-p buffer))
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(gnus-tree-close gnus-newsgroup-name)))
(gnus-kill-buffer buffer))
;; Deaden the buffer.
((gnus-buffer-exists-p buffer)
- (save-excursion
- (set-buffer buffer)
+ (with-current-buffer buffer
(gnus-deaden-summary))))))
(defun gnus-summary-wake-up-the-dead (&rest args)
(gnus-summary-position-point))
(defun gnus-summary-goto-subject (article &optional force silent)
- "Go the subject line of ARTICLE.
+ "Go to the subject line of ARTICLE.
If FORCE, also allow jumping to articles not currently shown."
(interactive "nArticle number: ")
(unless (numberp article)
(and (not pseudo)
(gnus-summary-article-pseudo-p article)
(error "This is a pseudo-article"))
- (save-excursion
- (set-buffer gnus-summary-buffer)
+ (with-current-buffer gnus-summary-buffer
(if (or (and gnus-single-article-buffer
(or (null gnus-current-article)
(null gnus-article-current)
(?\C-p (gnus-group-prev-unread-group 1))))
(cursor-in-echo-area t)
keve key group ended prompt)
- (save-excursion
- (set-buffer gnus-group-buffer)
+ (with-current-buffer gnus-group-buffer
(goto-char start)
(setq group
(if (eq gnus-keep-same-level 'best)
(gnus-summary-article-subject))))
(defun gnus-summary-prev-article (&optional unread subject)
- "Select the article after the current one.
+ "Select the article before the current one.
If UNREAD is non-nil, only unread articles are selected."
(interactive "P")
(gnus-summary-next-article unread subject t))
;; References header, since this is slightly more
;; reliable than the References field we got from the
;; server.
- (save-excursion
- (set-buffer gnus-original-article-buffer)
+ (with-current-buffer gnus-original-article-buffer
(nnheader-narrow-to-headers)
(unless (setq ref (message-fetch-field "references"))
(when (setq ref (message-fetch-field "in-reply-to"))
(case-fold-search t)
(buf (current-buffer))
dig to-address)
- (save-excursion
- (set-buffer gnus-original-article-buffer)
+ (with-current-buffer gnus-original-article-buffer
;; Have the digest group inherit the main mail address of
;; the parent article.
(when (setq to-address (or (gnus-fetch-field "reply-to")
(nndoc-article-type guess))
t nil t))
(progn
- ;; Make all postings to this group go to the parent group.
+ ;; Make all postings to this group go to the parent group.
(nconc (gnus-info-params (gnus-get-info egroup))
params)
(push egroup groups))
This search includes all articles in the current group that Gnus has
fetched headers for, whether they are displayed or not."
(let ((articles nil)
+ ;; Can't eta-reduce because it's a macro.
(func `(lambda (h) (,(intern (concat "mail-header-" header)) h)))
(case-fold-search t))
(dolist (header gnus-newsgroup-headers)
(goto-char (point-max))
(recenter -3)
(when gnus-break-pages
- (when (re-search-backward page-delimiter nil t)
- (narrow-to-region (match-end 0) (point-max)))
(gnus-narrow-to-page))))
(defun gnus-summary-print-truncate-and-quote (string &optional len)
(mail-header-date gnus-current-headers) ")"))))
(gnus-run-hooks 'gnus-ps-print-hook)
(save-excursion
- (if window-system
+ (if ps-print-color-p
(ps-spool-buffer-with-faces)
(ps-spool-buffer)))))
(kill-buffer buffer))))
(gnus-summary-select-article nil 'force)
(let ((deps gnus-newsgroup-dependencies)
head header lines)
- (save-excursion
- (set-buffer gnus-original-article-buffer)
+ (with-current-buffer gnus-original-article-buffer
(save-restriction
(message-narrow-to-head)
(setq head (buffer-string))
gnus-break-pages)
;; Destroy any MIME parts.
(when (gnus-buffer-live-p gnus-article-buffer)
- (save-excursion
- (set-buffer gnus-article-buffer)
+ (with-current-buffer gnus-article-buffer
(mm-destroy-parts gnus-article-mime-handles)
;; Set it to nil for safety reason.
(setq gnus-article-mime-handle-alist nil)
(with-current-buffer gnus-article-buffer
(widen)
(article-narrow-to-head)
- (let* ((buffer-read-only nil)
+ (let* ((inhibit-read-only t)
(inhibit-point-motion-hooks t)
(hidden (if (numberp arg)
(>= arg 0)
(if gnus-break-pages
(gnus-narrow-to-page)
(when (gnus-visual-p 'page-marker)
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
(gnus-remove-text-with-property 'gnus-prev)
(gnus-remove-text-with-property 'gnus-next))))
(gnus-set-mode-line 'article)))))
(save-restriction
(widen)
(let ((start (window-start))
- buffer-read-only)
+ (inhibit-read-only t))
(if (equal arg '(4))
(message-caesar-buffer-body nil t)
(message-caesar-buffer-body arg))
;; Create buttons and stuff...
(gnus-treat-article nil))
+(declare-function idna-to-unicode "ext:idna" (str))
+
(defun gnus-summary-idna-message (&optional arg)
"Decode IDNA encoded domain names in the current articles.
IDNA encoded domain names looks like `xn--bar'. If a string
(save-restriction
(widen)
(let ((pos (window-start))
- buffer-read-only)
+ (inhibit-read-only t))
(goto-char (point-min))
(when (message-goto-body)
(gnus-narrow-to-body))
(gnus-eval-in-buffer-window gnus-article-buffer
(widen)
(when (gnus-visual-p 'page-marker)
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
(gnus-remove-text-with-property 'gnus-prev)
(gnus-remove-text-with-property 'gnus-next))
(setq gnus-page-broken nil))))
move-is-internal))) ; is this move internal?
;; Copy the article.
((eq action 'copy)
- (save-excursion
- (set-buffer copy-buf)
+ (with-current-buffer copy-buf
(when (gnus-request-article-this-buffer article gnus-newsgroup-name)
(save-restriction
(nnheader-narrow-to-headers)
(delete "Xref:" (delete new-xref xref))
" ")
" " new-xref))
- (save-excursion
- (set-buffer copy-buf)
+ (with-current-buffer copy-buf
;; First put the article in the destination group.
(gnus-request-article-this-buffer article gnus-newsgroup-name)
(when (consp (setq art-group
;; Update the Xref header in this article to point to
;; the new crossposted article we have just created.
(when (eq action 'crosspost)
- (save-excursion
- (set-buffer copy-buf)
+ (with-current-buffer copy-buf
(gnus-request-article-this-buffer article gnus-newsgroup-name)
(nnheader-replace-header "Xref" new-xref)
(gnus-request-replace-article
(apply 'gnus-summary-remove-process-mark articles-to-update-marks)
;; Re-activate all groups that have been moved to.
- (save-excursion
- (set-buffer gnus-group-buffer)
+ (with-current-buffer gnus-group-buffer
(let ((gnus-group-marked to-groups))
(gnus-group-get-new-news-this-group nil t)))
:type 'symbol
:group 'gnus-summary-mail)
-(defcustom gnus-summary-display-while-building nil
- "If non-nil, show and update the summary buffer as it's being built.
-If the value is t, update the buffer after every line is inserted. If
-the value is an integer (N), update the display every N lines."
- :version "22.1"
- :group 'gnus-thread
- :type '(choice (const :tag "off" nil)
- number
- (const :tag "frequently" t)))
-
(defun gnus-summary-respool-article (&optional n method)
"Respool the current article.
The article will be squeezed through the mail spooling process again,
(or (file-readable-p file)
(not (file-regular-p file))
(error "Can't read %s" file))
- (save-excursion
- (set-buffer (gnus-get-buffer-create " *import file*"))
+ (with-current-buffer (gnus-get-buffer-create " *import file*")
(erase-buffer)
(nnheader-insert-file-contents file)
(goto-char (point-min))
group-art)
(unless (gnus-check-backend-function 'request-accept-article group)
(error "%s does not support article importing" group))
- (save-excursion
- (set-buffer (gnus-get-buffer-create " *import file*"))
+ (with-current-buffer (gnus-get-buffer-create " *import file*")
(erase-buffer)
(goto-char (point-min))
;; This doesn't look like an article, so we fudge some headers.
"nndraft:queue")))
(error "Can't edit the raw article in group %s"
gnus-newsgroup-name))
- (save-excursion
- (set-buffer gnus-summary-buffer)
+ (with-current-buffer gnus-summary-buffer
(let ((mail-parse-charset gnus-newsgroup-charset)
(mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets))
(gnus-set-global-variables)
(let ((nntp-server-buffer (current-buffer)))
(setq header (car (gnus-get-newsgroup-headers
nil t))))
- (save-excursion
- (set-buffer gnus-summary-buffer)
+ (with-current-buffer gnus-summary-buffer
(gnus-data-set-header
(gnus-data-find (cdr gnus-article-current))
header)
(cdr gnus-article-current))))
;; Prettify the article buffer again.
(unless no-highlight
- (save-excursion
- (set-buffer gnus-article-buffer)
+ (with-current-buffer gnus-article-buffer
;;;!!! Fix this -- article should be rehighlighted.
;;;(gnus-run-hooks 'gnus-article-display-hook)
(set-buffer gnus-original-article-buffer)
(interactive)
(let (gnus-mark-article-hook)
(gnus-summary-select-article)
- (save-excursion
- (set-buffer gnus-original-article-buffer)
+ (with-current-buffer gnus-original-article-buffer
(let ((groups (nnmail-article-group 'identity trace)))
(unless silent
(if groups
(unless (numberp article)
(error "%s is not a number" article))
(push article gnus-newsgroup-replied)
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
(when (gnus-summary-goto-subject article nil t)
(gnus-summary-update-secondary-mark article))))))
(let ((articles (if (listp article) article (list article))))
(dolist (article articles)
(push article gnus-newsgroup-forwarded)
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
(when (gnus-summary-goto-subject article nil t)
(gnus-summary-update-secondary-mark article))))))
(= mark gnus-dormant-mark) (= mark gnus-unread-mark))))
(when (gnus-summary-goto-subject article nil t)
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
(gnus-summary-show-thread)
;; Fix the mark.
(gnus-summary-update-mark mark 'unread)
(defun gnus-summary-update-mark (mark type)
(let ((forward (cdr (assq type gnus-summary-mark-positions)))
- (buffer-read-only nil))
+ (inhibit-read-only t))
(re-search-backward "[\n\r]" (point-at-bol) 'move-to-limit)
(when forward
(when (looking-at "\r")
(gnus-summary-mark-forward (- n) gnus-unread-mark))
(defun gnus-summary-mark-unread-as-read ()
- "Intended to be used by `gnus-summary-mark-article-hook'."
+ "Intended to be used by `gnus-mark-article-hook'."
(when (memq gnus-current-article gnus-newsgroup-unreads)
(gnus-summary-mark-article gnus-current-article gnus-read-mark)))
(defun gnus-summary-mark-read-and-unread-as-read (&optional new-mark)
- "Intended to be used by `gnus-summary-mark-article-hook'."
+ "Intended to be used by `gnus-mark-article-hook'."
(let ((mark (gnus-summary-article-mark)))
(when (or (gnus-unread-mark-p mark)
(gnus-read-mark-p mark))
(or new-mark gnus-read-mark)))))
(defun gnus-summary-mark-current-read-and-unread-as-read (&optional new-mark)
- "Intended to be used by `gnus-summary-mark-article-hook'."
+ "Intended to be used by `gnus-mark-article-hook'."
(let ((mark (gnus-summary-article-mark)))
(when (or (gnus-unread-mark-p mark)
(gnus-read-mark-p mark))
(or new-mark gnus-read-mark)))))
(defun gnus-summary-mark-unread-as-ticked ()
- "Intended to be used by `gnus-summary-mark-article-hook'."
+ "Intended to be used by `gnus-mark-article-hook'."
(when (memq gnus-current-article gnus-newsgroup-unreads)
(gnus-summary-mark-article gnus-current-article gnus-ticked-mark)))
(setq score (if score
(prefix-numeric-value score)
(or gnus-summary-default-score 0)))
- (save-excursion
- (set-buffer gnus-summary-buffer)
+ (with-current-buffer gnus-summary-buffer
(goto-char (point-min))
(while
(progn
(setq score (if score
(prefix-numeric-value score)
(or gnus-summary-default-score 0)))
- (save-excursion
- (set-buffer gnus-summary-buffer)
+ (with-current-buffer gnus-summary-buffer
(goto-char (point-min))
(while (and (progn
(when (> (gnus-summary-article-score) score)
(defun gnus-summary-limit-include-expunged (&optional no-error)
"Display all the hidden articles that were expunged for low scores."
(interactive)
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
(let ((scored gnus-newsgroup-scored)
headers h)
(while scored
(start (point))
(article (gnus-summary-article-number)))
(goto-char start)
- ;; Go forward until either the buffer ends or the subthread
- ;; ends.
+ ;; Go forward until either the buffer ends or the subthread ends.
(when (and (not (eobp))
(or (zerop (gnus-summary-next-thread 1 t))
(goto-char (point-max))))
"Sort the summary buffer using the default sorting method.
Argument REVERSE means reverse order."
(interactive "P")
- (let* ((buffer-read-only)
+ (let* ((inhibit-read-only t)
(gnus-summary-prepare-hook nil))
;; We do the sorting by regenerating the threads.
(gnus-summary-prepare)
article
`(lambda (t1 t2)
(,article t2 t1))))
- (buffer-read-only)
+ (inhibit-read-only t)
(gnus-summary-prepare-hook nil))
;; We do the sorting by regenerating the threads.
(gnus-summary-prepare)
gnus-article-prepare-hook)))
(gnus-summary-select-article t nil nil article)
(gnus-summary-goto-subject article)))
- (save-excursion
- (set-buffer save-buffer)
+ (with-current-buffer save-buffer
(erase-buffer)
(insert-buffer-substring (if decode
gnus-article-buffer
(save-restriction
(widen)
(let ((start (window-start))
- buffer-read-only)
+ (inhibit-read-only t))
(message-pipe-buffer-body program)
(set-window-start (get-buffer-window (current-buffer)) start))))))
"Return a value based on the split METHODS."
(let (split-name method result match)
(when methods
- (save-excursion
- (set-buffer gnus-original-article-buffer)
+ (with-current-buffer gnus-original-article-buffer
(save-restriction
(nnheader-narrow-to-headers)
(while (and methods (not split-name))
encoded)))
(defvar gnus-summary-save-parts-counter)
+(declare-function mm-uu-dissect "mm-uu" (&optional noheader mime-type))
(defun gnus-summary-save-parts (type dir n &optional reverse)
"Save parts matching TYPE to DIR.
current-prefix-arg))
(gnus-summary-iterate n
(let ((gnus-display-mime-function nil)
+ gnus-article-prepare-hook
+ gnus-article-decode-hook
+ gnus-display-mime-function
+ gnus-break-pages
(gnus-inhibit-treatment t))
(gnus-summary-select-article))
- (save-excursion
- (set-buffer gnus-article-buffer)
+ (with-current-buffer gnus-article-buffer
(let ((handles (or gnus-article-mime-handles
(mm-dissect-buffer nil gnus-article-loose-mime)
(and gnus-article-emulate-mime
;; Summary extract commands
(defun gnus-summary-insert-pseudos (pslist &optional not-view)
- (let ((buffer-read-only nil)
+ (let ((inhibit-read-only t)
(article (gnus-summary-article-number))
after-article b e)
(unless (gnus-summary-goto-subject article)
;; We have found the header.
header
;; We have to really fetch the header to this article.
- (save-excursion
- (set-buffer nntp-server-buffer)
+ (with-current-buffer nntp-server-buffer
(when (setq where (gnus-request-head id group))
(nnheader-fold-continuation-lines)
(goto-char (point-max))
;; a different group (or server), we fudge some bogus
;; article numbers for this article.
(mail-header-set-number header gnus-reffed-article-number))
- (save-excursion
- (set-buffer gnus-summary-buffer)
+ (with-current-buffer gnus-summary-buffer
(decf gnus-reffed-article-number)
(gnus-remove-header (mail-header-number header))
(push header gnus-newsgroup-headers)
(save-excursion
(let (setmarkundo)
;; Propagate the read marks to the backend.
- (when (gnus-check-backend-function 'request-set-mark group)
+ (when (and gnus-propagate-marks
+ (gnus-check-backend-function 'request-set-mark group))
(let ((del (gnus-remove-from-range (gnus-info-read info) read))
(add (gnus-remove-from-range read (gnus-info-read info))))
(when (or add del)