-;;; gnus-sum.el --- summary mode commands for Semi-gnus
-;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
-;; Free Software Foundation, Inc.
+;;; gnus-sum.el --- summary mode commands for gnus
+
+;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+;; 2005 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
;;; Commentary:
(defcustom gnus-summary-make-false-root-always nil
"Always make a false dummy root."
- :version "21.4"
+ :version "22.1"
:group 'gnus-thread
:type 'boolean)
"*Default threshold for a high scored article.
An article will be highlighted as high scored if its score is greater
than this score."
- :version "21.4"
+ :version "22.1"
:group 'gnus-score-default
:type 'integer)
"*Default threshold for a low scored article.
An article will be highlighted as low scored if its score is smaller
than this score."
- :version "21.4"
+ :version "22.1"
:group 'gnus-score-default
:type 'integer)
"*If non-nil, hide all threads initially.
This can be a predicate specifier which says which threads to hide.
If threads are hidden, you have to run the command
-`gnus-summary-show-thread' by hand or use `gnus-select-article-hook'
-to expose hidden threads."
+`gnus-summary-show-thread' by hand or or select an article."
:group 'gnus-thread
:type '(radio (sexp :format "Non-nil\n"
:match (lambda (widget value)
(not (or (consp value) (functionp value))))
:value t)
(const nil)
- (sexp :tag "Predicate specifier" :size 0)))
+ (sexp :tag "Predicate specifier")))
(defcustom gnus-thread-hide-killed t
"*If non-nil, hide killed threads automatically."
first subject), `unread' (place point on the subject line of the first
unread article), `best' (place point on the subject line of the
higest-scored article), `unseen' (place point on the subject line of
-the first unseen article), 'unseen-or-unread' (place point on the subject
+the first unseen article), `unseen-or-unread' (place point on the subject
line of the first unseen article or, if all article have been seen, on the
subject line of the first unread article), or a function to be called to
place point on some subject line."
- :version "21.4"
+ :version "22.1"
:group 'gnus-group-select
:type '(choice (const best)
(const unread)
NOTE: The list of unfetched articles will always be nil when plugged
and, when unplugged, a subset of the undownloaded article list."
- :version "21.4"
+ :version "22.1"
:group 'gnus-summary-maneuvering
:type '(choice (const :tag "None" nil)
(const :tag "Undownloaded when unplugged" undownloaded)
:group 'gnus-summary-mail
:type 'function)
+;; FIXME: Although the custom type is `character' for the following variables,
+;; using multibyte characters (Latin-1, UTF-8) doesn't work. -- rs
+
(defcustom gnus-unread-mark ?\ ;;;Whitespace
"*Mark used for unread articles."
:group 'gnus-summary-marks
(defcustom gnus-spam-mark ?$
"*Mark used for spam articles."
+ :version "22.1"
:group 'gnus-summary-marks
:type 'character)
(defcustom gnus-forwarded-mark ?F
"*Mark used for articles that have been forwarded."
- :version "21.4"
+ :version "22.1"
:group 'gnus-summary-marks
:type 'character)
(defcustom gnus-recent-mark ?N
"*Mark used for articles that are recent."
+ :version "22.1"
:group 'gnus-summary-marks
:type 'character)
(defcustom gnus-unseen-mark ?.
"*Mark used for articles that haven't been seen."
- :version "21.4"
+ :version "22.1"
:group 'gnus-summary-marks
:type 'character)
(defcustom gnus-no-mark ?\ ;;;Whitespace
"*Mark used for articles that have no other secondary mark."
- :version "21.4"
+ :version "22.1"
:group 'gnus-summary-marks
:type 'character)
(defcustom gnus-undownloaded-mark ?-
"*Mark used for articles that weren't downloaded."
+ :version "22.1"
:group 'gnus-summary-marks
:type 'character)
(defcustom gnus-summary-article-move-hook nil
"*A hook called after an article is moved, copied, respooled, or crossposted."
+ :version "22.1"
:group 'gnus-summary
:type 'hook)
(defcustom gnus-summary-article-delete-hook nil
"*A hook called after an article is deleted."
+ :version "22.1"
:group 'gnus-summary
:type 'hook)
(defcustom gnus-summary-article-expire-hook nil
"*A hook called after an article is expired."
+ :version "22.1"
:group 'gnus-summary
:type 'hook)
(and (fboundp 'display-graphic-p)
(display-graphic-p))
"*If non-nil, display an arrow highlighting the current article."
- :version "21.4"
+ :version "22.1"
:group 'gnus-summary
:type 'boolean)
-(defcustom gnus-summary-selected-face 'gnus-summary-selected-face
+(defcustom gnus-summary-selected-face 'gnus-summary-selected
"Face used for highlighting the current article in the summary buffer."
:group 'gnus-summary-visual
:type 'face)
(defcustom gnus-summary-highlight
'(((eq mark gnus-canceled-mark)
- . gnus-summary-cancelled-face)
+ . gnus-summary-cancelled)
((and uncached (> score default-high))
- . gnus-summary-high-undownloaded-face)
+ . gnus-summary-high-undownloaded)
((and uncached (< score default-low))
- . gnus-summary-low-undownloaded-face)
+ . gnus-summary-low-undownloaded)
(uncached
- . gnus-summary-normal-undownloaded-face)
+ . gnus-summary-normal-undownloaded)
((and (> score default-high)
(or (eq mark gnus-dormant-mark)
(eq mark gnus-ticked-mark)))
- . gnus-summary-high-ticked-face)
+ . gnus-summary-high-ticked)
((and (< score default-low)
(or (eq mark gnus-dormant-mark)
(eq mark gnus-ticked-mark)))
- . gnus-summary-low-ticked-face)
+ . gnus-summary-low-ticked)
((or (eq mark gnus-dormant-mark)
(eq mark gnus-ticked-mark))
- . gnus-summary-normal-ticked-face)
+ . gnus-summary-normal-ticked)
((and (> score default-high) (eq mark gnus-ancient-mark))
- . gnus-summary-high-ancient-face)
+ . gnus-summary-high-ancient)
((and (< score default-low) (eq mark gnus-ancient-mark))
- . gnus-summary-low-ancient-face)
+ . gnus-summary-low-ancient)
((eq mark gnus-ancient-mark)
- . gnus-summary-normal-ancient-face)
+ . gnus-summary-normal-ancient)
((and (> score default-high) (eq mark gnus-unread-mark))
- . gnus-summary-high-unread-face)
+ . gnus-summary-high-unread)
((and (< score default-low) (eq mark gnus-unread-mark))
- . gnus-summary-low-unread-face)
+ . gnus-summary-low-unread)
((eq mark gnus-unread-mark)
- . gnus-summary-normal-unread-face)
+ . gnus-summary-normal-unread)
((> score default-high)
- . gnus-summary-high-read-face)
+ . gnus-summary-high-read)
((< score default-low)
- . gnus-summary-low-read-face)
+ . gnus-summary-low-read)
(t
- . gnus-summary-normal-read-face))
+ . gnus-summary-normal-read))
"*Controls the highlighting of summary buffer lines.
A list of (FORM . FACE) pairs. When deciding how a a particular
:group 'gnus-summary
:type 'regexp)
+(defcustom gnus-summary-to-prefix "-> "
+ "*String prefixed to the To field in the summary line when
+using `gnus-ignored-from-addresses'."
+ :version "22.1"
+ :group 'gnus-summary
+ :type 'string)
+
+(defcustom gnus-summary-newsgroup-prefix "=> "
+ "*String prefixed to the Newsgroup field in the summary
+line when using `gnus-ignored-from-addresses'."
+ :version "22.1"
+ :group 'gnus-summary
+ :type 'string)
+
(defcustom gnus-newsgroup-ignored-charsets '(unknown-8bit x-unknown)
"List of charsets that should be ignored.
When these charsets are used in the \"charset\" parameter, the
This is mostly relevant for slow back ends where the user may
wish to widen the summary buffer to include all headers
that were fetched. Say, for nnultimate groups."
+ :version "22.1"
:group 'gnus-summary
:type '(choice boolean regexp))
(defcustom gnus-summary-muttprint-program "muttprint"
"Command (and optional arguments) used to run Muttprint."
- :version "21.4"
+ :version "22.1"
:group 'gnus-summary
:type 'string)
supply the MIME-Version header or deliberately strip it from the mail.
If non-nil (the default), Gnus will treat some articles as MIME
even if the MIME-Version header is missing."
- :version "21.4"
+ :version "22.1"
:type 'boolean
:group 'gnus-article-mime)
This means that Gnus will search message bodies for text that look
like uuencoded bits, yEncoded bits, and so on, and present that using
the normal Gnus MIME machinery."
- :version "21.4"
+ :version "22.1"
:type 'boolean
:group 'gnus-article-mime)
"\C-c\C-s\C-l" gnus-summary-sort-by-lines
"\C-c\C-s\C-c" gnus-summary-sort-by-chars
"\C-c\C-s\C-a" gnus-summary-sort-by-author
+ "\C-c\C-s\C-t" gnus-summary-sort-by-recipient
"\C-c\C-s\C-s" gnus-summary-sort-by-subject
"\C-c\C-s\C-d" gnus-summary-sort-by-date
"\C-c\C-s\C-i" gnus-summary-sort-by-score
"Q" gnus-summary-exit-no-update
"\C-c\C-i" gnus-info-find-node
gnus-mouse-2 gnus-mouse-pick-article
+ [follow-link] mouse-face
"m" gnus-summary-mail-other-window
"a" gnus-summary-post-news
"i" gnus-summary-news-other-window
"C" gnus-summary-limit-mark-excluded-as-read
"o" gnus-summary-insert-old-articles
"N" gnus-summary-insert-new-articles
- "r" gnus-summary-limit-to-replied)
+ "r" gnus-summary-limit-to-replied
+ "R" gnus-summary-limit-to-recipient)
(gnus-define-keys (gnus-summary-goto-map "G" gnus-summary-mode-map)
"n" gnus-summary-next-unread-article
"m" gnus-summary-toggle-mime
"a" gnus-article-strip-headers-in-body ;; mnemonic: wash archive
"p" gnus-article-verify-x-pgp-sig
- "d" gnus-article-treat-dumbquotes)
+ "d" gnus-article-treat-dumbquotes
+ "i" gnus-summary-idna-message)
(gnus-define-keys (gnus-summary-wash-deuglify-map "Y" gnus-summary-wash-map)
;; mnemonic: deuglif*Y*
"m" gnus-summary-repair-multipart
"v" gnus-article-view-part
"o" gnus-article-save-part
+ "O" gnus-article-save-part-and-strip
+ "d" gnus-article-delete-part
+ "j" gnus-article-jump-to-part
"c" gnus-article-copy-part
"C" gnus-article-view-part-as-charset
"e" gnus-article-view-part-externally
["Rot 13" gnus-summary-caesar-message
,@(if (featurep 'xemacs) '(t)
'(:help "\"Caesar rotate\" article by 13"))]
+ ["De-IDNA" gnus-summary-idna-message t]
["Morse decode" gnus-summary-morse-message t]
["Unix pipe..." gnus-summary-pipe-message t]
["Add buttons" gnus-article-add-buttons t]
["Marks..." gnus-summary-limit-to-marks t]
["Subject..." gnus-summary-limit-to-subject t]
["Author..." gnus-summary-limit-to-author t]
+ ["Recipient..." gnus-summary-limit-to-recipient t]
["Age..." gnus-summary-limit-to-age t]
["Extra..." gnus-summary-limit-to-extra t]
["Score..." gnus-summary-limit-to-score t]
("Sort"
["Sort by number" gnus-summary-sort-by-number t]
["Sort by author" gnus-summary-sort-by-author t]
+ ["Sort by recipient" gnus-summary-sort-by-recipient t]
["Sort by subject" gnus-summary-sort-by-subject t]
["Sort by date" gnus-summary-sort-by-date t]
["Sort by score" gnus-summary-sort-by-score t]
(make-local-variable 'gnus-summary-mark-positions)
(gnus-make-local-hook 'pre-command-hook)
(add-hook 'pre-command-hook 'gnus-set-global-variables nil t)
- (gnus-run-hooks 'gnus-summary-mode-hook)
+ (gnus-run-mode-hooks 'gnus-summary-mode-hook)
(turn-on-gnus-mailing-list-mode)
(gnus-update-format-specifications nil 'summary 'summary-mode 'summary-dummy)
(gnus-update-summary-mark-positions))
(let ((locals gnus-summary-local-variables))
(while locals
(if (consp (car locals))
- (and (vectorp (caar locals))
+ (and (symbolp (caar locals))
(set (caar locals) nil))
- (and (vectorp (car locals))
+ (and (symbolp (car locals))
(set (car locals) nil)))
(setq locals (cdr locals)))))
(gnus-data-update-list odata offset)))
;; Find the last element in the list to be spliced into the main
;; list.
- (while (cdr list)
- (setq list (cdr list)))
+ (setq list (last list))
(if (not data)
(progn
(setcdr list gnus-newsgroup-data)
(save-excursion
(when (gnus-buffer-exists-p gnus-summary-buffer)
(set-buffer gnus-summary-buffer))
- (let ((gnus-replied-mark 129)
- (gnus-score-below-mark 130)
- (gnus-score-over-mark 130)
- (gnus-undownloaded-mark 131)
- (spec gnus-summary-line-format-spec)
- gnus-visual pos)
+ (let ((spec gnus-summary-line-format-spec)
+ pos)
(save-excursion
(gnus-set-work-buffer)
- (let ((gnus-summary-line-format-spec spec)
- (gnus-newsgroup-downloadable '(0)))
- (gnus-summary-insert-line
- (make-full-mail-header 0 "" "nobody"
- "05 Apr 2001 23:33:09 +0400"
- "" "" 0 0 "" nil)
- 0 nil t 128 t nil "" nil 1)
+ (let ((gnus-tmp-unread ?Z)
+ (gnus-replied-mark ?Z)
+ (gnus-score-below-mark ?Z)
+ (gnus-score-over-mark ?Z)
+ (gnus-undownloaded-mark ?Z)
+ (gnus-summary-line-format-spec spec)
+ (gnus-newsgroup-downloadable '(0))
+ (header
+ (make-full-mail-header
+ 0 "" "nobody" "05 Apr 2001 23:33:09 +0400" "" "" 0 0 "" nil))
+ case-fold-search ignores)
+ ;; Here, all marks are bound to Z.
+ (gnus-summary-insert-line header
+ 0 nil t gnus-tmp-unread t nil "" nil 1)
+ (goto-char (point-min))
+ ;; Memorize the positions of the same characters as dummy marks.
+ (while (re-search-forward "[A-D]" nil t)
+ (push (point) ignores))
+ (erase-buffer)
+ ;; We use A-D as dummy marks in order to know column positions
+ ;; where marks should be inserted.
+ (setq gnus-tmp-unread ?A
+ gnus-replied-mark ?B
+ gnus-score-below-mark ?C
+ gnus-score-over-mark ?C
+ gnus-undownloaded-mark ?D)
+ (gnus-summary-insert-line header
+ 0 nil t gnus-tmp-unread t nil "" nil 1)
+ ;; Ignore characters which aren't dummy marks.
+ (dolist (p ignores)
+ (delete-region (goto-char (1- p)) p)
+ (insert ?Z))
(goto-char (point-min))
- (setq pos (list (cons 'unread (and (search-forward "\200" nil t)
- (- (point) (point-min) 1)))))
+ (setq pos (list (cons 'unread
+ (and (search-forward "A" nil t)
+ (- (point) (point-min) 1)))))
(goto-char (point-min))
- (push (cons 'replied (and (search-forward "\201" nil t)
+ (push (cons 'replied (and (search-forward "B" nil t)
(- (point) (point-min) 1)))
pos)
(goto-char (point-min))
- (push (cons 'score (and (search-forward "\202" nil t)
+ (push (cons 'score (and (search-forward "C" nil t)
(- (point) (point-min) 1)))
pos)
(goto-char (point-min))
- (push (cons 'download
- (and (search-forward "\203" nil t)
- (- (point) (point-min) 1)))
+ (push (cons 'download (and (search-forward "D" nil t)
+ (- (point) (point-min) 1)))
pos)))
(setq gnus-summary-mark-positions pos))))
newsgroups)
(cond
((setq to (cdr (assq 'To extra-headers)))
- (concat "-> "
+ (concat gnus-summary-to-prefix
(inline
(gnus-summary-extract-address-component
(funcall gnus-decode-encoded-word-function to)))))
((setq newsgroups (cdr (assq 'Newsgroups extra-headers)))
- (concat "=> " newsgroups)))))
+ (concat gnus-summary-newsgroup-prefix newsgroups)))))
(inline (gnus-summary-extract-address-component gnus-tmp-from)))))
(defun gnus-summary-insert-line (gnus-tmp-header
(defun gnus-summary-set-local-parameters (group)
"Go through the local params of GROUP and set all variable specs in that list."
- (let ((params (gnus-group-find-parameter group))
- (vars '(quit-config)) ; Ignore quit-config.
- elem)
- (while params
- (setq elem (car params)
- params (cdr params))
+ (let ((vars '(quit-config))) ; Ignore quit-config.
+ (dolist (elem (gnus-group-find-parameter group))
(and (consp elem) ; Has to be a cons.
(consp (cdr elem)) ; The cdr has to be a list.
(symbolp (car elem)) ; Has to be a symbol in there.
(gnus-active gnus-newsgroup-name)))
;; You can change the summary buffer in some way with this hook.
(gnus-run-hooks 'gnus-select-group-hook)
- (gnus-update-format-specifications
- nil 'summary 'summary-mode 'summary-dummy)
- (gnus-update-summary-mark-positions)
+ (when (memq 'summary (gnus-update-format-specifications
+ nil 'summary 'summary-mode 'summary-dummy))
+ ;; The format specification for the summary line was updated,
+ ;; so we need to update the mark positions as well.
+ (gnus-update-summary-mark-positions))
;; Do score processing.
(when gnus-use-scoring
(gnus-possibly-score-headers))
(gnus-article-sort-by-author
(gnus-thread-header h1) (gnus-thread-header h2)))
+(defsubst gnus-article-sort-by-recipient (h1 h2)
+ "Sort articles by recipient."
+ (string-lessp
+ (let ((extract (funcall
+ gnus-extract-address-components
+ (or (cdr (assq 'To (mail-header-extra h1))) ""))))
+ (or (car extract) (cadr extract)))
+ (let ((extract (funcall
+ gnus-extract-address-components
+ (or (cdr (assq 'To (mail-header-extra h2))) ""))))
+ (or (car extract) (cadr extract)))))
+
(defsubst gnus-article-sort-by-subject (h1 h2)
"Sort articles by root subject."
(string-lessp
(defcustom gnus-sum-thread-tree-root "> "
"With %B spec, used for the root of a thread.
If nil, use subject instead."
- :version "21.4"
- :type '(radio (const :format "%v " nil) (string :size 0))
+ :version "22.1"
+ :type '(radio (const :format "%v " nil) string)
:group 'gnus-thread)
(defcustom gnus-sum-thread-tree-false-root "> "
"With %B spec, used for a false root of a thread.
If nil, use subject instead."
- :version "21.4"
- :type '(radio (const :format "%v " nil) (string :size 0))
+ :version "22.1"
+ :type '(radio (const :format "%v " nil) string)
:group 'gnus-thread)
(defcustom gnus-sum-thread-tree-single-indent ""
"With %B spec, used for a thread with just one message.
If nil, use subject instead."
- :version "21.4"
- :type '(radio (const :format "%v " nil) (string :size 0))
+ :version "22.1"
+ :type '(radio (const :format "%v " nil) string)
:group 'gnus-thread)
(defcustom gnus-sum-thread-tree-vertical "| "
"With %B spec, used for drawing a vertical line."
- :version "21.4"
+ :version "22.1"
:type 'string
:group 'gnus-thread)
(defcustom gnus-sum-thread-tree-indent " "
"With %B spec, used for indenting."
- :version "21.4"
+ :version "22.1"
:type 'string
:group 'gnus-thread)
(defcustom gnus-sum-thread-tree-leaf-with-other "+-> "
"With %B spec, used for a leaf with brothers."
- :version "21.4"
+ :version "22.1"
:type 'string
:group 'gnus-thread)
(defcustom gnus-sum-thread-tree-single-leaf "\\-> "
"With %B spec, used for a leaf without brothers."
- :version "21.4"
+ :version "22.1"
:type 'string
:group 'gnus-thread)
(when gnus-agent
(gnus-agent-possibly-alter-active group (gnus-active group) info)
-
+
(setq gnus-summary-use-undownloaded-faces
(gnus-agent-find-parameter
group
(match-end 1)))
(substring xrefs (match-beginning 1) (match-end 1))))
(setq number
- (string-to-int (substring xrefs (match-beginning 2)
+ (string-to-number (substring xrefs (match-beginning 2)
(match-end 2))))
(if (setq entry (gnus-gethash group xref-hashtb))
(setcdr entry (cons number (cdr entry)))
;; Remove list identifiers from subject.
(when gnus-list-identifiers
(let ((gnus-newsgroup-headers (list header)))
- (gnus-summary-remove-list-identifiers)
- (setq header (car gnus-newsgroup-headers))))
+ (gnus-summary-remove-list-identifiers)))
(when old-header
(mail-header-set-number header (mail-header-number old-header)))
(setq gnus-newsgroup-sparse
(defun gnus-summary-process-mark-set (set)
"Make SET into the current process marked articles."
(gnus-summary-unmark-all-processable)
- (while set
- (gnus-summary-set-process-mark (pop set))))
+ (mapc 'gnus-summary-set-process-mark set))
;;; Searching and stuff
(defun gnus-list-of-unread-articles (group)
(let* ((read (gnus-info-read (gnus-get-info group)))
(active (or (gnus-active group) (gnus-activate-group group)))
- (last (cdr active))
+ (last (or (cdr active)
+ (error "Group %s couldn't be activated " group)))
first nlast unread)
;; If none are read, then all are unread.
(if (not read)
(gnus-summary-clear-local-variables))
(when (get-buffer gnus-article-buffer)
(bury-buffer gnus-article-buffer))
- ;; We clear the global counterparts of the buffer-local
- ;; variables as well, just to be on the safe side.
- (set-buffer gnus-group-buffer)
- (gnus-summary-clear-local-variables)
- (let ((gnus-summary-local-variables gnus-newsgroup-variables))
- (gnus-summary-clear-local-variables))
;; Return to group mode buffer.
(when (eq mode 'gnus-summary-mode)
(gnus-kill-buffer buf)))
(setq gnus-current-select-method gnus-select-method)
- (if leave-hidden
- (set-buffer gnus-group-buffer)
- (pop-to-buffer gnus-group-buffer))
- (if (not quit-config)
- (progn
- (goto-char group-point)
- (unless leave-hidden
- (gnus-configure-windows 'group 'force))
- (unless (pos-visible-in-window-p)
- (forward-line (/ (static-if (featurep 'xemacs)
- (window-displayed-height)
- (1- (window-height)))
- -2))
- (set-window-start (selected-window) (point))
- (goto-char group-point)))
- (gnus-handle-ephemeral-exit quit-config))
+ (set-buffer gnus-group-buffer)
+ (if quit-config
+ (gnus-handle-ephemeral-exit quit-config)
+ (goto-char group-point)
+ ;; If gnus-group-buffer is already displayed, make sure we also move
+ ;; the cursor in the window that displays it.
+ (let ((win (get-buffer-window (current-buffer) 0)))
+ (if win (set-window-point win (point))))
+ (unless leave-hidden
+ (gnus-configure-windows 'group 'force))
+ (unless (pos-visible-in-window-p)
+ (forward-line (/ (static-if (featurep 'xemacs)
+ (window-displayed-height)
+ (1- (window-height)))
+ -2))
+ (set-window-start (selected-window) (point))
+ (goto-char group-point)))
;; Clear the current group name.
(unless quit-config
(setq gnus-newsgroup-name nil)))))
(gnus-summary-clear-local-variables)
(let ((gnus-summary-local-variables gnus-newsgroup-variables))
(gnus-summary-clear-local-variables))
- (set-buffer gnus-group-buffer)
- (gnus-summary-clear-local-variables)
- (let ((gnus-summary-local-variables gnus-newsgroup-variables))
- (gnus-summary-clear-local-variables))
(gnus-kill-buffer gnus-summary-buffer))
(unless gnus-single-article-buffer
(setq gnus-article-current nil))
(gnus-summary-goto-subject article t)))
(gnus-summary-limit (append articles gnus-newsgroup-limit))
(gnus-summary-position-point))
-
+
(defun gnus-summary-goto-subject (article &optional force silent)
"Go the subject line of ARTICLE.
If FORCE, also allow jumping to articles not currently shown."
(let ((mm-verify-option 'known)
(mm-decrypt-option 'known)
(gnus-article-emulate-mime t)
- (mm-fill-flowed nil)
(gnus-buttonized-mime-types (append (list "multipart/signed"
"multipart/encrypted")
gnus-buttonized-mime-types)))
(if (and group
(not (gnus-ephemeral-group-p gnus-newsgroup-name)))
(format " (Type %s for %s [%s])"
- (single-key-description cmd) group
+ (single-key-description cmd)
+ (gnus-group-decoded-name group)
(gnus-group-unread group))
(format " (Type %s to exit %s)"
(single-key-description cmd)
- gnus-newsgroup-name))))
+ (gnus-group-decoded-name gnus-newsgroup-name)))))
;; Confirm auto selection.
(setq key (car (setq keve (gnus-read-event-char prompt)))
ended t)
current-prefix-arg))
(gnus-summary-limit-to-subject from "from" not-matching))
+(defun gnus-summary-limit-to-recipient (recipient &optional not-matching)
+ "Limit the summary buffer to articles with the given RECIPIENT.
+
+If NOT-MATCHING, exclude RECIPIENT.
+
+To and Cc headers are checked. You need to include them in
+`nnmail-extra-headers'."
+ ;; Unlike `rmail-summary-by-recipients', doesn't include From.
+ (interactive
+ (list (read-string (format "%s recipient (regexp): "
+ (if current-prefix-arg "Exclude" "Limit to")))
+ current-prefix-arg))
+ (when (not (equal "" recipient))
+ (prog1 (let* ((to
+ (if (memq 'To nnmail-extra-headers)
+ (gnus-summary-find-matching
+ (cons 'extra 'To) recipient 'all nil nil
+ not-matching)
+ (gnus-message
+ 1 "`To' isn't present in `nnmail-extra-headers'")
+ (sit-for 1)
+ nil))
+ (cc
+ (if (memq 'Cc nnmail-extra-headers)
+ (gnus-summary-find-matching
+ (cons 'extra 'Cc) recipient 'all nil nil
+ not-matching)
+ (gnus-message
+ 1 "`Cc' isn't present in `nnmail-extra-headers'")
+ (sit-for 1)
+ nil))
+ (articles
+ (if not-matching
+ ;; We need the numbers that are in both lists:
+ (mapcar (lambda (a)
+ (and (memq a to) a))
+ cc)
+ (nconc to cc))))
+ (unless articles
+ (error "Found no matches for \"%s\"" recipient))
+ (gnus-summary-limit articles))
+ (gnus-summary-position-point))))
+
(defun gnus-summary-limit-to-age (age &optional younger-p)
"Limit the summary buffer to articles that are older than (or equal) AGE days.
If YOUNGER-P (the prefix) is non-nil, limit the summary buffer to
documents as newsgroups.
Obeys the standard process/prefix convention."
(interactive "P")
- (let* ((articles (gnus-summary-work-articles n))
- (ogroup gnus-newsgroup-name)
+ (let* ((ogroup gnus-newsgroup-name)
(params (append (gnus-info-params (gnus-get-info ogroup))
(list (cons 'to-group ogroup))))
- article group egroup groups vgroup)
- (while (setq article (pop articles))
+ group egroup groups vgroup)
+ (dolist (article (gnus-summary-work-articles n))
(setq group (format "%s-%d" gnus-newsgroup-name article))
(gnus-summary-remove-process-mark article)
(when (gnus-summary-display-article article)
(start (or (search-backward "\n\n" nil t) (point-min))))
(goto-char
(or (text-property-any start end 'x-face-image t);; x-face-e21
- (text-property-any start end 'x-face-mule-bitmap-image t)
(, opoint)))))))
(defmacro gnus-summary-search-article-highlight-matched-text
gnus-treat-display-x-face
gnus-treat-buttonize-head
gnus-treat-decode-article-as-default-mime-charset))
- (static-if (featurep 'xemacs)
- items
- (cons '(x-face-mule-delete-x-face-field
- (quote never))
- items))))
+ items))
(gnus-treat-display-x-face
(when (, x-face) gnus-treat-display-x-face)))
(gnus-article-prepare-mime-display)))
gnus-article-buffer t)))))
(gnus-summary-select-article nil t)
(setq treated nil)))
- (let ((gnus-inhibit-treatment t)
- (x-face-mule-delete-x-face-field 'never))
+ (let ((gnus-inhibit-treatment t))
(setq treated (eq 'old (gnus-summary-select-article)))
(when (and treated
(not
(or (cdr (assq arg gnus-summary-show-article-charset-alist))
(mm-read-coding-system
"View as charset: " ;; actually it is coding system.
- (save-excursion
- (set-buffer gnus-article-buffer)
+ (with-current-buffer gnus-article-buffer
(mm-detect-coding-region (point) (point-max))))))
(default-mime-charset gnus-newsgroup-charset)
(gnus-newsgroup-ignored-charsets 'gnus-all))
(inhibit-point-motion-hooks t)
(hidden (if (numberp arg)
(>= arg 0)
- (gnus-article-hidden-text-p 'headers)))
+ (or (not (looking-at "[^ \t\n]+:"))
+ (gnus-article-hidden-text-p 'headers))))
s e)
(delete-region (point-min) (point-max))
(with-current-buffer gnus-original-article-buffer
(let ((start (window-start))
buffer-read-only)
(message-caesar-buffer-body arg)
- (set-window-start (get-buffer-window (current-buffer)) start))))))
+ (set-window-start (get-buffer-window (current-buffer)) start)))))
+ ;; Create buttons and stuff...
+ (gnus-treat-article nil))
+
+(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
+remain unencoded after running this function, it is likely an
+invalid IDNA string (`xn--bar' is invalid).
+
+You must have GNU Libidn (`http://www.gnu.org/software/libidn/')
+installed for this command to work."
+ (interactive "P")
+ (if (not (and (condition-case nil (require 'idna)
+ (file-error))
+ (mm-coding-system-p 'utf-8)
+ (executable-find (symbol-value 'idna-program))))
+ (gnus-message
+ 5 "GNU Libidn not installed properly (`idn' or `idna.el' missing)")
+ (gnus-summary-select-article)
+ (let ((mail-header-separator ""))
+ (gnus-eval-in-buffer-window gnus-article-buffer
+ (save-restriction
+ (widen)
+ (let ((start (window-start))
+ buffer-read-only)
+ (while (re-search-forward "\\(xn--[-0-9a-z]+\\)" nil t)
+ (replace-match (idna-to-unicode (match-string 1))))
+ (set-window-start (get-buffer-window (current-buffer)) start)))))))
(autoload 'unmorse-region "morse"
"Convert morse coded text in region to ordinary ASCII text."
(crosspost "Crosspost" "Crossposting")))
(copy-buf (save-excursion
(nnheader-set-temp-buffer " *copy article*")))
- art-group to-method new-xref article to-groups)
+ art-group to-method new-xref article to-groups articles-to-update-marks)
(unless (assq action names)
(error "Unknown action %s" action))
;; Read the newsgroup name.
((eq action 'move)
;; Remove this article from future suppression.
(gnus-dup-unsuppress-article article)
+ (let* ((from-method (gnus-find-method-for-group
+ gnus-newsgroup-name))
+ (to-method (gnus-find-method-for-group
+ to-newsgroup))
+ (move-is-internal (gnus-method-equal from-method to-method)))
(gnus-request-move-article
article ; Article to move
gnus-newsgroup-name ; From newsgroup
(list 'gnus-request-accept-article
to-newsgroup (list 'quote select-method)
(not articles) t) ; Accept form
- (not articles))) ; Only save nov last time
+ (not articles) ; Only save nov last time
+ move-is-internal))) ; is this move internal?
;; Copy the article.
((eq action 'copy)
(save-excursion
(set-buffer copy-buf)
(when (gnus-request-article-this-buffer article gnus-newsgroup-name)
+ (save-restriction
+ (nnheader-narrow-to-headers)
+ (dolist (hdr gnus-copy-article-ignored-headers)
+ (message-remove-header hdr t)))
(gnus-request-accept-article
to-newsgroup select-method (not articles) t))))
;; Crosspost the article.
(gnus-summary-goto-subject article)
(when (eq action 'move)
(gnus-summary-mark-article article gnus-canceled-mark))))
- (gnus-summary-remove-process-mark article))
+ (push article articles-to-update-marks))
+
+ (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)
(let ((gnus-group-marked to-groups))
(gnus-group-get-new-news-this-group nil t)))
-
+
(gnus-kill-buffer copy-buf)
(gnus-summary-position-point)
(gnus-set-mode-line 'summary)))
"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
(gnus-summary-goto-subject article)
(gnus-summary-update-secondary-mark article)))
-(defun gnus-summary-remove-process-mark (article)
- "Remove the process mark from ARTICLE and update the summary line."
- (setq gnus-newsgroup-processable (delq article gnus-newsgroup-processable))
- (when (gnus-summary-goto-subject article)
- (gnus-summary-show-thread)
- (gnus-summary-goto-subject article)
- (gnus-summary-update-secondary-mark article)))
+(defun gnus-summary-remove-process-mark (&rest articles)
+ "Remove the process mark from ARTICLES and update the summary line."
+ (dolist (article articles)
+ (setq gnus-newsgroup-processable (delq article gnus-newsgroup-processable))
+ (when (gnus-summary-goto-subject article)
+ (gnus-summary-show-thread)
+ (gnus-summary-goto-subject article)
+ (gnus-summary-update-secondary-mark article))))
(defun gnus-summary-set-saved-mark (article)
"Set the process mark on ARTICLE and update the summary line."
(interactive "P")
(gnus-summary-sort 'author reverse))
+(defun gnus-summary-sort-by-recipient (&optional reverse)
+ "Sort the summary buffer by recipient name alphabetically.
+If `case-fold-search' is non-nil, case of letters is ignored.
+Argument REVERSE means reverse order."
+ (interactive "P")
+ (gnus-summary-sort 'recipient reverse))
+
(defun gnus-summary-sort-by-subject (&optional reverse)
"Sort the summary buffer by subject alphabetically. `Re:'s are ignored.
If `case-fold-search' is non-nil, case of letters is ignored.