(unless (eq major-mode 'gnus-summary-mode)
(set-buffer gnus-summary-buffer))
(setq gnus-summary-buffer (current-buffer))
- ;; Make sure the connection to the server is alive.
- (unless (gnus-server-opened
- (gnus-find-method-for-group gnus-newsgroup-name))
- (gnus-check-server (gnus-find-method-for-group gnus-newsgroup-name))
- (gnus-request-group gnus-newsgroup-name t))
(let* ((gnus-article (if header (mail-header-number header) article))
(summary-buffer (current-buffer))
(internal-hook gnus-article-internal-prepare-hook)
(error "There is no summary buffer for this article buffer")
(gnus-article-set-globals)
(gnus-configure-windows 'article)
- (gnus-summary-goto-subject gnus-current-article)))
+ (gnus-summary-goto-subject gnus-current-article)
+ (gnus-summary-position-point)))
(defun gnus-article-describe-briefly ()
"Describe article mode commands briefly."
(when (gnus-visual-p 'article-highlight 'highlight)
(gnus-article-highlight-some)))
+(defun gnus-check-group-server ()
+ ;; Make sure the connection to the server is alive.
+ (unless (gnus-server-opened
+ (gnus-find-method-for-group gnus-newsgroup-name))
+ (gnus-check-server (gnus-find-method-for-group gnus-newsgroup-name))
+ (gnus-request-group gnus-newsgroup-name t)))
+
(defun gnus-request-article-this-buffer (article group)
"Get an article and insert it into this buffer."
(let (do-update-line)
(gnus-kill-all-overlays)
(setq group (or group gnus-newsgroup-name))
- ;; Open server if it has closed.
- (gnus-check-server (gnus-find-method-for-group group))
-
;; Using `gnus-request-article' directly will insert the article into
;; `nntp-server-buffer' - so we'll save some time by not having to
;; copy it from the server buffer into the article buffer.
(buffer-read-only nil))
(erase-buffer)
(gnus-kill-all-overlays)
+ (gnus-check-group-server)
(when (gnus-request-article article group (current-buffer))
(when (numberp article)
(gnus-async-prefetch-next group article gnus-summary-buffer)
(gnus-kill-all-overlays)
(setq group (or group gnus-newsgroup-name))
- ;; Open server if it has closed.
- (gnus-check-server (gnus-find-method-for-group group))
-
;; Using `gnus-request-article' directly will insert the article into
;; `nntp-server-buffer' - so we'll save some time by not having to
;; copy it from the server buffer into the article buffer.
(buffer-read-only nil))
(erase-buffer)
(gnus-kill-all-overlays)
+ (gnus-check-group-server)
(when (gnus-request-article article group (current-buffer))
(when (numberp article)
(gnus-async-prefetch-next group article gnus-summary-buffer)
(defun gnus-cache-update-article (group article)
"If ARTICLE is in the cache, remove it and re-enter it."
- (when (gnus-cache-possibly-remove-article article nil nil nil t)
+ (gnus-cache-change-buffer group)
+ (when (gnus-cache-possibly-remove-article article nil nil nil t)
(let ((gnus-use-cache nil))
(gnus-cache-possibly-enter-article
gnus-newsgroup-name article (gnus-summary-article-header article)
(provide 'gnus-cus)
;;; gnus-cus.el ends here
-
(push (list 'gnus-inews-add-to-address pgroup)
message-send-actions)))
(set-buffer gnus-article-copy)
- (message-wide-reply to-address
- (gnus-group-find-parameter
- gnus-newsgroup-name 'broken-reply-to))))
+ (gnus-msg-treat-broken-reply-to)
+ (message-wide-reply to-address)))
(when yank
(gnus-inews-yank-articles yank))))))
+(defun gnus-msg-treat-broken-reply-to ()
+ "Remove the Reply-to header iff broken-reply-to."
+ (when (gnus-group-find-parameter
+ gnus-newsgroup-name 'broken-reply-to)
+ (save-restriction
+ (message-narrow-to-head)
+ (message-remove-header "reply-to"))))
+
(defun gnus-post-method (arg group &optional silent)
"Return the posting method based on GROUP and ARG.
If SILENT, don't prompt the user."
gnus-post-method
(list gnus-post-method)))
gnus-secondary-select-methods
+ (mapcar 'cdr gnus-server-alist)
(list gnus-select-method)
(list group-method)))
method-alist post-methods method)
(gnus-setup-message (if yank 'reply-yank 'reply)
(gnus-summary-select-article)
(set-buffer (gnus-copy-article-buffer))
- (message-reply nil wide (gnus-group-find-parameter
- gnus-newsgroup-name 'broken-reply-to))
+ (gnus-msg-treat-broken-reply-to)
+ (message-reply nil wide)
(when yank
(gnus-inews-yank-articles yank)))))
"." gnus-pick-article
gnus-down-mouse-2 gnus-pick-mouse-pick-region
"\r" gnus-pick-start-reading
- ;; "t" gnus-uu-mark-thread
- ;; "T" gnus-uu-unmark-thread
- ;; "U" gnus-summary-unmark-all-processable
- ;; "v" gnus-uu-mark-over
- ;; "r" gnus-uu-mark-region
- ;; "R" gnus-uu-unmark-region
- ;; "e" gnus-uu-mark-by-regexp
- ;; "E" gnus-uu-mark-by-regexp
- ;; "b" gnus-uu-mark-buffer
- ;; "B" gnus-uu-unmark-buffer
- ;;gnus-mouse-2 gnus-pick-mouse-pick
- ;; "X" gnus-pick-start-reading
+ "t" gnus-uu-mark-thread
+ "T" gnus-uu-unmark-thread
+ "U" gnus-summary-unmark-all-processable
+ "v" gnus-uu-mark-over
+ "r" gnus-uu-mark-region
+ "R" gnus-uu-unmark-region
+ "e" gnus-uu-mark-by-regexp
+ "E" gnus-uu-mark-by-regexp
+ "b" gnus-uu-mark-buffer
+ "B" gnus-uu-unmark-buffer
+ gnus-mouse-2 gnus-pick-mouse-pick
+ "X" gnus-pick-start-reading
))
(defun gnus-pick-make-menu-bar ()
(gnus-define-keys (gnus-summary-score-map "V" gnus-summary-mode-map)
"s" gnus-summary-set-score
- "a" gnus-summary-score-entry
"S" gnus-summary-current-score
"c" gnus-score-change-score-file
"C" gnus-score-customize
DATE is the expire date, or nil for no expire, or 'now for immediate expire.
If optional argument `PROMPT' is non-nil, allow user to edit match.
If optional argument `SILENT' is nil, show effect of score entry."
- (interactive
- (list (completing-read "Header: "
- gnus-header-index
- (lambda (x) (fboundp (nth 2 x)))
- t)
- (read-string "Match: ")
- (if (y-or-n-p "Use regexp match? ") 'r 's)
- (and current-prefix-arg
- (prefix-numeric-value current-prefix-arg))
- (cond ((not (y-or-n-p "Add to score file? "))
- 'now)
- ((y-or-n-p "Expire kill? ")
- (current-time-string))
- (t nil))))
;; Regexp is the default type.
(when (eq type t)
(setq type 'r))
(require 'gnus-range)
(require 'gnus-int)
(require 'gnus-undo)
-(require 'std11)
(require 'mime-view)
(autoload 'gnus-summary-limit-include-cached "gnus-cache" nil t)
(defun gnus-build-sparse-threads ()
(let ((headers gnus-newsgroup-headers)
header references generation relations
- cthread subject child end pthread relation new-child)
+ cthread subject child end pthread relation new-child date)
;; First we create an alist of generations/relations, where
;; generations is how much we trust the relation, and the relation
;; is parent/child.
(not (string= references "")))
(insert references)
(setq child (mail-header-id header)
- subject (mail-header-subject header))
- (setq generation 0)
+ subject (mail-header-subject header)
+ date (mail-header-date header)
+ generation 0)
(while (search-backward ">" nil t)
(setq end (1+ (point)))
(if (search-backward "<" nil t)
(push (list (incf generation)
child (setq child new-child)
- subject)
+ subject date)
relations)))
(push (list (1+ generation) child nil subject) relations)
(erase-buffer)))
(when (gnus-dependencies-add-header
(make-full-mail-header
gnus-reffed-article-number
- (cadddr relation) "" (mail-header-date header)
- (cadr relation)
- (or (caddr relation) "") 0 0 "")
+ (nth 3 relation) "" (nth 4 relation)
+ (nth 1 relation)
+ (or (nth 2 relation) "") 0 0 "")
gnus-newsgroup-dependencies nil)
(push gnus-reffed-article-number gnus-newsgroup-limit)
(push gnus-reffed-article-number gnus-newsgroup-sparse)
(setcar thread old)
nil))))
-(defun gnus-rebuild-thread (id)
- "Rebuild the thread containing ID."
+(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)
old-pos current thread data)
(if (not gnus-show-threads)
(setq thread (cons subject (gnus-sort-threads roots))))))
(let (threads)
;; We then insert this thread into the summary buffer.
+ (when line
+ (goto-char (point-min))
+ (forward-line (1- line)))
(let (gnus-newsgroup-data gnus-newsgroup-threads)
(if gnus-show-threads
(gnus-summary-prepare-threads (gnus-cut-threads (list thread)))
(setq data (nreverse gnus-newsgroup-data))
(setq threads gnus-newsgroup-threads))
;; We splice the new data into the data structure.
- (gnus-data-enter-list current data (- (point) old-pos))
- (setq gnus-newsgroup-threads (nconc threads gnus-newsgroup-threads)))))
+ ;;!!! This is kinda bogus. We assume that in LINE is non-nil,
+ ;;!!! then we want to insert at the beginning of the buffer.
+ ;;!!! That happens to be true with Gnus now, but that may
+ ;;!!! change in the future. Perhaps.
+ (gnus-data-enter-list (if line nil current) data (- (point) old-pos))
+ (setq gnus-newsgroup-threads (nconc threads gnus-newsgroup-threads))
+ (when line
+ (gnus-data-compute-positions)))))
(defun gnus-number-to-header (number)
"Return the header for article NUMBER."
(mail-header-set-xref headers xref)))))))
(defun gnus-summary-insert-subject (id &optional old-header use-old-header)
- "Find article ID and insert the summary line for that article."
- (let ((header (cond ((and old-header use-old-header)
+ "Find article ID and insert the summary line for that article.
+OLD-HEADER can either be a header or a line number to insert
+the subject line on."
+ (let* ((line (and (numberp old-header) old-header))
+ (old-header (and (vectorp old-header) old-header))
+ (header (cond ((and old-header use-old-header)
old-header)
((and (numberp id)
(gnus-number-to-header id))
gnus-newsgroup-sparse))
(setq gnus-newsgroup-ancient (delq number gnus-newsgroup-ancient))
(push number gnus-newsgroup-limit)
- (gnus-rebuild-thread (mail-header-id header))
+ (gnus-rebuild-thread (mail-header-id header) line)
(gnus-summary-goto-subject number nil t))
(when (and (numberp number)
(> number 0))
;; We read in the article if we have to.
(and (not data)
force
- (gnus-summary-insert-subject article (and (vectorp force) force) t)
+ (gnus-summary-insert-subject
+ article
+ (if (or (numberp force) (vectorp force)) force)
+ t)
(setq data (gnus-data-find article)))
(goto-char b)
(if (not data)
(not unread) (not subject))
(gnus-summary-goto-article
(if backward (1- gnus-newsgroup-begin) (1+ gnus-newsgroup-end))
- nil t))
+ nil (count-lines (point-min) (point))))
;; Go to next/previous group.
(t
(unless (gnus-ephemeral-group-p gnus-newsgroup-name)
(defun gnus-summary-goto-article (article &optional all-headers force)
"Fetch ARTICLE (article number or Message-ID) and display it if it exists.
-If ALL-HEADERS is non-nil, no header lines are hidden."
+If ALL-HEADERS is non-nil, no header lines are hidden.
+If FORCE, go to the article even if it isn't displayed. If FORCE
+is a number, it is the line the article is to be displayed on."
(interactive
(list
(completing-read
(nnmail-time-since (nnmail-date-to-time date))
cutoff))
(when (if younger-p
- (not is-younger)
- is-younger)
+ is-younger
+ (not is-younger))
(push (gnus-data-number d) articles))))
(gnus-summary-limit (nreverse articles)))
(gnus-summary-position-point)))
gnus-newsgroup-name)
(error "The current newsgroup does not support article deletion"))
;; Compute the list of articles to delete.
- (let ((articles (gnus-summary-work-articles n))
+ (let ((articles (sort (copy-sequence (gnus-summary-work-articles n)) '<))
not-deleted)
(if (and gnus-novice-user
(not (gnus-yes-or-no-p
:link '(custom-manual "(gnus)Exiting Gnus")
:group 'gnus)
-(defconst gnus-version-number "6.7.1"
+(defconst gnus-version-number "6.7.2"
"Version number for this version of gnus.")
(defconst gnus-version
- (format "Chao-gnus %s (based on Gnus 5.6.13; for SEMI 1.8)"
+ (format "Semi-gnus %s (based on Gnus 5.6.15; for SEMI 1.8)"
gnus-version-number)
"Version string for this version of gnus.")
"Collapse GROUP name LEVELS.
Select methods are stripped and any remote host name is stripped down to
just the host name."
- (let* ((name "") (foreign "") (depth -1) (skip 1)
+ (let* ((name "")
+ (foreign "")
+ (depth 0)
+ (skip 1)
(levels (or levels
(progn
(while (string-match "\\." group skip)