(require 'gnus-range)
(require 'gnus-int)
(require 'gnus-undo)
+(autoload 'gnus-summary-limit-include-cached "gnus-cache" nil t)
(defcustom gnus-kill-summary-on-exit t
"*If non-nil, kill the summary buffer when you exit from it.
:type 'function)
(defcustom gnus-summary-expunge-below nil
- "All articles that have a score less than this variable will be expunged."
+ "All articles that have a score less than this variable will be expunged.
+This variable is local to the summary buffers."
:group 'gnus-score-default
:type '(choice (const :tag "off" nil)
integer))
(defcustom gnus-thread-expunge-below nil
"All threads that have a total score less than this variable will be expunged.
See `gnus-thread-score-function' for en explanation of what a
-\"thread score\" is."
+\"thread score\" is.
+
+This variable is local to the summary buffers."
:group 'gnus-treading
:group 'gnus-score-default
:type '(choice (const :tag "off" nil)
"I" gnus-summary-increase-score
"L" gnus-summary-lower-score
"\M-i" gnus-symbolic-argument
+ "h" gnus-summary-select-article-buffer
"V" gnus-summary-score-map
"X" gnus-uu-extract-map
"u" gnus-summary-limit-to-unread
"m" gnus-summary-limit-to-marks
"v" gnus-summary-limit-to-score
+ "*" gnus-summary-limit-include-cached
"D" gnus-summary-limit-include-dormant
"T" gnus-summary-limit-include-thread
"d" gnus-summary-limit-exclude-dormant
"t" gnus-article-hide-headers
"v" gnus-summary-verbose-headers
"m" gnus-summary-toggle-mime
- "h" gnus-article-treat-html)
+ "h" gnus-article-treat-html
+ "d" gnus-article-treat-dumbquotes)
(gnus-define-keys (gnus-summary-wash-hide-map "W" gnus-summary-wash-map)
"a" gnus-article-hide
["All of the above" gnus-article-strip-blank-lines t]
["Leading space" gnus-article-strip-leading-space t])
["Overstrike" gnus-article-treat-overstrike t]
+ ["Dumb quotes" gnus-article-treat-dumbquotes t]
["Emphasis" gnus-article-emphasize t]
["Word wrap" gnus-article-fill-cited-article t]
["CR" gnus-article-remove-cr t]
["Save in default format" gnus-summary-save-article t]
["Save in file" gnus-summary-save-article-file t]
["Save in Unix mail format" gnus-summary-save-article-mail t]
- ["Write to file" gnus-summary-write-article-mail t]
["Save in MH folder" gnus-summary-save-article-folder t]
["Save in VM folder" gnus-summary-save-article-vm t]
["Save in RMAIL mbox" gnus-summary-save-article-rmail t]
("Cache"
["Enter article" gnus-cache-enter-article t]
["Remove article" gnus-cache-remove-article t])
+ ["Select article buffer" gnus-summary-select-article-buffer t]
["Enter digest buffer" gnus-summary-enter-digest-group t]
["Isearch article..." gnus-summary-isearch-article t]
["Beginning of the article" gnus-summary-beginning-of-article t]
(make-local-variable 'gnus-summary-mark-positions)
(make-local-hook 'post-command-hook)
(add-hook 'post-command-hook 'gnus-clear-inboxes-moved nil t)
+ (make-local-hook 'pre-command-hook)
+ (add-hook 'pre-command-hook 'gnus-set-global-variables nil t)
(run-hooks 'gnus-summary-mode-hook)
(gnus-update-format-specifications nil 'summary 'summary-mode 'summary-dummy)
(gnus-update-summary-mark-positions))
(score-file gnus-current-score-file))
(save-excursion
(set-buffer gnus-group-buffer)
- (setq gnus-newsgroup-name name)
- (setq gnus-newsgroup-marked marked)
- (setq gnus-newsgroup-unreads unread)
- (setq gnus-current-headers headers)
- (setq gnus-newsgroup-data data)
- (setq gnus-article-current gac)
- (setq gnus-summary-buffer summary)
- (setq gnus-article-buffer article-buffer)
- (setq gnus-original-article-buffer original)
- (setq gnus-reffed-article-number reffed)
- (setq gnus-current-score-file score-file)
+ (setq gnus-newsgroup-name name
+ gnus-newsgroup-marked marked
+ gnus-newsgroup-unreads unread
+ gnus-current-headers headers
+ gnus-newsgroup-data data
+ gnus-article-current gac
+ gnus-summary-buffer summary
+ gnus-article-buffer article-buffer
+ gnus-original-article-buffer original
+ gnus-reffed-article-number reffed
+ gnus-current-score-file score-file)
;; The article buffer also has local variables.
(when (gnus-buffer-live-p gnus-article-buffer)
(set-buffer gnus-article-buffer)
(kill-buffer (current-buffer))
(if (not quit-config)
(progn
+ ;; Update the info -- marks might need to be removed,
+ ;; for instance.
+ (gnus-summary-update-info)
(set-buffer gnus-group-buffer)
(gnus-group-jump-to-group group)
(gnus-group-next-unread-group 1))
(and gnus-show-threads
gnus-thread-hide-subtree
(gnus-summary-hide-all-threads))
+ (when kill-buffer
+ (gnus-kill-or-deaden-summary kill-buffer))
;; Show first unread article if requested.
(if (and (not no-article)
(not no-display)
(goto-char (point-min))
(gnus-summary-position-point)
(gnus-set-mode-line 'summary)
- (gnus-configure-windows 'summary 'force))
- (when kill-buffer
- (gnus-kill-or-deaden-summary kill-buffer))
+ (gnus-configure-windows 'summary 'force))
(when (get-buffer-window gnus-group-buffer t)
;; Gotta use windows, because recenter does weird stuff if
;; the current buffer ain't the displayed window.
(defun gnus-summary-simplify-subject-query ()
"Query where the respool algorithm would put this article."
(interactive)
- (gnus-set-global-variables)
(gnus-summary-select-article)
(message (gnus-general-simplify-subject (gnus-summary-article-subject))))
(set var (delq article (symbol-value var))))))))))
(defun gnus-update-missing-marks (missing)
- "Go through the list of MISSING articles and remove them mark lists."
+ "Go through the list of MISSING articles and remove them from the mark lists."
(when missing
(let ((types gnus-article-mark-lists)
var m)
(mail-header-set-id header id))
(setcar (symbol-value id-dep) header))
(set id-dep (list header)))
- (when header
+ (when header
(if (boundp (setq ref-dep (intern (or ref "none") dependencies)))
(setcdr (symbol-value ref-dep)
(nconc (cdr (symbol-value ref-dep))
(let ((num (ignore-errors (read buffer))))
(if (numberp num) num 0)))
(unless (eobp)
- (forward-char 1))))
+ (search-forward "\t" eol 'move))))
(defmacro gnus-nov-skip-field ()
'(search-forward "\t" eol 'move))
;; Various summary commands
+(defun gnus-summary-select-article-buffer ()
+ "Reconfigure windows to show article buffer."
+ (interactive)
+ (if (not (gnus-buffer-live-p gnus-article-buffer))
+ (error "There is no article buffer for this summary buffer")
+ (gnus-configure-windows 'article)
+ (select-window (get-buffer-window gnus-article-buffer))))
+
(defun gnus-summary-universal-argument (arg)
"Perform any operation on all articles that are process/prefixed."
(interactive "P")
- (gnus-set-global-variables)
(let ((articles (gnus-summary-work-articles arg))
func article)
(if (eq
"Exit and then reselect the current newsgroup.
The prefix argument ALL means to select all articles."
(interactive "P")
- (gnus-set-global-variables)
(when (gnus-ephemeral-group-p gnus-newsgroup-name)
(error "Ephemeral groups can't be reselected"))
(let ((current-subject (gnus-summary-article-number))
;; Do the cross-ref thing.
(when gnus-use-cross-reference
(gnus-mark-xrefs-as-read group headers gnus-newsgroup-unreads))
- ;; Do adaptive scoring, and possibly save score files.
- (when gnus-newsgroup-adaptive
- (gnus-score-adaptive))
- (when gnus-use-scoring
- (gnus-score-save))
;; Do not switch windows but change the buffer to work.
(set-buffer gnus-group-buffer)
(unless (gnus-ephemeral-group-p gnus-newsgroup-name)
"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)
(gnus-kill-save-kill-buffer)
(let* ((group gnus-newsgroup-name)
(quit-config (gnus-group-quit-config gnus-newsgroup-name))
;; Make all changes in this group permanent.
(unless quit-config
(run-hooks 'gnus-exit-group-hook)
- (gnus-summary-update-info))
+ (gnus-summary-update-info)
+ ;; Do adaptive scoring, and possibly save score files.
+ (when gnus-newsgroup-adaptive
+ (gnus-score-adaptive))
+ (when gnus-use-scoring
+ (gnus-score-save)))
(gnus-close-group group)
;; Make sure where we were, and go to next newsgroup.
(set-buffer gnus-group-buffer)
(unless quit-config
(gnus-group-jump-to-group group))
(run-hooks 'gnus-summary-exit-hook)
- (unless quit-config
+ (unless (or quit-config
+ ;; If this group has disappeared from the summary
+ ;; buffer, don't skip forwards.
+ (not (string= group (gnus-group-group-name))))
(gnus-group-next-unread-group 1))
(setq group-point (point))
(if temporary
(defun gnus-summary-exit-no-update (&optional no-questions)
"Quit reading current newsgroup without updating read article info."
(interactive)
- (gnus-set-global-variables)
(let* ((group gnus-newsgroup-name)
(quit-config (gnus-group-quit-config group)))
(when (or no-questions
initially. If NEXT-GROUP, go to this group. If BACKWARD, go to
previous group instead."
(interactive "P")
- (gnus-set-global-variables)
;; Stop pre-fetching.
(gnus-async-halt-prefetch)
(let ((current-group gnus-newsgroup-name)
"Make the summary buffer take up the entire Emacs frame.
Given a prefix, will force an `article' buffer configuration."
(interactive "P")
- (gnus-set-global-variables)
(if arg
(gnus-configure-windows 'article 'force)
(gnus-configure-windows 'summary 'force)))
If SUBJECT, only articles with SUBJECT are selected.
If BACKWARD, the previous article is selected instead of the next."
(interactive "P")
- (gnus-set-global-variables)
(cond
;; Is there such an article?
((and (gnus-summary-search-forward unread subject backward)
If MOVE, move to the previous unread article if point is at
the beginning of the buffer."
(interactive "P")
- (gnus-set-global-variables)
(let ((article (gnus-summary-article-number))
(article-window (get-buffer-window gnus-article-buffer t))
endp)
"Scroll up (or down) one line current article.
Argument LINES specifies lines to be scrolled up (or down if negative)."
(interactive "p")
- (gnus-set-global-variables)
(gnus-configure-windows 'article)
(gnus-summary-show-thread)
(when (eq (gnus-summary-select-article nil nil 'pseudo) 'old)
(defun gnus-summary-next-same-subject ()
"Select next article which has the same subject as current one."
(interactive)
- (gnus-set-global-variables)
(gnus-summary-next-article nil (gnus-summary-article-subject)))
(defun gnus-summary-prev-same-subject ()
"Select previous article which has the same subject as current one."
(interactive)
- (gnus-set-global-variables)
(gnus-summary-prev-article nil (gnus-summary-article-subject)))
(defun gnus-summary-next-unread-same-subject ()
"Select next unread article which has the same subject as current one."
(interactive)
- (gnus-set-global-variables)
(gnus-summary-next-article t (gnus-summary-article-subject)))
(defun gnus-summary-prev-unread-same-subject ()
"Select previous unread article which has the same subject as current one."
(interactive)
- (gnus-set-global-variables)
(gnus-summary-prev-article t (gnus-summary-article-subject)))
(defun gnus-summary-first-unread-article ()
"Select the first unread article.
Return nil if there are no unread articles."
(interactive)
- (gnus-set-global-variables)
(prog1
(when (gnus-summary-first-subject t)
(gnus-summary-show-thread)
"Select the first article.
Return nil if there are no articles."
(interactive)
- (gnus-set-global-variables)
(prog1
(when (gnus-summary-first-subject)
(gnus-summary-show-thread)
(defun gnus-summary-best-unread-article ()
"Select the unread article with the highest score."
(interactive)
- (gnus-set-global-variables)
(let ((best -1000000)
(data gnus-newsgroup-data)
article score)
(setq gnus-newsgroup-history
(cdr (setq to (nthcdr number gnus-newsgroup-history))))
(if to
- (gnus-summary-goto-article (car to))
+ (gnus-summary-goto-article (car to) nil t)
(error "Article history empty")))
(gnus-summary-position-point))
"Limit the summary buffer to the next N articles.
If not given a prefix, use the process marked articles instead."
(interactive "P")
- (gnus-set-global-variables)
(prog1
(let ((articles (gnus-summary-work-articles n)))
(setq gnus-newsgroup-processable nil)
"Restore the previous limit.
If given a prefix, remove all limits."
(interactive "P")
- (gnus-set-global-variables)
(when total
(setq gnus-newsgroup-limits
(list (mapcar (lambda (h) (mail-header-number h))
list of marks.
Returns how many articles were removed."
(interactive "sMarks: \nP")
- (gnus-set-global-variables)
(prog1
(let ((data gnus-newsgroup-data)
(marks (if (listp marks) marks
(defun gnus-summary-limit-to-score (&optional score)
"Limit to articles with score at or above SCORE."
(interactive "P")
- (gnus-set-global-variables)
(setq score (if score
(prefix-numeric-value score)
(or gnus-summary-default-score 0)))
(defun gnus-summary-limit-include-thread (id)
"Display all the hidden articles that in the current thread."
- (interactive (mail-header-id (gnus-summary-article-header)))
- (gnus-set-global-variables)
+ (interactive (list (mail-header-id (gnus-summary-article-header))))
(let ((articles (gnus-articles-in-thread
(gnus-id-to-thread (gnus-root-id id)))))
(prog1
(gnus-summary-position-point))))
(defun gnus-summary-limit-include-dormant ()
- "Display all the hidden articles that are marked as dormant."
+ "Display all the hidden articles that are marked as dormant.
+Note that this command only works on a subset of the articles currently
+fetched for this group."
(interactive)
- (gnus-set-global-variables)
(unless gnus-newsgroup-dormant
(error "There are no dormant articles in this group"))
(prog1
(defun gnus-summary-limit-exclude-dormant ()
"Hide all dormant articles."
(interactive)
- (gnus-set-global-variables)
(prog1
(gnus-summary-limit-to-marks (list gnus-dormant-mark) 'reverse)
(gnus-summary-position-point)))
(defun gnus-summary-limit-exclude-childless-dormant ()
"Hide all dormant articles that have no children."
(interactive)
- (gnus-set-global-variables)
(let ((data (gnus-data-list t))
articles d children)
;; Find all articles that are either not dormant or have
If N is negative, go to ancestor -N instead.
The difference between N and the number of articles fetched is returned."
(interactive "p")
- (gnus-set-global-variables)
(let ((skip 1)
error header ref)
(when (not (natnump n))
"Fetch all articles mentioned in the References header.
Return the number of articles fetched."
(interactive)
- (gnus-set-global-variables)
(let ((ref (mail-header-references (gnus-summary-article-header)))
(current (gnus-summary-article-number))
(n 0))
If LIMIT (the numerical prefix), fetch that many old headers instead
of what's specified by the `gnus-refer-thread-limit' variable."
(interactive "P")
- (gnus-set-global-variables)
(let ((id (mail-header-id (gnus-summary-article-header)))
(limit (if limit (prefix-numeric-value limit)
gnus-refer-thread-limit))
(gnus-summary-article-sparse-p
(mail-header-number header))
(memq (mail-header-number header)
- gnus-newsgroup-limit))))
- (if (and header
- (or (not (gnus-summary-article-sparse-p
- (mail-header-number header)))
- sparse))
- (prog1
- ;; The article is present in the buffer, so we just go to it.
- (gnus-summary-goto-article
- (mail-header-number header) nil t)
- (when sparse
- (gnus-summary-update-article (mail-header-number header))))
+ gnus-newsgroup-limit)))
+ h)
+ (cond
+ ;; If the article is present in the buffer we just go to it.
+ ((and header
+ (or (not (gnus-summary-article-sparse-p
+ (mail-header-number header)))
+ sparse))
+ (prog1
+ (gnus-summary-goto-article
+ (mail-header-number header) nil t)
+ (when sparse
+ (gnus-summary-update-article (mail-header-number header)))))
+ (t
;; We fetch the article
(let ((gnus-override-method
(cond ((gnus-news-group-p gnus-newsgroup-name)
;; Fetch the header, and display the article.
(if (setq number (gnus-summary-insert-subject message-id))
(gnus-summary-select-article nil nil nil number)
- (gnus-message 3 "Couldn't fetch article %s" message-id)))))))
+ (gnus-message 3 "Couldn't fetch article %s" message-id))))))))
(defun gnus-summary-enter-digest-group (&optional force)
"Enter an nndoc group based on the current article.
If FORCE, force a digest interpretation. If not, try
to guess what the document format is."
(interactive "P")
- (gnus-set-global-variables)
(let ((conf gnus-current-window-configuration))
(save-excursion
(gnus-summary-select-article))
"Do incremental search forward on the current article.
If REGEXP-P (the prefix) is non-nil, do regexp isearch."
(interactive "P")
- (gnus-set-global-variables)
(gnus-summary-select-article)
(gnus-configure-windows 'article)
(gnus-eval-in-buffer-window gnus-article-buffer
- ;;(goto-char (point-min))
- (isearch-forward regexp-p)))
+ (save-restriction
+ (widen)
+ (isearch-forward regexp-p))))
(defun gnus-summary-search-article-forward (regexp &optional backward)
"Search for an article containing REGEXP forward.
(concat ", default " gnus-last-search-regexp)
"")))
current-prefix-arg))
- (gnus-set-global-variables)
(if (string-equal regexp "")
(setq regexp (or gnus-last-search-regexp ""))
(setq gnus-last-search-regexp regexp))
current-prefix-arg))
(when (equal header "Body")
(setq header ""))
- (gnus-set-global-variables)
;; Hidden thread subtrees must be searched as well.
(gnus-summary-show-all-threads)
;; We don't want to change current point nor window configuration.
(defun gnus-summary-beginning-of-article ()
"Scroll the article back to the beginning."
(interactive)
- (gnus-set-global-variables)
(gnus-summary-select-article)
(gnus-configure-windows 'article)
(gnus-eval-in-buffer-window gnus-article-buffer
(defun gnus-summary-end-of-article ()
"Scroll to the end of the article."
(interactive)
- (gnus-set-global-variables)
(gnus-summary-select-article)
(gnus-configure-windows 'article)
(gnus-eval-in-buffer-window gnus-article-buffer
If ARG (the prefix) is non-nil, show the raw article without any
article massaging functions being run."
(interactive "P")
- (gnus-set-global-variables)
(if (not arg)
;; Select the article the normal way.
(gnus-summary-select-article nil 'force)
If ARG is a positive number, turn header display on.
If ARG is a negative number, turn header display off."
(interactive "P")
- (gnus-set-global-variables)
(setq gnus-show-all-headers
(cond ((or (not (numberp arg))
(zerop arg))
If ARG is a positive number, show the entire header.
If ARG is a negative number, hide the unwanted header lines."
(interactive "P")
- (gnus-set-global-variables)
(save-excursion
(set-buffer gnus-article-buffer)
(let* ((buffer-read-only nil)
(defun gnus-summary-show-all-headers ()
"Make all header lines visible."
(interactive)
- (gnus-set-global-variables)
(gnus-article-show-all-headers))
(defun gnus-summary-toggle-mime (&optional arg)
"Toggle MIME processing.
If ARG is a positive number, turn MIME processing on."
(interactive "P")
- (gnus-set-global-variables)
(setq gnus-show-mime
(if (null arg) (not gnus-show-mime)
(> (prefix-numeric-value arg) 0)))
The numerical prefix specifies how many places to rotate each letter
forward."
(interactive "P")
- (gnus-set-global-variables)
(gnus-summary-select-article)
(let ((mail-header-separator ""))
(gnus-eval-in-buffer-window gnus-article-buffer
(defun gnus-summary-stop-page-breaking ()
"Stop page breaking in the current article."
(interactive)
- (gnus-set-global-variables)
(gnus-summary-select-article)
(gnus-eval-in-buffer-window gnus-article-buffer
(widen)
(interactive "P")
(unless action
(setq action 'move))
- (gnus-set-global-variables)
;; Disable marking as read.
(let (gnus-mark-article-hook)
(save-window-excursion
(let ((ms-alist (mapcar (lambda (m) (cons (cadr m) m)) ms)))
(cdr (assoc (completing-read "Server name: " ms-alist nil t)
ms-alist))))))))
- (gnus-set-global-variables)
(unless method
(error "No method given for respooling"))
(if (assoc (symbol-name
(defun gnus-summary-import-article (file)
"Import a random file into a mail newsgroup."
(interactive "fImport file: ")
- (gnus-set-global-variables)
(let ((group gnus-newsgroup-name)
(now (current-time))
atts lines)
(defun gnus-summary-expire-articles (&optional now)
"Expire all articles that are marked as expirable in the current group."
(interactive)
- (gnus-set-global-variables)
(when (gnus-check-backend-function
'request-expire-articles gnus-newsgroup-name)
;; This backend supports expiry.
This means that *all* articles that are marked as expirable will be
deleted forever, right now."
(interactive)
- (gnus-set-global-variables)
(or gnus-expert-user
(gnus-yes-or-no-p
"Are you really, really, really sure you want to delete all these messages? ")
If N is nil and articles have been marked with the process mark,
delete these instead."
(interactive "P")
- (gnus-set-global-variables)
(unless (gnus-check-backend-function 'request-expire-articles
gnus-newsgroup-name)
(error "The current newsgroup does not support article deletion"))
(defun gnus-summary-respool-query (&optional silent)
"Query where the respool algorithm would put this article."
(interactive)
- (gnus-set-global-variables)
(let (gnus-mark-article-hook)
(gnus-summary-select-article)
(save-excursion
If UNMARK is positive, remove any kind of mark.
If UNMARK is negative, tick articles."
(interactive "P")
- (gnus-set-global-variables)
(when unmark
(setq unmark (prefix-numeric-value unmark)))
(let ((count
If UNMARK is positive, remove any kind of mark.
If UNMARK is negative, tick articles."
(interactive "P")
- (gnus-set-global-variables)
(when unmark
(setq unmark (prefix-numeric-value unmark)))
(let ((count
the process mark instead. The difference between N and the actual
number of articles marked is returned."
(interactive "p")
- (gnus-set-global-variables)
(let ((backward (< n 0))
(n (abs n)))
(while (and
If N is negative, unmark backward instead. The difference between N and
the actual number of articles unmarked is returned."
(interactive "p")
- (gnus-set-global-variables)
(gnus-summary-mark-as-processable n t))
(defun gnus-summary-unmark-all-processable ()
"Remove the process mark from all articles."
(interactive)
- (gnus-set-global-variables)
(save-excursion
(while gnus-newsgroup-processable
(gnus-summary-remove-process-mark (car gnus-newsgroup-processable))))
If N is negative, mark backward instead. The difference between N and
the actual number of articles marked is returned."
(interactive "p")
- (gnus-set-global-variables)
(gnus-summary-mark-forward n gnus-expirable-mark))
(defun gnus-summary-mark-article-as-replied (article)
(defun gnus-summary-set-bookmark (article)
"Set a bookmark in current article."
- (interactive (gnus-summary-article-number))
- (gnus-set-global-variables)
+ (interactive (list (gnus-summary-article-number)))
(when (or (not (get-buffer gnus-article-buffer))
(not gnus-current-article)
(not gnus-article-current)
(defun gnus-summary-remove-bookmark (article)
"Remove the bookmark from the current article."
- (interactive (gnus-summary-article-number))
- (gnus-set-global-variables)
+ (interactive (list (gnus-summary-article-number)))
;; Remove old bookmark, if one exists.
(let ((old (assq article gnus-newsgroup-bookmarks)))
(if old
If N is negative, mark backward instead. The difference between N and
the actual number of articles marked is returned."
(interactive "p")
- (gnus-set-global-variables)
(gnus-summary-mark-forward n gnus-dormant-mark))
(defun gnus-summary-set-process-mark (article)
The difference between N and the actual number of articles marked is
returned."
(interactive "p")
- (gnus-set-global-variables)
(let ((backward (< n 0))
(gnus-summary-goto-unread
(and gnus-summary-goto-unread
(defun gnus-summary-mark-article-as-unread (mark)
"Mark the current article quickly as unread with MARK."
(let ((article (gnus-summary-article-number)))
- (if (< article 0)
- (gnus-error 1 "Unmarkable article")
+ (if (<= article 0)
+ (progn
+ (gnus-error 1 "Can't mark negative article numbers")
+ nil)
(setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked))
(setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant))
(setq gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable))
(= mark gnus-dormant-mark) (= mark gnus-unread-mark))))
;; Fix the mark.
- (gnus-summary-update-mark mark 'unread))
- t))
+ (gnus-summary-update-mark mark 'unread)
+ t)))
(defun gnus-summary-mark-article (&optional article mark no-expire)
"Mark ARTICLE with MARK. MARK can be any character.
(article (or article (gnus-summary-article-number))))
(unless article
(error "No article on current line"))
- (if (or (= mark gnus-unread-mark)
- (= mark gnus-ticked-mark)
- (= mark gnus-dormant-mark))
- (gnus-mark-article-as-unread article mark)
- (gnus-mark-article-as-read article mark))
-
- ;; See whether the article is to be put in the cache.
- (and gnus-use-cache
- (not (= mark gnus-canceled-mark))
- (vectorp (gnus-summary-article-header article))
- (save-excursion
- (gnus-cache-possibly-enter-article
- gnus-newsgroup-name article
- (gnus-summary-article-header article)
- (= mark gnus-ticked-mark)
- (= mark gnus-dormant-mark) (= mark gnus-unread-mark))))
+ (if (not (if (or (= mark gnus-unread-mark)
+ (= mark gnus-ticked-mark)
+ (= mark gnus-dormant-mark))
+ (gnus-mark-article-as-unread article mark)
+ (gnus-mark-article-as-read article mark)))
+ t
+ ;; See whether the article is to be put in the cache.
+ (and gnus-use-cache
+ (not (= mark gnus-canceled-mark))
+ (vectorp (gnus-summary-article-header article))
+ (save-excursion
+ (gnus-cache-possibly-enter-article
+ gnus-newsgroup-name article
+ (gnus-summary-article-header article)
+ (= mark gnus-ticked-mark)
+ (= mark gnus-dormant-mark) (= mark gnus-unread-mark))))
- (when (gnus-summary-goto-subject article nil t)
- (let ((buffer-read-only nil))
- (gnus-summary-show-thread)
- ;; Fix the mark.
- (gnus-summary-update-mark mark 'unread)
- t))))
+ (when (gnus-summary-goto-subject article nil t)
+ (let ((buffer-read-only nil))
+ (gnus-summary-show-thread)
+ ;; Fix the mark.
+ (gnus-summary-update-mark mark 'unread)
+ t)))))
(defun gnus-summary-update-secondary-mark (article)
"Update the secondary (read, process, cache) mark."
(defun gnus-mark-article-as-unread (article &optional mark)
"Enter ARTICLE in the pertinent lists and remove it from others."
(let ((mark (or mark gnus-ticked-mark)))
- (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked)
- gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant)
- gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable)
- gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads))
+ (if (<= article 0)
+ (progn
+ (gnus-error 1 "Can't mark negative article numbers")
+ nil)
+ (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked)
+ gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant)
+ gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable)
+ gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads))
- ;; Unsuppress duplicates?
- (when gnus-suppress-duplicates
- (gnus-dup-unsuppress-article article))
-
- (cond ((= mark gnus-ticked-mark)
- (push article gnus-newsgroup-marked))
- ((= mark gnus-dormant-mark)
- (push article gnus-newsgroup-dormant))
- (t
- (push article gnus-newsgroup-unreads)))
- (setq gnus-newsgroup-reads
- (delq (assq article gnus-newsgroup-reads)
- gnus-newsgroup-reads))))
+ ;; Unsuppress duplicates?
+ (when gnus-suppress-duplicates
+ (gnus-dup-unsuppress-article article))
+
+ (cond ((= mark gnus-ticked-mark)
+ (push article gnus-newsgroup-marked))
+ ((= mark gnus-dormant-mark)
+ (push article gnus-newsgroup-dormant))
+ (t
+ (push article gnus-newsgroup-unreads)))
+ (setq gnus-newsgroup-reads
+ (delq (assq article gnus-newsgroup-reads)
+ gnus-newsgroup-reads))
+ t)))
(defalias 'gnus-summary-mark-as-unread-forward
'gnus-summary-tick-article-forward)
(defun gnus-summary-mark-below (score mark)
"Mark articles with score less than SCORE with MARK."
(interactive "P\ncMark: ")
- (gnus-set-global-variables)
(setq score (if score
(prefix-numeric-value score)
(or gnus-summary-default-score 0)))
(defun gnus-summary-kill-below (&optional score)
"Mark articles with score below SCORE as read."
(interactive "P")
- (gnus-set-global-variables)
(gnus-summary-mark-below score gnus-killed-mark))
(defun gnus-summary-clear-above (&optional score)
"Clear all marks from articles with score above SCORE."
(interactive "P")
- (gnus-set-global-variables)
(gnus-summary-mark-above score gnus-unread-mark))
(defun gnus-summary-tick-above (&optional score)
"Tick all articles with score above SCORE."
(interactive "P")
- (gnus-set-global-variables)
(gnus-summary-mark-above score gnus-ticked-mark))
(defun gnus-summary-mark-above (score mark)
"Mark articles with score over SCORE with MARK."
(interactive "P\ncMark: ")
- (gnus-set-global-variables)
(setq score (if score
(prefix-numeric-value score)
(or gnus-summary-default-score 0)))
(defun gnus-summary-limit-include-expunged (&optional no-error)
"Display all the hidden articles that were expunged for low scores."
(interactive)
- (gnus-set-global-variables)
(let ((buffer-read-only nil))
(let ((scored gnus-newsgroup-scored)
headers h)
in the current summary buffer limitation.
The number of articles marked as read is returned."
(interactive "P")
- (gnus-set-global-variables)
(prog1
(save-excursion
(when (or quietly
"Mark all unticked articles before the current one as read.
If ALL is non-nil, also mark ticked and dormant articles as read."
(interactive "P")
- (gnus-set-global-variables)
(save-excursion
(gnus-save-hidden-threads
(let ((beg (point)))
(defun gnus-summary-catchup-all (&optional quietly)
"Mark all articles in this newsgroup as read."
(interactive "P")
- (gnus-set-global-variables)
(gnus-summary-catchup t quietly))
(defun gnus-summary-catchup-and-exit (&optional all quietly)
"Mark all articles not marked as unread in this newsgroup as read, then exit.
If prefix argument ALL is non-nil, all articles are marked as read."
(interactive "P")
- (gnus-set-global-variables)
(when (gnus-summary-catchup all quietly nil 'fast)
;; Select next newsgroup or exit.
(if (eq gnus-auto-select-next 'quietly)
(defun gnus-summary-catchup-all-and-exit (&optional quietly)
"Mark all articles in this newsgroup as read, and then exit."
(interactive "P")
- (gnus-set-global-variables)
(gnus-summary-catchup-and-exit t quietly))
;; Suggested by "Arne Eofsson" <arne@hodgkin.mbi.ucla.edu>.
If given a prefix, mark all articles, unread as well as ticked, as
read."
(interactive "P")
- (gnus-set-global-variables)
(save-excursion
(gnus-summary-catchup all))
(gnus-summary-next-article t nil nil t))
(defun gnus-summary-rethread-current ()
"Rethread the thread the current article is part of."
(interactive)
- (gnus-set-global-variables)
(let* ((gnus-show-threads t)
(article (gnus-summary-article-number))
(id (mail-header-id (gnus-summary-article-header)))
(nnheader-temp-write nil
(insert buf)
(goto-char (point-min))
- (if (search-forward-regexp "^References: " nil t)
- (insert message-id " " )
+ (if (re-search-forward "^References: " nil t)
+ (progn
+ (re-search-forward "^[^ \t]" nil t)
+ (forward-line -1)
+ (end-of-line)
+ (insert " " message-id))
(insert "References: " message-id "\n"))
(unless (gnus-request-replace-article
current-article (car gnus-article-current)
(error "Couldn't replace article"))))
(set-buffer gnus-summary-buffer)
(gnus-summary-unmark-all-processable)
+ (gnus-summary-update-article current-article)
(gnus-summary-rethread-current)
(gnus-message 3 "Article %d is now the child of article %d"
current-article parent-article)))))
"Toggle showing conversation threads.
If ARG is positive number, turn showing conversation threads on."
(interactive "P")
- (gnus-set-global-variables)
(let ((current (or (gnus-summary-article-number) gnus-newsgroup-end)))
(setq gnus-show-threads
(if (null arg) (not gnus-show-threads)
(defun gnus-summary-show-all-threads ()
"Show all threads."
(interactive)
- (gnus-set-global-variables)
(save-excursion
(let ((buffer-read-only nil))
(subst-char-in-region (point-min) (point-max) ?\^M ?\n t)))
"Show thread subtrees.
Returns nil if no thread was there to be shown."
(interactive)
- (gnus-set-global-variables)
(let ((buffer-read-only nil)
(orig (point))
;; first goto end then to beg, to have point at beg after let
(defun gnus-summary-hide-all-threads ()
"Hide all thread subtrees."
(interactive)
- (gnus-set-global-variables)
(save-excursion
(goto-char (point-min))
(gnus-summary-hide-thread)
"Hide thread subtrees.
Returns nil if no threads were there to be hidden."
(interactive)
- (gnus-set-global-variables)
(let ((buffer-read-only nil)
(start (point))
(article (gnus-summary-article-number)))
If SILENT, don't output messages."
(interactive "p")
- (gnus-set-global-variables)
(let ((backward (< n 0))
(n (abs n)))
(while (and (> n 0)
Returns the difference between N and the number of skips actually
done."
(interactive "p")
- (gnus-set-global-variables)
(gnus-summary-next-thread (- n)))
(defun gnus-summary-go-down-thread ()
Returns the difference between N and how many steps down that were
taken."
(interactive "p")
- (gnus-set-global-variables)
(let ((up (< n 0))
(n (abs n)))
(while (and (> n 0)
Returns the difference between N and how many steps down that were
taken."
(interactive "p")
- (gnus-set-global-variables)
(gnus-summary-down-thread (- n)))
(defun gnus-summary-top-thread ()
"Go to the top of the thread."
(interactive)
- (gnus-set-global-variables)
(while (gnus-summary-go-up-thread))
(gnus-summary-article-number))
If the prefix argument is positive, remove any kinds of marks.
If the prefix argument is negative, tick articles instead."
(interactive "P")
- (gnus-set-global-variables)
(when unmark
(setq unmark (prefix-numeric-value unmark)))
(let ((articles (gnus-summary-articles-in-thread)))
(defun gnus-summary-sort (predicate reverse)
"Sort summary buffer by PREDICATE. REVERSE means reverse order."
- (gnus-set-global-variables)
(let* ((thread (intern (format "gnus-thread-sort-by-%s" predicate)))
(article (intern (format "gnus-article-sort-by-%s" predicate)))
(gnus-thread-sort-functions
save those articles instead.
The variable `gnus-default-article-saver' specifies the saver function."
(interactive "P")
- (gnus-set-global-variables)
(let* ((articles (gnus-summary-work-articles n))
(save-buffer (save-excursion
(nnheader-set-temp-buffer " *Gnus Save*")))
If N is nil and any articles have been marked with the process mark,
pipe those articles instead."
(interactive "P")
- (gnus-set-global-variables)
(let ((gnus-default-article-saver 'gnus-summary-save-in-pipe))
(gnus-summary-save-article arg t))
(gnus-configure-windows 'pipe))
If N is nil and any articles have been marked with the process mark,
save those articles instead."
(interactive "P")
- (gnus-set-global-variables)
(let ((gnus-default-article-saver 'gnus-summary-save-in-mail))
(gnus-summary-save-article arg)))
If N is nil and any articles have been marked with the process mark,
save those articles instead."
(interactive "P")
- (gnus-set-global-variables)
(let ((gnus-default-article-saver 'gnus-summary-save-in-rmail))
(gnus-summary-save-article arg)))
If N is nil and any articles have been marked with the process mark,
save those articles instead."
(interactive "P")
- (gnus-set-global-variables)
(let ((gnus-default-article-saver 'gnus-summary-save-in-file))
(gnus-summary-save-article arg)))
If N is nil and any articles have been marked with the process mark,
save those articles instead."
(interactive "P")
- (gnus-set-global-variables)
(let ((gnus-default-article-saver 'gnus-summary-write-to-file))
(gnus-summary-save-article arg)))
If N is nil and any articles have been marked with the process mark,
save those articles instead."
(interactive "P")
- (gnus-set-global-variables)
(let ((gnus-default-article-saver 'gnus-summary-save-body-in-file))
(gnus-summary-save-article arg)))
(defun gnus-summary-pipe-message (program)
"Pipe the current article through PROGRAM."
(interactive "sProgram: ")
- (gnus-set-global-variables)
(gnus-summary-select-article)
(let ((mail-header-separator "")
(art-buf (get-buffer gnus-article-buffer)))
(defun gnus-summary-edit-global-kill (article)
"Edit the \"global\" kill file."
- (interactive (gnus-summary-article-number))
- (gnus-set-global-variables)
+ (interactive (list (gnus-summary-article-number)))
(gnus-group-edit-global-kill article))
(defun gnus-summary-edit-local-kill ()
"Edit a local kill file applied to the current newsgroup."
(interactive)
- (gnus-set-global-variables)
(setq gnus-current-headers (gnus-summary-article-header))
- (gnus-set-global-variables)
(gnus-group-edit-local-kill
(gnus-summary-article-number) gnus-newsgroup-name))
(not (gnus-summary-article-sparse-p (mail-header-number header))))
;; We have found the header.
header
+ ;; If this is a sparse article, we have to nix out its
+ ;; previous entry in the thread hashtb.
+ (when (and header
+ (gnus-summary-article-sparse-p (mail-header-number header)))
+ (let ((thread (gnus-gethash
+ (gnus-parent-id (mail-header-references header))
+ gnus-newsgroup-dependencies)))
+ (delq (assq header thread) thread)))
;; We have to really fetch the header to this article.
(save-excursion
(set-buffer nntp-server-buffer)