comparison lisp/gnus/gnus-sum.el @ 18:d95e72db5c07 r19-15b92

Import from CVS: tag r19-15b92
author cvs
date Mon, 13 Aug 2007 08:49:43 +0200
parents 0293115a14e9
children 8fc7fe29b841
comparison
equal deleted inserted replaced
17:4579af9d8826 18:d95e72db5c07
1590 ("Cache" 1590 ("Cache"
1591 ["Enter article" gnus-cache-enter-article t] 1591 ["Enter article" gnus-cache-enter-article t]
1592 ["Remove article" gnus-cache-remove-article t]) 1592 ["Remove article" gnus-cache-remove-article t])
1593 ["Enter digest buffer" gnus-summary-enter-digest-group t] 1593 ["Enter digest buffer" gnus-summary-enter-digest-group t]
1594 ["Isearch article..." gnus-summary-isearch-article t] 1594 ["Isearch article..." gnus-summary-isearch-article t]
1595 ["Search articles forward..." gnus-summary-search-article-forward t]
1596 ["Search articles backward..." gnus-summary-search-article-backward t]
1597 ["Beginning of the article" gnus-summary-beginning-of-article t] 1595 ["Beginning of the article" gnus-summary-beginning-of-article t]
1598 ["End of the article" gnus-summary-end-of-article t] 1596 ["End of the article" gnus-summary-end-of-article t]
1599 ["Fetch parent of article" gnus-summary-refer-parent-article t] 1597 ["Fetch parent of article" gnus-summary-refer-parent-article t]
1600 ["Fetch referenced articles" gnus-summary-refer-references t] 1598 ["Fetch referenced articles" gnus-summary-refer-references t]
1601 ["Fetch article with id..." gnus-summary-refer-article t] 1599 ["Fetch article with id..." gnus-summary-refer-article t]
1738 ["Regenerate" gnus-summary-prepare t] 1736 ["Regenerate" gnus-summary-prepare t]
1739 ["Insert cached articles" gnus-summary-insert-cached-articles t] 1737 ["Insert cached articles" gnus-summary-insert-cached-articles t]
1740 ["Toggle threading" gnus-summary-toggle-threads t]) 1738 ["Toggle threading" gnus-summary-toggle-threads t])
1741 ["Filter articles..." gnus-summary-execute-command t] 1739 ["Filter articles..." gnus-summary-execute-command t]
1742 ["Run command on subjects..." gnus-summary-universal-argument t] 1740 ["Run command on subjects..." gnus-summary-universal-argument t]
1741 ["Search articles forward..." gnus-summary-search-article-forward t]
1742 ["Search articles backward..." gnus-summary-search-article-backward t]
1743 ["Toggle line truncation" gnus-summary-toggle-truncation t] 1743 ["Toggle line truncation" gnus-summary-toggle-truncation t]
1744 ["Expand window" gnus-summary-expand-window t] 1744 ["Expand window" gnus-summary-expand-window t]
1745 ["Expire expirable articles" gnus-summary-expire-articles 1745 ["Expire expirable articles" gnus-summary-expire-articles
1746 (gnus-check-backend-function 1746 (gnus-check-backend-function
1747 'request-expire-articles gnus-newsgroup-name)] 1747 'request-expire-articles gnus-newsgroup-name)]
1942 (defmacro gnus-data-set-pos (data pos) 1942 (defmacro gnus-data-set-pos (data pos)
1943 `(setcar (nthcdr 2 ,data) ,pos)) 1943 `(setcar (nthcdr 2 ,data) ,pos))
1944 1944
1945 (defmacro gnus-data-header (data) 1945 (defmacro gnus-data-header (data)
1946 `(nth 3 ,data)) 1946 `(nth 3 ,data))
1947
1948 (defmacro gnus-data-set-header (data header)
1949 `(setf (nth 3 ,data) ,header))
1947 1950
1948 (defmacro gnus-data-level (data) 1951 (defmacro gnus-data-level (data)
1949 `(nth 4 ,data)) 1952 `(nth 4 ,data))
1950 1953
1951 (defmacro gnus-data-unread-p (data) 1954 (defmacro gnus-data-unread-p (data)
2972 old-pos current thread data) 2975 old-pos current thread data)
2973 (if (not gnus-show-threads) 2976 (if (not gnus-show-threads)
2974 (setq thread (list (car (gnus-id-to-thread id)))) 2977 (setq thread (list (car (gnus-id-to-thread id))))
2975 ;; Get the thread this article is part of. 2978 ;; Get the thread this article is part of.
2976 (setq thread (gnus-remove-thread id))) 2979 (setq thread (gnus-remove-thread id)))
2977 (setq old-pos (point-at-bol)) 2980 (setq old-pos (gnus-point-at-bol))
2978 (setq current (save-excursion 2981 (setq current (save-excursion
2979 (and (zerop (forward-line -1)) 2982 (and (zerop (forward-line -1))
2980 (gnus-summary-article-number)))) 2983 (gnus-summary-article-number))))
2981 ;; If this is a gathered thread, we have to go some re-gathering. 2984 ;; If this is a gathered thread, we have to go some re-gathering.
2982 (when (stringp (car thread)) 2985 (when (stringp (car thread))
3131 (gnus-remove-thread-1 (pop thread))) 3134 (gnus-remove-thread-1 (pop thread)))
3132 (when (setq d (gnus-data-find number)) 3135 (when (setq d (gnus-data-find number))
3133 (goto-char (gnus-data-pos d)) 3136 (goto-char (gnus-data-pos d))
3134 (gnus-data-remove 3137 (gnus-data-remove
3135 number 3138 number
3136 (- (point-at-bol) 3139 (- (gnus-point-at-bol)
3137 (prog1 3140 (prog1
3138 (1+ (point-at-eol)) 3141 (1+ (gnus-point-at-eol))
3139 (gnus-delete-line))))))) 3142 (gnus-delete-line)))))))
3140 3143
3141 (defun gnus-sort-threads (threads) 3144 (defun gnus-sort-threads (threads)
3142 "Sort THREADS." 3145 "Sort THREADS."
3143 (if (not gnus-thread-sort-functions) 3146 (if (not gnus-thread-sort-functions)
4194 ;; (defvar gnus-nov-none-counter 0) 4197 ;; (defvar gnus-nov-none-counter 0)
4195 4198
4196 ;; This function has to be called with point after the article number 4199 ;; This function has to be called with point after the article number
4197 ;; on the beginning of the line. 4200 ;; on the beginning of the line.
4198 (defun gnus-nov-parse-line (number dependencies &optional force-new) 4201 (defun gnus-nov-parse-line (number dependencies &optional force-new)
4199 (let ((eol (point-at-eol)) 4202 (let ((eol (gnus-point-at-eol))
4200 (buffer (current-buffer)) 4203 (buffer (current-buffer))
4201 header ref id id-dep ref-dep) 4204 header ref id id-dep ref-dep)
4202 4205
4203 ;; overview: [num subject from date id refs chars lines misc] 4206 ;; overview: [num subject from date id refs chars lines misc]
4204 (unwind-protect 4207 (unwind-protect
4352 old-header) 4355 old-header)
4353 (when (setq d (gnus-data-find (mail-header-number old-header))) 4356 (when (setq d (gnus-data-find (mail-header-number old-header)))
4354 (goto-char (gnus-data-pos d)) 4357 (goto-char (gnus-data-pos d))
4355 (gnus-data-remove 4358 (gnus-data-remove
4356 number 4359 number
4357 (- (point-at-bol) 4360 (- (gnus-point-at-bol)
4358 (prog1 4361 (prog1
4359 (1+ (point-at-eol)) 4362 (1+ (gnus-point-at-eol))
4360 (gnus-delete-line)))))) 4363 (gnus-delete-line))))))
4361 (when old-header 4364 (when old-header
4362 (mail-header-set-number header (mail-header-number old-header))) 4365 (mail-header-set-number header (mail-header-number old-header)))
4363 (setq gnus-newsgroup-sparse 4366 (setq gnus-newsgroup-sparse
4364 (delq (setq number (mail-header-number header)) 4367 (delq (setq number (mail-header-number header))
6911 (or (message-fetch-field "references") "") " "))) 6914 (or (message-fetch-field "references") "") " ")))
6912 ;; We only have to update this line. 6915 ;; We only have to update this line.
6913 (save-excursion 6916 (save-excursion
6914 (save-restriction 6917 (save-restriction
6915 (message-narrow-to-head) 6918 (message-narrow-to-head)
6916 (let ((header (nnheader-parse-head t))) 6919 (let ((head (buffer-string))
6917 (set-buffer buffer) 6920 header)
6918 (mail-header-set-number header (cdr gnus-article-current)) 6921 (nnheader-temp-write nil
6919 (gnus-summary-update-article-line 6922 (insert (format "211 %d Article retrieved.\n"
6920 (cdr gnus-article-current) header)))) 6923 (cdr gnus-article-current)))
6924 (insert head)
6925 (insert ".\n")
6926 (let ((nntp-server-buffer (current-buffer)))
6927 (setq header (car (gnus-get-newsgroup-headers
6928 (save-excursion
6929 (set-buffer gnus-summary-buffer)
6930 gnus-newsgroup-dependencies)
6931 t))))
6932 (save-excursion
6933 (set-buffer gnus-summary-buffer)
6934 (gnus-data-set-header
6935 (gnus-data-find (cdr gnus-article-current))
6936 header)
6937 (gnus-summary-update-article-line
6938 (cdr gnus-article-current) header))))))
6921 ;; Update threads. 6939 ;; Update threads.
6922 (set-buffer (or buffer gnus-summary-buffer)) 6940 (set-buffer (or buffer gnus-summary-buffer))
6923 (gnus-summary-update-article (cdr gnus-article-current))) 6941 (gnus-summary-update-article (cdr gnus-article-current)))
6924 ;; Prettify the article buffer again. 6942 ;; Prettify the article buffer again.
6925 (save-excursion 6943 (save-excursion
7312 t) 7330 t)
7313 7331
7314 (defun gnus-summary-update-mark (mark type) 7332 (defun gnus-summary-update-mark (mark type)
7315 (let ((forward (cdr (assq type gnus-summary-mark-positions))) 7333 (let ((forward (cdr (assq type gnus-summary-mark-positions)))
7316 (buffer-read-only nil)) 7334 (buffer-read-only nil))
7317 (re-search-backward "[\n\r]" (point-at-bol) 'move-to-limit) 7335 (re-search-backward "[\n\r]" (gnus-point-at-bol) 'move-to-limit)
7318 (when (looking-at "\r") 7336 (when (looking-at "\r")
7319 (incf forward)) 7337 (incf forward))
7320 (when (and forward 7338 (when (and forward
7321 (<= (+ forward (point)) (point-max))) 7339 (<= (+ forward (point)) (point-max)))
7322 ;; Go to the right position on the line. 7340 ;; Go to the right position on the line.