;;; gnus-sum.el --- summary mode commands for Gnus
-;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
;; Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
"c" gnus-summary-limit-exclude-childless-dormant
"C" gnus-summary-limit-mark-excluded-as-read
"o" gnus-summary-insert-old-articles
- "N" gnus-summary-insert-new-articles)
+ "N" gnus-summary-insert-new-articles
+ "r" gnus-summary-limit-to-replied)
(gnus-define-keys (gnus-summary-goto-map "G" gnus-summary-mode-map)
"n" gnus-summary-next-unread-article
"q" gnus-article-de-quoted-unreadable
"6" gnus-article-de-base64-unreadable
"Z" gnus-article-decode-HZ
+ "A" gnus-article-treat-ansi-sequences
"h" gnus-article-wash-html
"u" gnus-article-unsplit-urls
"s" gnus-summary-force-verify-and-decrypt
:active (not (gnus-group-read-only-p))
,@(if (featurep 'xemacs) nil
'(:help "Encrypt the message body on disk"))]
- ["Extract all parts" gnus-summary-save-parts t]
+ ["Extract all parts..." gnus-summary-save-parts t]
("Multipart"
["Repair multipart" gnus-summary-repair-multipart t]
- ["Pipe part" gnus-article-pipe-part t]
+ ["Pipe part..." gnus-article-pipe-part t]
["Inline part" gnus-article-inline-part t]
["Encrypt body" gnus-article-encrypt-body
:active (not (gnus-group-read-only-p))
,@(if (featurep 'xemacs) nil
'(:help "Encrypt the message body on disk"))]
["View part externally" gnus-article-view-part-externally t]
- ["View part with charset" gnus-article-view-part-as-charset t]
+ ["View part with charset..." gnus-article-view-part-as-charset t]
["Copy part" gnus-article-copy-part t]
- ["Save part" gnus-article-save-part t]
+ ["Save part..." gnus-article-save-part t]
["View part" gnus-article-view-part t]))
("Date"
["Local" gnus-article-date-local t]
["Word wrap" gnus-article-fill-cited-article t]
["Fill long lines" gnus-article-fill-long-lines t]
["Capitalize sentences" gnus-article-capitalize-sentences t]
- ["CR" gnus-article-remove-cr t]
+ ["Remove CR" gnus-article-remove-cr t]
["Quoted-Printable" gnus-article-de-quoted-unreadable t]
["Base64" gnus-article-de-base64-unreadable t]
["Rot 13" gnus-summary-caesar-message
["Unfold headers" gnus-article-treat-unfold-headers t]
["Fold newsgroups" gnus-article-treat-fold-newsgroups t]
["Html" gnus-article-wash-html t]
- ["URLs" gnus-article-unsplit-urls t]
+ ["Unsplit URLs" gnus-article-unsplit-urls t]
["Verify X-PGP-Sig" gnus-article-verify-x-pgp-sig t]
- ["HZ" gnus-article-decode-HZ t]
+ ["Decode HZ" gnus-article-decode-HZ t]
+ ["ANSI sequences" gnus-article-treat-ansi-sequences t]
("(Outlook) Deuglify"
["Unwrap lines" gnus-article-outlook-unwrap-lines t]
["Repair attribution" gnus-article-outlook-repair-attribution t]
gnus-article-outlook-deuglify-article t])
)
("Output"
- ["Save in default format" gnus-summary-save-article
+ ["Save in default format..." gnus-summary-save-article
,@(if (featurep 'xemacs) '(t)
'(:help "Save article using default method"))]
- ["Save in file" gnus-summary-save-article-file
+ ["Save in file..." gnus-summary-save-article-file
,@(if (featurep 'xemacs) '(t)
'(:help "Save article in file"))]
- ["Save in Unix mail format" gnus-summary-save-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]
- ["Save body in file" gnus-summary-save-article-body-file t]
- ["Pipe through a filter" gnus-summary-pipe-output t]
+ ["Save in Unix mail format..." gnus-summary-save-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]
+ ["Save body in file..." gnus-summary-save-article-body-file t]
+ ["Pipe through a filter..." gnus-summary-pipe-output t]
["Add to SOUP packet" gnus-soup-add-article t]
- ["Print with Muttprint" gnus-summary-muttprint t]
+ ["Print with Muttprint..." gnus-summary-muttprint t]
["Print" gnus-summary-print-article t])
("Backend"
["Respool article..." gnus-summary-respool-article t]
["Display Predicate" gnus-summary-limit-to-display-predicate t]
["Unread" gnus-summary-limit-to-unread t]
["Unseen" gnus-summary-limit-to-unseen t]
+ ["Replied" gnus-summary-limit-to-replied t]
["Non-dormant" gnus-summary-limit-exclude-dormant t]
["Next articles" gnus-summary-limit-to-articles t]
["Pop limit" gnus-summary-pop-limit t]
respectively.
You can also post articles and send mail from this buffer. To
-follow up an article, type `\\[gnus-summary-followup]'. To mail a reply to the author
+follow up an article, type `\\[gnus-summary-followup]'. To mail a reply to the author
of an article, type `\\[gnus-summary-reply]'.
There are approx. one gazillion commands you can execute in this
; Is it really necessary to do this next part for each summary line?
; Luckily, doesn't seem to slow things down much.
(mail-parse-ignored-charsets
- (save-excursion (set-buffer gnus-summary-buffer)
- gnus-newsgroup-ignored-charsets)))
+ (with-current-buffer gnus-summary-buffer
+ gnus-newsgroup-ignored-charsets)))
(or
(and gnus-ignored-from-addresses
(string-match gnus-ignored-from-addresses gnus-tmp-from)
(defsubst gnus-remove-odd-characters (string)
"Translate STRING into something that doesn't contain weird characters."
- (subst-char-in-string
+ (mm-subst-char-in-string
?\r ?\-
- (subst-char-in-string
- ?\n ?\- string t)
- t))
+ (mm-subst-char-in-string
+ ?\n ?\- string)))
;; This function has to be called with point after the article number
;; on the beginning of the line.
(defsubst gnus-nov-parse-line (number dependencies &optional force-new)
- (let ((eol (gnus-point-at-eol))
+ (let ((eol (point-at-eol))
(buffer (current-buffer))
header references in-reply-to)
(setq thread (list (car (gnus-id-to-thread id))))
;; Get the thread this article is part of.
(setq thread (gnus-remove-thread id)))
- (setq old-pos (gnus-point-at-bol))
+ (setq old-pos (point-at-bol))
(setq current (save-excursion
(and (re-search-backward "[\r\n]" nil t)
(gnus-summary-article-number))))
(gnus-summary-show-thread)
(gnus-data-remove
number
- (- (gnus-point-at-bol)
+ (- (point-at-bol)
(prog1
- (1+ (gnus-point-at-eol))
+ (1+ (point-at-eol))
(gnus-delete-line)))))))
(defun gnus-sort-threads-1 (threads func)
"Select newsgroup GROUP.
If READ-ALL is non-nil, all articles in the group are selected.
If SELECT-ARTICLES, only select those articles from GROUP."
- (let* ((entry (gnus-gethash group gnus-newsrc-hashtb))
+ (let* ((entry (gnus-group-entry group))
;;!!! Dirty hack; should be removed.
(gnus-summary-ignore-duplicates
(if (eq (car (gnus-find-method-for-group group)) 'nnvirtual)
(gnus-set-active group (cons (caar alist) (cdr active)))))
(setq gnus-summary-use-undownloaded-faces
- (not (gnus-agent-find-parameter
- group
- 'agent-disable-undownloaded-faces))))
+ (gnus-agent-find-parameter
+ group
+ 'agent-enable-undownloaded-faces)))
(setq gnus-newsgroup-name group
gnus-newsgroup-unselected nil
(defun gnus-mark-xrefs-as-read (from-newsgroup headers unreads)
"Look through all the headers and mark the Xrefs as read."
(let ((virtual (gnus-virtual-group-p from-newsgroup))
- name entry info xref-hashtb idlist method nth4)
+ name info xref-hashtb idlist method nth4)
(save-excursion
(set-buffer gnus-group-buffer)
(when (setq xref-hashtb
(setq idlist (symbol-value group))
;; Dead groups are not updated.
(and (prog1
- (setq entry (gnus-gethash name gnus-newsrc-hashtb)
- info (nth 2 entry))
+ (setq info (gnus-get-info name))
(when (stringp (setq nth4 (gnus-info-method info)))
(setq nth4 (gnus-server-to-method nth4))))
;; Only do the xrefs if the group has the same
xref-hashtb)))))
(defun gnus-compute-read-articles (group articles)
- (let* ((entry (gnus-gethash group gnus-newsrc-hashtb))
+ (let* ((entry (gnus-group-entry group))
(info (nth 2 entry))
(active (gnus-active group))
ninfo)
(defun gnus-group-make-articles-read (group articles)
"Update the info of GROUP to say that ARTICLES are read."
(let* ((num 0)
- (entry (gnus-gethash group gnus-newsrc-hashtb))
+ (entry (gnus-group-entry group))
(info (nth 2 entry))
(active (gnus-active group))
range)
(when entry
(setq range (gnus-compute-read-articles group articles))
- (save-excursion
- (set-buffer gnus-group-buffer)
+ (with-current-buffer gnus-group-buffer
(gnus-undo-register
`(progn
(gnus-info-set-marks ',info ',(gnus-info-marks info) t)
(looking-at "Xref:"))
(search-forward "\nXref:" nil t))
(goto-char (1+ (match-end 0)))
- (setq xref (buffer-substring (point) (gnus-point-at-eol)))
+ (setq xref (buffer-substring (point) (point-at-eol)))
(mail-header-set-xref headers xref)))))))
(defun gnus-summary-insert-subject (id &optional old-header use-old-header)
(goto-char (gnus-data-pos d))
(gnus-data-remove
number
- (- (gnus-point-at-bol)
+ (- (point-at-bol)
(prog1
- (1+ (gnus-point-at-eol))
+ (1+ (point-at-eol))
(gnus-delete-line))))))
(when old-header
(mail-header-set-number header (mail-header-number old-header)))
(if (null arg) (not gnus-dead-summary-mode)
(> (prefix-numeric-value arg) 0)))
(when gnus-dead-summary-mode
- (gnus-add-minor-mode
+ (add-minor-mode
'gnus-dead-summary-mode " Dead" gnus-dead-summary-mode-map))))
(defun gnus-deaden-summary ()
(not (gnus-ephemeral-group-p gnus-newsgroup-name)))
(format " (Type %s for %s [%s])"
(single-key-description cmd) group
- (car (gnus-gethash group gnus-newsrc-hashtb)))
+ (gnus-group-unread group))
(format " (Type %s to exit %s)"
(single-key-description cmd)
gnus-newsgroup-name))))
t))
(prog1
(if (and (stringp article)
- (string-match "@" article))
+ (string-match "@\\|%40" article))
(gnus-summary-refer-article article)
(when (stringp article)
(setq article (string-to-number article)))
gnus-duplicate-mark gnus-souped-mark)
'reverse)))
+(defun gnus-summary-limit-to-replied (&optional unreplied)
+ "Limit the summary buffer to replied articles.
+If UNREPLIED (the prefix), limit to unreplied articles."
+ (interactive "P")
+ (if unreplied
+ (gnus-summary-limit
+ (gnus-set-difference gnus-newsgroup-articles
+ gnus-newsgroup-replied))
+ (gnus-summary-limit gnus-newsgroup-replied))
+ (gnus-summary-position-point))
+
(defalias 'gnus-summary-delete-marked-with 'gnus-summary-limit-exclude-marks)
(make-obsolete 'gnus-summary-delete-marked-with
'gnus-summary-limit-exclude-marks)
(interactive "sMessage-ID: ")
(when (and (stringp message-id)
(not (zerop (length message-id))))
- (setq message-id (replace-regexp-in-string " " "" message-id))
+ (setq message-id (gnus-replace-in-string message-id " " ""))
;; Construct the correct Message-ID if necessary.
;; Suggested by tale@pawl.rpi.edu.
(unless (string-match "^<" message-id)
(setq message-id (concat "<" message-id)))
(unless (string-match ">$" message-id)
(setq message-id (concat message-id ">")))
+ ;; People often post MIDs from URLs, so unhex it:
+ (unless (string-match "@" message-id)
+ (setq message-id (gnus-url-unhex-string message-id)))
(let* ((header (gnus-id-to-header message-id))
(sparse (and header
(gnus-summary-article-sparse-p
;; the wrong guess.
(message-narrow-to-head)
(goto-char (point-min))
- (delete-matching-lines "^\\(Path\\):\\|^From ")
+ (delete-matching-lines "^Path:\\|^From ")
(widen)
(if (setq egroup
(gnus-group-read-ephemeral-group
(gnus-eval-in-buffer-window gnus-article-buffer
(widen)
(goto-char (point-min))
- (when gnus-page-broken
+ (when gnus-break-pages
(gnus-narrow-to-page))))
(defun gnus-summary-end-of-article ()
(widen)
(goto-char (point-max))
(recenter -3)
- (when gnus-page-broken
+ (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)
"[()]" "\\\\\\&"))
(defun gnus-summary-print-article (&optional filename n)
- "Generate and print a PostScript image of the N next (mail) articles.
+ "Generate and print a PostScript image of the process-marked (mail) articles.
+
+If used interactively, print the current article if none are
+process-marked. With prefix arg, prompt the user for the name of the
+file to save in.
-If N is negative, print the N previous articles. If N is nil and articles
-have been marked with the process mark, print these instead.
+When used from Lisp, accept two optional args FILENAME and N. N means
+to print the next N articles. If N is negative, print the N previous
+articles. If N is nil and articles have been marked with the process
+mark, print these instead.
If the optional first argument FILENAME is nil, send the image to the
printer. If FILENAME is a string, save the PostScript image in a file with
(widen)
(if window
(set-window-start window (goto-char (point-min))))
- (setq gnus-page-broken
- (when gnus-break-pages
- (gnus-narrow-to-page)
- t))
+ (if gnus-break-pages
+ (gnus-narrow-to-page)
+ (when (gnus-visual-p 'page-marker)
+ (let ((buffer-read-only nil))
+ (gnus-remove-text-with-property 'gnus-prev)
+ (gnus-remove-text-with-property 'gnus-next))))
(gnus-set-mode-line 'article)))))
(defun gnus-summary-show-all-headers ()
(t
(let* ((pto-group (gnus-group-prefixed-name
(car art-group) to-method))
- (entry
- (gnus-gethash pto-group gnus-newsrc-hashtb))
- (info (nth 2 entry))
+ (info (gnus-get-info pto-group))
(to-group (gnus-info-group info))
to-marks)
;; Update the group that has been moved to.
(defun gnus-summary-update-mark (mark type)
(let ((forward (cdr (assq type gnus-summary-mark-positions)))
(buffer-read-only nil))
- (re-search-backward "[\n\r]" (gnus-point-at-bol) 'move-to-limit)
+ (re-search-backward "[\n\r]" (point-at-bol) 'move-to-limit)
(when forward
(when (looking-at "\r")
(incf forward))
(interactive)
(let ((buffer-read-only nil)
(orig (point))
- (end (gnus-point-at-eol))
+ (end (point-at-eol))
;; Leave point at bol
(beg (progn (beginning-of-line) (point))))
(prog1
(or
(mail-content-type-get
(mm-handle-disposition handle) 'filename)
+ (mail-content-type-get
+ (mm-handle-type handle) 'name)
(concat gnus-newsgroup-name
"." (number-to-string
(cdr gnus-article-current))))))
(lambda (f)
(if (equal f " ")
f
- (mm-quote-arg f)))
+ (shell-quote-argument f)))
files " ")))))
(setq ps (cdr ps)))))
(if (and gnus-view-pseudos (not not-view))
;; Added by Per Abrahamsen <amanda@iesd.auc.dk>.
(when gnus-summary-selected-face
(save-excursion
- (let* ((beg (gnus-point-at-bol))
- (end (gnus-point-at-eol))
+ (let* ((beg (point-at-bol))
+ (end (point-at-eol))
;; Fix by Mike Dugan <dugan@bucrf16.bu.edu>.
(from (if (get-text-property beg gnus-mouse-face-prop)
beg
(defun gnus-summary-highlight-line ()
"Highlight current line according to `gnus-summary-highlight'."
- (let* ((beg (gnus-point-at-bol))
+ (let* ((beg (point-at-bol))
(article (or (gnus-summary-article-number) gnus-current-article))
(score (or (cdr (assq article
gnus-newsgroup-scored))
(let ((face (funcall (gnus-summary-highlight-line-0))))
(unless (eq face (get-text-property beg 'face))
(gnus-put-text-property-excluding-characters-with-faces
- beg (gnus-point-at-eol) 'face
+ beg (point-at-eol) 'face
(setq face (if (boundp face) (symbol-value face) face)))
(when gnus-summary-highlight-line-function
(funcall gnus-summary-highlight-line-function article face))))))
(defun gnus-update-read-articles (group unread &optional compute)
"Update the list of read articles in GROUP.
UNREAD is a sorted list."
- (let* ((active (or gnus-newsgroup-active (gnus-active group)))
- (entry (gnus-gethash group gnus-newsrc-hashtb))
- (info (nth 2 entry))
- (prev 1)
- read)
+ (let ((active (or gnus-newsgroup-active (gnus-active group)))
+ (info (gnus-get-info group))
+ (prev 1)
+ read)
(if (or (not info) (not active))
;; There is no info on this group if it was, in fact,
;; killed. Gnus stores no information on killed groups, so
(insert "Mime-Version: 1.0\n")
(widen)
(when (search-forward "\n--" nil t)
- (let ((separator (buffer-substring (point) (gnus-point-at-eol))))
+ (let ((separator (buffer-substring (point) (point-at-eol))))
(message-narrow-to-head)
(message-remove-header "Content-Type")
(goto-char (point-max))
(push i new)
(decf i))
(if (not new)
- (message "No gnus is bad news.")
+ (message "No gnus is bad news")
(gnus-summary-insert-articles new)
(setq gnus-newsgroup-unreads
(gnus-sorted-nunion gnus-newsgroup-unreads new))