"*There is no thread under the article.")
(defvar gnus-not-empty-thread-mark ?=
"*There is a thread under the article.")
-(defvar gnus-dummy-mark ?Z
- "*This is a dummy article.")
(defvar gnus-view-pseudo-asynchronously nil
"*If non-nil, Gnus will view pseudo-articles asynchronously.")
"gnus-bug@ifi.uio.no (The Gnus Bugfixing Girls + Boys)"
"The mail address of the Gnus maintainers.")
-(defconst gnus-version "September Gnus v0.9"
+(defconst gnus-version "September Gnus v0.10"
"Version number for this version of Gnus.")
(defvar gnus-info-nodes
(autoload 'gnus-score-headers "gnus-score")
(autoload 'gnus-current-score-file-nondirectory "gnus-score")
(autoload 'gnus-score-adaptive "gnus-score")
- (autoload 'gnus-score-remove-lines-adaptive "gnus-score")
(autoload 'gnus-score-find-trace "gnus-score")
(autoload 'gnus-score-flush-cache "gnus-score" nil t)
(autoload 'gnus-score-close "gnus-score" nil t)
(if (not (setq elem (cdr (assq spec spec-alist))))
(setq elem '("*" ?s)))
;; Treat user defined format specifiers specially
- (and (eq (car elem) 'user-defined)
+ (and (eq (car elem) 'gnus-tmp-user-defined)
(setq elem
(list
(list (intern (concat "gnus-user-format-function-"
(or r (error "No such setting: %s" setting))
(if (and (not force) (setq all-visible (gnus-all-windows-visible-p r)))
- ;; All the windows mentioned are already visibe, so we just
+ ;; All the windows mentioned are already visible, so we just
;; put point in the assigned buffer, and do not touch the
;; winconf.
- (select-window (get-buffer-window all-visible))
+ (select-window (get-buffer-window all-visible t))
+
;; Either remove all windows or just remove all Gnus windows.
(if gnus-use-full-window
;; Finally, we pop to the buffer that's supposed to have point.
(or jump-buffer (error "Missing `point' in spec for %s" setting))
- (select-window (get-buffer-window jump-buffer))
+ (select-window (get-buffer-window jump-buffer t))
(set-buffer jump-buffer))))
(defun gnus-all-windows-visible-p (rule)
(defmacro gnus-data-unread-p (data)
(` (= (nth 1 (, data)) gnus-unread-mark)))
+(defmacro gnus-data-pseudo-p (data)
+ (` (vectorp (nth 3 (, data)))))
+
(defmacro gnus-data-find (number)
(` (assq (, number) gnus-newsgroup-data)))
(setq data (cdr data))))
(defun gnus-summary-article-pseudo-p (article)
+ "Say whether this article is a pseudo article or not."
(not (vectorp (gnus-data-header (gnus-data-find article)))))
(defun gnus-article-parent-p (number)
+ "Say whether this article is a parent or not."
(let* ((data (gnus-data-find-list number)))
(and (cdr data) ; There has to be an article after...
(< (gnus-data-level (car data)) ; And it has to have a higher level.
(gnus-data-level (nth 1 data))))))
+(defmacro gnus-summary-skip-intangible ()
+ "If the current article is intangible, then jump to a different article."
+ (let ((to (get-text-property (point) 'gnus-intangible)))
+ (when to
+ (gnus-summary-goto-subject to))))
+
+(defmacro gnus-summary-article-intangible-p ()
+ "Say whether this article is intangible or not."
+ (get-text-property (point) 'gnus-intangible))
+
;; Some summary mode macros.
(defmacro gnus-summary-article-number (&optional number-or-nil)
"The article number of the article on the current line.
If there isn's an article number here, then we return the current
article number."
+ (gnus-summary-skip-intangible)
(if number-or-nil
'(get-text-property (point) 'gnus-number)
'(or (get-text-property (point) 'gnus-number)
(defun gnus-summary-insert-dummy-line
(sformat gnus-tmp-subject gnus-tmp-number)
- (if (not sformat)
- (setq sformat gnus-summary-dummy-line-format-spec))
+ "Insert a dummy root in the summary buffer."
+ (or sformat (setq sformat gnus-summary-dummy-line-format-spec))
(beginning-of-line)
- (put-text-property
+ (add-text-properties
(point) (progn (eval sformat) (point))
- 'gnus-number gnus-tmp-number))
+ (list 'gnus-number gnus-tmp-number 'gnus-intangible gnus-tmp-number)))
(defvar gnus-thread-indent-array nil)
(defvar gnus-thread-indent-array-level gnus-thread-indent-level)
(gnus-message 6 "No unread news")
(gnus-kill-buffer kill-buffer)
nil)
- ;;(save-excursion
- ;; (if kill-buffer
- ;; (let ((gnus-summary-buffer kill-buffer))
- ;; (gnus-configure-windows 'group))))
;; Hide conversation thread subtrees. We cannot do this in
;; gnus-summary-prepare-hook since kill processing may not
;; work with hidden articles.
(gnus-gather-threads
(gnus-sort-threads
(gnus-make-threads)))
- gnus-newsgroup-headers)
- 'cull)
+ gnus-newsgroup-headers))
(gnus-summary-update-lines)
(setq gnus-newsgroup-data (nreverse gnus-newsgroup-data))
;; Call hooks for modifying summary buffer.
(and (zerop (forward-line -1))
(gnus-summary-article-number))))
headers refs thread art data)
- ;; First go up in this thread until we find the root.
- (while (and id (setq headers
- (car (setq art (gnus-gethash (downcase id) dep)))))
- (setq thread art)
- (setq id (gnus-parent-id (mail-header-references headers))))
- ;; We now have the root, so we remove this thread from the summary
- ;; buffer.
- (gnus-remove-articles thread)
+ (if (not gnus-show-threads)
+ (setq thread (car (gnus-gethash (downcase id) dep)))
+ ;; First go up in this thread until we find the root.
+ (while (and id (setq headers
+ (car (setq art (gnus-gethash (downcase id) dep)))))
+ (setq thread art)
+ (setq id (gnus-parent-id (mail-header-references headers))))
+ ;; We now have the root, so we remove this thread from the summary
+ ;; buffer.
+ (gnus-remove-articles thread))
(let ((beg (point)))
;; We then insert this thread into the summary buffer.
(let (gnus-newsgroup-data)
(pos (gnus-data-pos (gnus-data-find number))))
(if pos
(progn
- (gnus-data-remove number (- (progn (forward-line 1) (point))
- (forward-line -1) (point)))
+ (goto-char pos)
+ (gnus-data-remove number (- (progn (beginning-of-line) (point))
+ (progn (forward-line 1) (point))))
(cons pos (apply 'nconc
(mapcar (lambda (th) (gnus-remove-articles-1 th))
(cdr thread)))))
;; Sort threads as specified in `gnus-thread-sort-functions'.
(let ((fun gnus-thread-sort-functions))
(while fun
+ (gnus-message 6 "Sorting with %S..." fun)
(setq threads (sort threads (car fun))
fun (cdr fun))))
+ (if gnus-thread-sort-functions
+ (gnus-message 6 "Sorting...done"))
threads)
;; Written by Hallvard B Furuseth <h.b.furuseth@usit.uio.no>.
(defvar gnus-tmp-prev-subject nil)
(defvar gnus-tmp-false-parent nil)
(defvar gnus-tmp-root-expunged nil)
+(defvar gnus-tmp-dummy-line nil)
-(defun gnus-summary-prepare-threads (threads &optional cull)
+(defun gnus-summary-prepare-threads (threads)
"Prepare summary buffer from THREADS and indentation LEVEL.
THREADS is either a list of `(PARENT [(CHILD1 [(GRANDCHILD ...]...) ...])'
or a straight list of headers."
;; If this is a straight (sic) list of headers, then a
;; threaded summary display isn't required, so we just create
;; an unthreaded one.
- (gnus-summary-prepare-unthreaded threads cull)
+ (gnus-summary-prepare-unthreaded threads)
;; Do the threaded display.
(while (or threads stack new-adopts new-roots)
(if (and (= level 0)
+ (progn (setq gnus-tmp-dummy-line nil) t)
(or (not stack)
(= (car (car stack)) 0))
(not gnus-tmp-false-parent)
gnus-tmp-gathered))
(setq level -1))
((eq gnus-summary-make-false-root 'dummy)
- ;; We output a dummy root.
- (gnus-summary-insert-dummy-line
- nil header (mail-header-number
- (car (car (cdr (car thread))))))
+ ;; We remember that we probably want to output a dummy
+ ;; root.
+ (setq gnus-tmp-dummy-line header)
(setq gnus-tmp-prev-subject header))
(t
;; We do not make a root for the gathered
(setq new-roots (nconc new-roots (list (car thread)))
thread-end t
header nil))
- ((and gnus-newsgroup-limit
- (not (memq number gnus-newsgroup-limit)))
+ ((not (memq number gnus-newsgroup-limit))
(setq gnus-tmp-gathered
(nconc (mapcar
(lambda (h) (mail-header-number (car h)))
(and
header
(progn
+ ;; We may have an old dummy line to output before this
+ ;; article.
+ (when gnus-tmp-dummy-line
+ (gnus-summary-insert-dummy-line
+ nil gnus-tmp-dummy-line header))
+
+ ;; Compute the mark.
(setq
mark
(cond
((memq number gnus-newsgroup-expirable) gnus-expirable-mark)
(t (or (cdr (assq number gnus-newsgroup-reads))
gnus-ancient-mark))))
+
+ ;; Actually insert the line.
(inline
(gnus-summary-insert-line
nil header level nil mark
(or threads (setq level 0)))))
(message "Generating summary...done"))
-(defun gnus-summary-prepare-unthreaded (headers &optional cull)
+(defun gnus-summary-prepare-unthreaded (headers)
+ "Generate an unthreaded summary buffer based on HEADERS."
(let (header number mark)
(while headers
number (mail-header-number header))
;; We may have to root out some bad articles...
- (if (and gnus-newsgroup-limit
- (not (memq number gnus-newsgroup-limit)))
- ;; Don't print this article - it's not in the limit.
- ()
+ (when (memq number gnus-newsgroup-limit)
(setq mark
(cond
((memq number gnus-newsgroup-marked) gnus-ticked-mark)
(mapcar (lambda (headers) (mail-header-number headers))
gnus-newsgroup-headers)))
;; Set the initial limit.
- (setq gnus-newsgroup-limit (copy-sequence gnus-newsgroup-unreads))
+ (setq gnus-newsgroup-limit (copy-sequence articles))
;; Adjust and set lists of article marks.
(and info
(let (marked)
number)
(if (not header)
() ; We couldn't fetch ID.
- ;; Add this article to the current limit.
- (push (setq number (mail-header-number header)) gnus-newsgroup-limit)
;; Rebuild the thread that this article is part of and go to the
;; article we have fetched.
(gnus-rebuild-thread (mail-header-id header))
- (gnus-summary-goto-subject number)
+ (gnus-summary-goto-subject (setq number (mail-header-number header)))
(and (> number 0)
(progn
;; We have to update the boundaries, possibly.
(prog1
(gnus-article-prepare article all-header)
(gnus-summary-show-thread)
- (if (eq (gnus-summary-article-mark) gnus-dummy-mark)
- (gnus-summary-find-next))
(run-hooks 'gnus-select-article-hook)
(gnus-summary-recenter)
(gnus-summary-goto-subject article)
(interactive "P")
(gnus-set-global-variables)
(prog2
- (if total (setq gnus-newsgroup-limits nil))
- (gnus-summary-limit nil 'pop))
- (gnus-summary-position-point))
+ (if total (setq gnus-newsgroup-limits
+ (list (mapcar (lambda (h) (mail-header-number h))
+ gnus-newsgroup-headers))))
+ (gnus-summary-limit nil 'pop)
+ (gnus-summary-position-point)))
(defun gnus-summary-limit-to-subject (subject)
"Limit the summary buffer to articles that have subjects that match a regexp."
(make-obsolete 'gnus-summary-delete-marked-with 'gnus-summary-limit-to-marks)
(defun gnus-summary-limit-to-marks (marks &optional reverse)
- "Limit the summary buffer to articles that are not marked with MARKS (e.g. \"DK\").
-If REVERSE, limit the summary buffer to articles that are marked
+ "Limit the summary buffer to articles that are marked with MARKS (e.g. \"DK\").
+If REVERSE, limit the summary buffer to articles that are not marked
with MARKS. MARKS can either be a string of marks or a list of marks.
Returns how many articles were removed."
(interactive "sMarks: ")
(gnus-set-global-variables)
(prog1
- (if gnus-newsgroup-adaptive
- (gnus-score-remove-lines-adaptive marks)
- (let ((data gnus-newsgroup-data)
- (marks (if (listp marks) marks
- (append marks nil))) ; Transform to list.
- articles)
- (while data
- (and (if reverse (not (memq (gnus-data-mark (car data)) marks))
- (memq (gnus-data-mark (car data)) marks))
- (setq articles (cons (gnus-data-number (car data)) articles)))
- (setq data (cdr data)))
- (gnus-summary-limit articles)))
+ (let ((data gnus-newsgroup-data)
+ (marks (if (listp marks) marks
+ (append marks nil))) ; Transform to list.
+ articles)
+ (while data
+ (and (if reverse (not (memq (gnus-data-mark (car data)) marks))
+ (memq (gnus-data-mark (car data)) marks))
+ (setq articles (cons (gnus-data-number (car data)) articles)))
+ (setq data (cdr data)))
+ (gnus-summary-limit articles))
(gnus-summary-position-point)))
(defun gnus-summary-limit-to-score (&optional score)
(if (and (null gnus-newsgroup-dormant)
(not (eq gnus-fetch-old-headers 'some))
(null gnus-summary-expunge-below))
- () ; Do nothing.
+ () ; Do nothing.
(setq gnus-newsgroup-limits
(cons gnus-newsgroup-limit gnus-newsgroup-limits))
(setq gnus-newsgroup-limit nil)
(gnus-summary-limit-children (car nodes))
(setq nodes (cdr nodes))))))
gnus-newsgroup-dependencies)
+ (when (not gnus-newsgroup-limit)
+ (setq gnus-newsgroup-limit (pop gnus-newsgroup-limits)))
gnus-newsgroup-limit))
(defun gnus-summary-limit-children (thread)
(format "these %d articles" (length articles))
"this article")
(if gnus-current-move-group
- (format "(%s default) " gnus-current-move-group)
+ (format "(default %s) " gnus-current-move-group)
""))
gnus-active-hashtb nil nil prefix)))
(if to-newsgroup
(info (nth 2 entry))
(article (car articles)))
(gnus-summary-goto-subject article)
- (beginning-of-line)
- (delete-region (point) (progn (forward-line 1) (point)))
+ (gnus-summary-mark-article article gnus-canceled-mark)
;; Update the group that has been moved to.
(if (not info)
() ; This group does not exist yet.
(setcar (cdr (cdr info))
(gnus-add-to-range (nth 2 info)
(list (cdr art-group)))))
+
;; Copy any marks over to the new group.
(let ((marks '((tick . gnus-newsgroup-marked)
(dormant . gnus-newsgroup-dormant)
(bookmark . gnus-newsgroup-bookmarks)
(reply . gnus-newsgroup-replied)))
(to-article (cdr art-group)))
+
+ ;; See whether the article is to be put in the cache.
+ (when gnus-use-cache
+ (gnus-cache-possibly-enter-article
+ (car info) to-article
+ (let ((header (copy-sequence
+ (gnus-summary-article-header article))))
+ (mail-header-set-number to-article header)
+ header)
+ (memq article gnus-newsgroup-marked)
+ (memq article gnus-newsgroup-dormant)
+ (memq article gnus-newsgroup-unreads)))
+
(while marks
(if (memq article (symbol-value (cdr (car marks))))
(gnus-add-marked-articles
(format "these %d articles" (length articles))
"this article")
(if gnus-current-move-group
- (format "(%s default) " gnus-current-move-group)
+ (format "(default %s) " gnus-current-move-group)
""))
gnus-active-hashtb nil nil prefix)))
(if to-newsgroup
(setcar (cdr (cdr info))
(gnus-add-to-range (nth 2 info)
(list (cdr art-group)))))
+
;; Copy any marks over to the new group.
(let ((marks '((tick . gnus-newsgroup-marked)
(dormant . gnus-newsgroup-dormant)
(bookmark . gnus-newsgroup-bookmarks)
(reply . gnus-newsgroup-replied)))
(to-article (cdr art-group)))
- (while marks
- (if (memq article (symbol-value (cdr (car marks))))
- (gnus-add-marked-articles
- (car info) (car (car marks)) (list to-article) info))
- (setq marks (cdr marks))))))
+
+ ;; See whether the article is to be put in the cache.
+ (when gnus-use-cache
+ (gnus-cache-possibly-enter-article
+ (car info) to-article
+ (let ((header (copy-sequence
+ (gnus-summary-article-header article))))
+ (mail-header-set-number to-article header)
+ header)
+ (memq article gnus-newsgroup-marked)
+ (memq article gnus-newsgroup-dormant)
+ (memq article gnus-newsgroup-unreads)))
+
+ (while marks
+ (if (memq article (symbol-value (cdr (car marks))))
+ (gnus-add-marked-articles
+ (car info) (car (car marks)) (list to-article) info))
+ (setq marks (cdr marks))))))
(gnus-message 1 "Couldn't copy article %s" (car articles)))
(gnus-summary-remove-process-mark (car articles))
(setq articles (cdr articles)))
(defun gnus-summary-delete-article (&optional n)
"Delete the N next (mail) articles.
This command actually deletes articles. This is not a marking
-command. The article will disappear forever from you life, never to
+command. The article will disappear forever from your life, never to
return.
If N is negative, delete backwards.
If N is nil and articles have been marked with the process mark,
;; Skip dummy header line.
(save-excursion
(gnus-summary-show-thread)
- (if (eq (gnus-summary-article-mark) gnus-dummy-mark)
- (gnus-summary-find-next))
(let ((buffer-read-only nil))
;; Set score.
(gnus-summary-update-mark
(if (gnus-summary-goto-subject article)
(progn
(gnus-summary-show-thread)
- (and (eq (gnus-summary-article-mark) gnus-dummy-mark)
- (gnus-summary-find-next))
(gnus-summary-update-mark gnus-process-mark 'replied)
t))))
(if (gnus-summary-goto-subject article)
(progn
(gnus-summary-show-thread)
- (and (eq (gnus-summary-article-mark) gnus-dummy-mark)
- (gnus-summary-find-next))
(gnus-summary-update-mark ? 'replied)
(if (memq article gnus-newsgroup-replied)
(gnus-summary-update-mark gnus-replied-mark 'replied))
(setq mark gnus-expirable-mark)
(setq gnus-newsgroup-expirable
(cons article gnus-newsgroup-expirable))))
- (while (eq (gnus-summary-article-mark) gnus-dummy-mark)
- (gnus-summary-find-next))
;; Fix the mark.
(gnus-summary-update-mark mark 'unread)
t))
(= mark gnus-ticked-mark)
(= mark gnus-dormant-mark) (= mark gnus-unread-mark))))
- (while (eq (gnus-summary-article-mark) gnus-dummy-mark)
- (gnus-summary-find-next))
;; Fix the mark.
(gnus-summary-update-mark mark 'unread)
t))
(if (gnus-summary-goto-subject article)
(let ((buffer-read-only nil))
(gnus-summary-show-thread)
- (and (eq (gnus-summary-article-mark) gnus-dummy-mark)
- (gnus-summary-find-next))
;; Fix the mark.
(gnus-summary-update-mark mark 'unread)
t))))
(while pslist
(gnus-summary-goto-subject (or (cdr (assq 'article (car pslist)))
(gnus-summary-article-number)))
+ (beginning-of-line)
(setq b (point))
(put-text-property
(point)
;; We have found the header.
header
;; We have to really fetch the header to this article.
- (if (setq where
- (if (gnus-check-backend-function 'request-head group)
- (gnus-request-head id group)
- (gnus-request-article id group)))
- (save-excursion
- (set-buffer nntp-server-buffer)
- (and (search-forward "\n\n" nil t)
- (delete-region (1- (point)) (point-max)))
- (goto-char (point-max))
- (insert ".\n")
- (goto-char (point-min))
- (insert "211 "
- (int-to-string
- (cond
- ((numberp id)
- id)
- ((cdr where)
- (cdr where))
- (t
- gnus-reffed-article-number)))
- " Article retrieved.\n")
- (if (not (setq header (car (gnus-get-newsgroup-headers))))
- () ; Malformed head.
- (if (and (stringp id)
- (not (string= (gnus-group-real-name group)
- (car where))))
- ;; If we fetched by Message-ID and the article came
- ;; from a different group, we fudge some bogus article
- ;; numbers for this article.
- (mail-header-set-number header gnus-reffed-article-number))
- (setq gnus-reffed-article-number (1- gnus-reffed-article-number))
- (setq gnus-newsgroup-headers
- (cons header gnus-newsgroup-headers))
- (setq gnus-current-headers header)
- header))))))
+ (when (setq where
+ (if (gnus-check-backend-function 'request-head group)
+ (gnus-request-head id group)
+ (gnus-request-article id group)))
+ (save-excursion
+ (set-buffer nntp-server-buffer)
+ (and (search-forward "\n\n" nil t)
+ (delete-region (1- (point)) (point-max)))
+ (goto-char (point-max))
+ (insert ".\n")
+ (goto-char (point-min))
+ (insert "211 "
+ (int-to-string
+ (cond
+ ((numberp id)
+ id)
+ ((cdr where)
+ (cdr where))
+ (t
+ gnus-reffed-article-number)))
+ " Article retrieved.\n"))
+ (if (not (setq header (car (gnus-get-newsgroup-headers))))
+ () ; Malformed head.
+ (if (and (stringp id)
+ (not (string= (gnus-group-real-name group)
+ (car where))))
+ ;; If we fetched by Message-ID and the article came
+ ;; from a different group, we fudge some bogus article
+ ;; numbers for this article.
+ (mail-header-set-number header gnus-reffed-article-number))
+ (decf gnus-reffed-article-number)
+ (push header gnus-newsgroup-headers)
+ (setq gnus-current-headers header)
+ (push (mail-header-number header) gnus-newsgroup-limit)
+ header)))))
(defun gnus-article-prepare (article &optional all-headers header)
"Prepare ARTICLE in article mode buffer.