comparison lisp/gnus/gnus-agent.el @ 67418:28264c86d408

Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-668 Merge from gnus--rel--5.10 Patches applied: * gnus--rel--5.10 (patch 157-168) - Merge from emacs--cvs-trunk--0 - Update from CVS - Update from CVS: texi/message.texi: Fix default values. 2005-12-08 Reiner Steib <Reiner.Steib@gmx.de> * lisp/gnus/mm-decode.el (mm-discouraged-alternatives): Fix custom type. Suggest image/.* in the doc string. 2005-12-07 Katsumi Yamaoka <yamaoka@jpl.org> * lisp/gnus/mm-decode.el (mm-display-external): Use nametemplate (defined in RFC1524) if it is in mailcap or add a suffix according to mailcap-mime-extensions when generating a temp filename; postpone deleting a temp file for 2 seconds for some wrappers, shell scripts, and so on, which might exit right after having started a viewer command as a background job. 2005-12-06 Reiner Steib <Reiner.Steib@gmx.de> * lisp/gnus/gnus-art.el (gnus-default-article-saver): Add user-defined `function' to custom type. 2005-12-02 ARISAWA Akihiro <ari@mbf.ocn.ne.jp> (tiny change) * lisp/gnus/mm-view.el (mm-inline-text-html-render-with-w3m): Fix misplaced parens. 2005-11-29 Reiner Steib <Reiner.Steib@gmx.de> * lisp/gnus/gnus-cache.el (gnus-cache-rename-group): Wrap doc strings and long lines. (gnus-cache-delete-group): Wrap doc strings. * lisp/gnus/gnus-agent.el (gnus-agent-rename-group) (gnus-agent-delete-group): Wrap doc strings. 2005-11-24 Pascal Rigaux <pixel@mandriva.com> (tiny change) * lisp/gnus/rfc2231.el (rfc2231-parse-string): Support non-ascii chars. 2005-11-22 Katsumi Yamaoka <yamaoka@jpl.org> * lisp/gnus/nnmail.el (nnmail-fancy-expiry-target): Use current-time instead of current-time-string. 2005-11-20 Stefan Schimanski <schimmi@debian.org> (tiny change) * lisp/gnus/nnmail.el (nnmail-fancy-expiry-target): Protect against invalid date header. 2005-11-16 Boris Samorodov <bsam@ipt.ru> (tiny patch) * lisp/gnus/imap.el (imap-kerberos4-open): Ignore SSL stuff. 2005-11-14 Kevin Greiner <kevin.greiner@compsol.cc> * lisp/gnus/gnus-agent.el (gnus-agent-article-alist-save-format): Changed internal variable to a custom variable. Changed default value from compressed(2) to uncompressed(1). (gnus-agent-read-agentview): Reversed revision 7.8 to restore support for uncompressed agentview files. Taken together, reading the agentview file should now be 6-7 times faster. (gnus-agent-long-article, gnus-agent-short-article, gnus-agent-score): Renamed category keywords to match gnus-cus. (gnus-agent-summary-fetch-series): Modified to protect against gnus-agent-summary-fetch-group clearing processable flags. (gnus-agent-synchronize-group-flags): Update live group buffer as synchronization may occur due to the user toggling the plugged status. (gnus-agent-braid-nov): Now tests new nov entries for duplicates which are removed. The invalid sort check then triggers a rescan after the sort as sorting may have moved duplicate entries such that they can be cheaply detected. (gnus-agent-read-local): Trivial fix to format of error message to display actual error condition. (gnus-agent-save-local): Avoid saving symbols that are bound to nil as they simply result in a warning message in gnus-agent-read-local. (gnus-agent-fetch-group-1): Clear downloadable flag when article successfully downloaded. (gnus-agent-regenerate-group): Use gnus-agent-synchronize-group-flags to reset read status in both gnus and server. * lisp/gnus/nntp.el (nntp-end-of-line): Doc fix. (nntp-authinfo-rejected): New error condition. (nntp-wait-for): Use new error condition to signal authentication error. (nntp-retrieve-data): Rethrow new error condition to break out of recursive call to nntp-send-authinfo. 2005-11-13 Katsumi Yamaoka <yamaoka@jpl.org> * lisp/gnus/gnus-start.el (gnus-dribble-read-file): Use make-local-variable rather than make-variable-buffer-local for file-precious-flag. 2005-11-13 Katsumi Yamaoka <yamaoka@jpl.org> * lisp/gnus/gnus-start.el (gnus-dribble-read-file): Quote file-precious-flag. 2005-11-11 Jan Nieuwenhuizen <janneke@gnu.org> * lisp/gnus/gnus-start.el (gnus-dribble-read-file): Set file-precious-flag, as a buffer-local variable. This avoids creating truncated dribble files as a result of a hang up, eg. 2005-11-04 Ken Manheimer <ken.manheimer@gmail.com> * lisp/gnus/pgg-pgp.el (pgg-pgp-encrypt-region, pgg-pgp-decrypt-region) (pgg-pgp-encrypt-symmetric-region, pgg-pgp-encrypt-symmetric) (pgg-pgp-encrypt, pgg-pgp-decrypt-region, pgg-pgp-decrypt) (pgg-pgp-sign-region, pgg-pgp-sign): Add optional 'passphrase' argument to all these routines, so the passphrase can be managed externally and passed in to the system. (pgg-pgp-decrypt-region, pgg-pgp-sign-region): Use new name for pgg-add-passphrase-to-cache function. * lisp/gnus/pgg-pgp5.el (pgg-pgp5-encrypt-region, pgg-pgp5-decrypt-region) (pgg-pgp5-encrypt-symmetric-region, pgg-pgp5-encrypt-symmetric) (pgg-pgp5-encrypt, pgg-pgp5-decrypt-region, pgg-pgp5-decrypt) (pgg-pgp5-sign-region, pgg-pgp5-sign): Add optional 'passphrase' argument to all these routines, so the passphrase can be managed externally and passed in to the system. (pgg-pgp5-sign-region): Use new name of pgg-add-passphrase-to-cache function. 2005-10-30 Chong Yidong <cyd@stupidchicken.com> * lisp/gnus/imap.el (imap-open): Handle case where buffer is a buffer object. 2005-10-29 Ken Manheimer <ken.manheimer@gmail.com> * lisp/gnus/pgg-gpg.el (pgg-gpg-select-matching-key): Fix: look at the right part of the decoded armor to find the key-identifier. (pgg-gpg-lookup-key-owner): New function to return the human-readable identifier of a key owner. (pgg-gpg-lookup-id-from-key-owner): Make it easy to identify the key itself. (pgg-gpg-decrypt-region): Prompt with the key owner (rather than the key value) if we have a key and can match it against a secret key. Also, added a note pointing out fact that the prompt only indicates the first matching key. * lisp/gnus/pgg.el (pgg-decrypt): Passing along 'passphrase' in call to pgg-decrypt-region. (pgg-pending-timers): A new hash for tracking the passphrase cache timers, so that new ones supercede old ones. (pgg-add-passphrase-to-cache): Rename from `pgg-add-passphrase-cache' to reduce confusion (all callers changed). Modified to cancel old timers when new ones are added. (pgg-remove-passphrase-from-cache): Rename from `pgg-remove-passphrase-cache' to reduce confusion (all callers changed). Modified to cancel old timers when their keys are removed from the cache. (pgg-cancel-timer): In Emacs, an alias for cancel-timer; in XEmacs, an indirection to delete-itimer. (pgg-read-passphrase-from-cache, pgg-read-passphrase): Extract pgg-read-passphrase-from-cache from pgg-read-passphrase so users can only check cache without risk of prompting. Correct bug in notruncate behavior. (pgg-read-passphrase-from-cache, pgg-read-passphrase) (pgg-add-passphrase-cache, pgg-remove-passphrase-cache): Add informative docstrings. (pgg-decrypt): Convey provided passphrase in subordinate call to pgg-decrypt-region. 2005-10-20 Ken Manheimer <ken.manheimer+emacs@gmail.com> * lisp/gnus/pgg.el (pgg-encrypt-region, pgg-encrypt-symmetric-region) (pgg-encrypt-symmetric, pgg-encrypt, pgg-decrypt-region) (pgg-decrypt, pgg-sign-region, pgg-sign): Add optional 'passphrase' argument, so the passphrase can be managed externally and then passed in to the system. * lisp/gnus/pgg.el (pgg-read-passphrase, pgg-add-passphrase-cache) (pgg-remove-passphrase-cache): Add optional 'notruncate' argument, so the passphrase cache can be used reliably with identifiers besides a pgp packet's key id. * lisp/gnus/pgg-gpg.el (pgg-pgp-encrypt-region) (pgg-pgp-encrypt-symmetric-region, pgg-pgp-encrypt-symmetric) (pgg-pgp-encrypt, pgg-pgp-decrypt-region, pgg-pgp-decrypt) (pgg-pgp-sign-region, pgg-pgp-sign): Add optional 'passphrase' argument to all these routines, so the passphrase can be managed externally and passed in to the system. * lisp/gnus/pgg-gpg.el (pgg-gpg-possibly-cache-passphrase): Add optional 'notruncate' argument, so the passphrase cache can be used reliably with identifiers besides a pgp packet's key id. 2005-10-29 Sascha Wilde <swilde@sha-bang.de> * lisp/gnus/pgg-gpg.el (pgg-gpg-encrypt-symmetric-region): New function for symmetric encryption. (pgg-gpg-symmetric-key-p): New function to check for an symmetric encrypted session key. (pgg-gpg-decrypt-region): When decrypting a symmetric encrypted message ask for the passphrase in a proper way. * lisp/gnus/pgg.el (pgg-encrypt-symmetric, pgg-encrypt-symmetric-region): New user commands for symmetric encryption. 2005-12-05 Katsumi Yamaoka <yamaoka@jpl.org> * man/pgg.texi (User Commands): Fix description of pgg-verify-region. (Selecting an implementation): Fix descriptions. 2005-11-30 Katsumi Yamaoka <yamaoka@jpl.org> * man/message.texi (Various Message Variables): Addition. 2005-11-29 Katsumi Yamaoka <yamaoka@jpl.org> * man/message.texi: Fix default values. 2005-11-25 Katsumi Yamaoka <yamaoka@jpl.org> * man/message.texi (Header Commands): Clarify descriptions of message-cross-post-followup-to, message-reduce-to-to-cc, and message-insert-wide-reply. (Various Commands): Fix kindex for message-kill-to-signature; clarify description of message-tab. 2005-11-22 Katsumi Yamaoka <yamaoka@jpl.org> * man/message.texi (Mailing Lists): Fix description about MFT. * man/gnus.texi (Emacs Lisp): Use ~/.gnus.el instead of ~/.emacs. 2005-11-17 Katsumi Yamaoka <yamaoka@jpl.org> * man/gnus.texi (Slow Terminal Connection): Replace old description with new one. 2005-11-16 Katsumi Yamaoka <yamaoka@jpl.org> * man/gnus.texi (Oort Gnus): Use ~/.gnus.el instead of ~/.emacs; replace X-Draft-Headers with X-Draft-From. 2005-11-14 Katsumi Yamaoka <yamaoka@jpl.org> * man/gnus.texi (Various Various): Fix the default value of nnheader-max-head-length. (Gnus Versions): Fix typo.
author Miles Bader <miles@gnu.org>
date Fri, 09 Dec 2005 08:57:58 +0000
parents cb3218d6e82a
children 1c477099d3ac
comparison
equal deleted inserted replaced
67417:29df8eb9daf1 67418:28264c86d408
210 "If non-nil, `gnus-group-send-queue' will prompt if called when 210 "If non-nil, `gnus-group-send-queue' will prompt if called when
211 unplugged." 211 unplugged."
212 :version "22.1" 212 :version "22.1"
213 :group 'gnus-agent 213 :group 'gnus-agent
214 :type 'boolean) 214 :type 'boolean)
215
216 (defcustom gnus-agent-article-alist-save-format 1
217 "Indicates whether to use compression(2), verses no
218 compression(1), when writing agentview files. The compressed
219 files do save space but load times are 6-7 times higher. A
220 group must be opened then closed for the agentview to be
221 updated using the new format."
222 :version "22.1"
223 :group 'gnus-agent
224 :type '(radio (const :format "Compressed" 2)
225 (const :format "Uncompressed" 1)))
215 226
216 ;;; Internal variables 227 ;;; Internal variables
217 228
218 (defvar gnus-agent-history-buffers nil) 229 (defvar gnus-agent-history-buffers nil)
219 (defvar gnus-agent-buffer-alist nil) 230 (defvar gnus-agent-buffer-alist nil)
355 (gnus-agent-cat-defaccessor 366 (gnus-agent-cat-defaccessor
356 gnus-agent-cat-groups agent-groups) 367 gnus-agent-cat-groups agent-groups)
357 (gnus-agent-cat-defaccessor 368 (gnus-agent-cat-defaccessor
358 gnus-agent-cat-high-score agent-high-score) 369 gnus-agent-cat-high-score agent-high-score)
359 (gnus-agent-cat-defaccessor 370 (gnus-agent-cat-defaccessor
360 gnus-agent-cat-length-when-long agent-length-when-long) 371 gnus-agent-cat-length-when-long agent-long-article)
361 (gnus-agent-cat-defaccessor 372 (gnus-agent-cat-defaccessor
362 gnus-agent-cat-length-when-short agent-length-when-short) 373 gnus-agent-cat-length-when-short agent-short-article)
363 (gnus-agent-cat-defaccessor 374 (gnus-agent-cat-defaccessor
364 gnus-agent-cat-low-score agent-low-score) 375 gnus-agent-cat-low-score agent-low-score)
365 (gnus-agent-cat-defaccessor 376 (gnus-agent-cat-defaccessor
366 gnus-agent-cat-predicate agent-predicate) 377 gnus-agent-cat-predicate agent-predicate)
367 (gnus-agent-cat-defaccessor 378 (gnus-agent-cat-defaccessor
368 gnus-agent-cat-score-file agent-score-file) 379 gnus-agent-cat-score-file agent-score)
369 (gnus-agent-cat-defaccessor 380 (gnus-agent-cat-defaccessor
370 gnus-agent-cat-enable-undownloaded-faces agent-enable-undownloaded-faces) 381 gnus-agent-cat-enable-undownloaded-faces agent-enable-undownloaded-faces)
371 382
372 383
373 ;; This form is equivalent to defsetf except that it calls make-symbol 384 ;; This form is equivalent to defsetf except that it calls make-symbol
374 ;; whereas defsetf calls gensym (Using gensym creates a run-time 385 ;; whereas defsetf calls gensym (Using gensym creates a run-time
375 ;; dependency on the CL library). 386 ;; dependency on the CL library).
856 (cadr method))))) 867 (cadr method)))))
857 (gnus-agent-synchronize-flags-server method))) 868 (gnus-agent-synchronize-flags-server method)))
858 869
859 ;;;###autoload 870 ;;;###autoload
860 (defun gnus-agent-rename-group (old-group new-group) 871 (defun gnus-agent-rename-group (old-group new-group)
861 "Rename fully-qualified OLD-GROUP as NEW-GROUP. Always updates the agent, even when 872 "Rename fully-qualified OLD-GROUP as NEW-GROUP.
862 disabled, as the old agent files would corrupt gnus when the agent was 873 Always updates the agent, even when disabled, as the old agent
863 next enabled. Depends upon the caller to determine whether group renaming is supported." 874 files would corrupt gnus when the agent was next enabled.
875 Depends upon the caller to determine whether group renaming is
876 supported."
864 (let* ((old-command-method (gnus-find-method-for-group old-group)) 877 (let* ((old-command-method (gnus-find-method-for-group old-group))
865 (old-path (directory-file-name 878 (old-path (directory-file-name
866 (let (gnus-command-method old-command-method) 879 (let (gnus-command-method old-command-method)
867 (gnus-agent-group-pathname old-group)))) 880 (gnus-agent-group-pathname old-group))))
868 (new-command-method (gnus-find-method-for-group new-group)) 881 (new-command-method (gnus-find-method-for-group new-group))
886 (car old-local) (cdr old-local) 899 (car old-local) (cdr old-local)
887 new-real-group new-command-method))))) 900 new-real-group new-command-method)))))
888 901
889 ;;;###autoload 902 ;;;###autoload
890 (defun gnus-agent-delete-group (group) 903 (defun gnus-agent-delete-group (group)
891 "Delete fully-qualified GROUP. Always updates the agent, even when 904 "Delete fully-qualified GROUP.
892 disabled, as the old agent files would corrupt gnus when the agent was 905 Always updates the agent, even when disabled, as the old agent
893 next enabled. Depends upon the caller to determine whether group deletion is supported." 906 files would corrupt gnus when the agent was next enabled.
907 Depends upon the caller to determine whether group deletion is
908 supported."
894 (let* ((command-method (gnus-find-method-for-group group)) 909 (let* ((command-method (gnus-find-method-for-group group))
895 (path (directory-file-name 910 (path (directory-file-name
896 (let (gnus-command-method command-method) 911 (let (gnus-command-method command-method)
897 (gnus-agent-group-pathname group))))) 912 (gnus-agent-group-pathname group)))))
898 (gnus-delete-directory path) 913 (gnus-delete-directory path)
1132 (defun gnus-agent-summary-fetch-series () 1147 (defun gnus-agent-summary-fetch-series ()
1133 (interactive) 1148 (interactive)
1134 (when gnus-newsgroup-processable 1149 (when gnus-newsgroup-processable
1135 (setq gnus-newsgroup-downloadable 1150 (setq gnus-newsgroup-downloadable
1136 (let* ((dl gnus-newsgroup-downloadable) 1151 (let* ((dl gnus-newsgroup-downloadable)
1137 (gnus-newsgroup-downloadable 1152 (processable (sort (gnus-copy-sequence gnus-newsgroup-processable) '<))
1138 (sort (gnus-copy-sequence gnus-newsgroup-processable) '<)) 1153 (gnus-newsgroup-downloadable processable))
1139 (fetched-articles (gnus-agent-summary-fetch-group))) 1154 (gnus-agent-summary-fetch-group)
1155
1156 ;; For each article that I processed that is no longer
1157 ;; undownloaded, remove its processable mark.
1158
1159 (mapc #'gnus-summary-remove-process-mark
1160 (gnus-sorted-ndifference gnus-newsgroup-processable gnus-newsgroup-undownloaded))
1161
1140 ;; The preceeding call to (gnus-agent-summary-fetch-group) 1162 ;; The preceeding call to (gnus-agent-summary-fetch-group)
1141 ;; updated gnus-newsgroup-downloadable to remove each 1163 ;; updated the temporary gnus-newsgroup-downloadable to
1142 ;; article successfully fetched. 1164 ;; remove each article successfully fetched. Now, I
1143 1165 ;; update the real gnus-newsgroup-downloadable to only
1144 ;; For each article that I processed, remove its 1166 ;; include undownloaded articles.
1145 ;; processable mark IF the article is no longer 1167 (gnus-sorted-ndifference dl (gnus-sorted-ndifference processable gnus-newsgroup-undownloaded))))))
1146 ;; downloadable (i.e. it's already downloaded)
1147 (dolist (article gnus-newsgroup-processable)
1148 (unless (memq article gnus-newsgroup-downloadable)
1149 (gnus-summary-remove-process-mark article)))
1150 (gnus-sorted-ndifference dl fetched-articles)))))
1151 1168
1152 (defun gnus-agent-summary-fetch-group (&optional all) 1169 (defun gnus-agent-summary-fetch-group (&optional all)
1153 "Fetch the downloadable articles in the group. 1170 "Fetch the downloadable articles in the group.
1154 Optional arg ALL, if non-nil, means to fetch all articles." 1171 Optional arg ALL, if non-nil, means to fetch all articles."
1155 (interactive "P") 1172 (interactive "P")
1238 (gnus-info-set-marks info (cons (setq info-marks (list mark)) (gnus-info-marks info)))) 1255 (gnus-info-set-marks info (cons (setq info-marks (list mark)) (gnus-info-marks info))))
1239 (setcdr info-marks (funcall (if (eq what 'add) 1256 (setcdr info-marks (funcall (if (eq what 'add)
1240 'gnus-range-add 1257 'gnus-range-add
1241 'gnus-remove-from-range) 1258 'gnus-remove-from-range)
1242 (cdr info-marks) 1259 (cdr info-marks)
1243 range))))))))) 1260 range))))))))
1261
1262 ;;Marks can be synchronized at any time by simply toggling from
1263 ;;unplugged to plugged. If that is what is happening right now, make
1264 ;;sure that the group buffer is up to date.
1265 (when (gnus-buffer-live-p gnus-group-buffer)
1266 (gnus-group-update-group group t)))
1244 nil)) 1267 nil))
1245 1268
1246 (defun gnus-agent-save-active (method) 1269 (defun gnus-agent-save-active (method)
1247 (when (gnus-agent-method-p method) 1270 (when (gnus-agent-method-p method)
1248 (let* ((gnus-command-method method) 1271 (let* ((gnus-command-method method)
1328 1351
1329 (goto-char (point-min)) 1352 (goto-char (point-min))
1330 (when (re-search-forward 1353 (when (re-search-forward
1331 (concat "^" (regexp-quote group) " ") nil t) 1354 (concat "^" (regexp-quote group) " ") nil t)
1332 (save-excursion 1355 (save-excursion
1333 (setq oactive-max (read (current-buffer)) ;; max 1356 (setq oactive-max (read (current-buffer)) ;; max
1334 oactive-min (read (current-buffer)))) ;; min 1357 oactive-min (read (current-buffer)))) ;; min
1335 (gnus-delete-line))) 1358 (gnus-delete-line)))
1336 (when active 1359 (when active
1337 (insert (format "%S %d %d y\n" (intern group) 1360 (insert (format "%S %d %d y\n" (intern group)
1338 (max (or oactive-max (cdr active)) (cdr active)) 1361 (max (or oactive-max (cdr active)) (cdr active))
1822 articles)) 1845 articles))
1823 1846
1824 (defsubst gnus-agent-read-article-number () 1847 (defsubst gnus-agent-read-article-number ()
1825 "Reads the article number at point. Returns nil when a valid article number can not be read." 1848 "Reads the article number at point. Returns nil when a valid article number can not be read."
1826 1849
1827 ;; It is unfortunite but the read function quietly overflows 1850 ;; It is unfortunate but the read function quietly overflows
1828 ;; integer. As a result, I have to use string operations to test 1851 ;; integer. As a result, I have to use string operations to test
1829 ;; for overflow BEFORE calling read. 1852 ;; for overflow BEFORE calling read.
1830 (when (looking-at "[0-9]+\t") 1853 (when (looking-at "[0-9]+\t")
1831 (let ((len (- (match-end 0) (match-beginning 0)))) 1854 (let ((len (- (match-end 0) (match-beginning 0))))
1832 (cond ((< len 9) 1855 (cond ((< len 9)
1911 (let ((p (point))) 1934 (let ((p (point)))
1912 (insert-buffer-substring gnus-agent-overview-buffer start) 1935 (insert-buffer-substring gnus-agent-overview-buffer start)
1913 (goto-char p)) 1936 (goto-char p))
1914 1937
1915 (setq last (or last -134217728)) 1938 (setq last (or last -134217728))
1939 (while (catch 'problems
1916 (let (sort art) 1940 (let (sort art)
1917 (while (not (eobp)) 1941 (while (not (eobp))
1918 (setq art (gnus-agent-read-article-number)) 1942 (setq art (gnus-agent-read-article-number))
1919 (cond ((not art) 1943 (cond ((not art)
1920 ;; Bad art num - delete this line 1944 ;; Bad art num - delete this line
1922 (delete-region (point) (progn (forward-line 1) (point)))) 1946 (delete-region (point) (progn (forward-line 1) (point))))
1923 ((< art last) 1947 ((< art last)
1924 ;; Art num out of order - enable sort 1948 ;; Art num out of order - enable sort
1925 (setq sort t) 1949 (setq sort t)
1926 (forward-line 1)) 1950 (forward-line 1))
1951 ((= art last)
1952 ;; Bad repeat of art number - delete this line
1953 (beginning-of-line)
1954 (delete-region (point) (progn (forward-line 1) (point))))
1927 (t 1955 (t
1928 ;; Good art num 1956 ;; Good art num
1929 (setq last art) 1957 (setq last art)
1930 (forward-line 1)))) 1958 (forward-line 1))))
1931 (when sort 1959 (when sort
1932 (sort-numeric-fields 1 (point-min) (point-max))))))) 1960 ;; something is seriously wrong as we simply shouldn't see out-of-order data.
1961 ;; First, we'll fix the sort.
1962 (sort-numeric-fields 1 (point-min) (point-max))
1963
1964 ;; but now we have to consider that we may have duplicate rows...
1965 ;; so reset to beginning of file
1966 (goto-char (point-min))
1967 (setq last -134217728)
1968
1969 ;; and throw a code that restarts this scan
1970 (throw 'problems t))
1971 nil))))))
1933 1972
1934 ;; Keeps the compiler from warning about the free variable in 1973 ;; Keeps the compiler from warning about the free variable in
1935 ;; gnus-agent-read-agentview. 1974 ;; gnus-agent-read-agentview.
1936 (eval-when-compile 1975 (eval-when-compile
1937 (defvar gnus-agent-read-agentview)) 1976 (defvar gnus-agent-read-agentview))
1943 (setq gnus-agent-article-alist 1982 (setq gnus-agent-article-alist
1944 (gnus-cache-file-contents 1983 (gnus-cache-file-contents
1945 (gnus-agent-article-name ".agentview" group) 1984 (gnus-agent-article-name ".agentview" group)
1946 'gnus-agent-file-loading-cache 1985 'gnus-agent-file-loading-cache
1947 'gnus-agent-read-agentview)))) 1986 'gnus-agent-read-agentview))))
1948
1949 ;; Save format may be either 1 or 2. Two is the new, compressed
1950 ;; format that is still being tested. Format 1 is uncompressed but
1951 ;; known to be reliable.
1952 (defconst gnus-agent-article-alist-save-format 2)
1953 1987
1954 (defun gnus-agent-read-agentview (file) 1988 (defun gnus-agent-read-agentview (file)
1955 "Load FILE and do a `read' there." 1989 "Load FILE and do a `read' there."
1956 (with-temp-buffer 1990 (with-temp-buffer
1957 (condition-case nil 1991 (condition-case nil
1962 (version (condition-case nil (read (current-buffer)) 1996 (version (condition-case nil (read (current-buffer))
1963 (end-of-file 0))) 1997 (end-of-file 0)))
1964 changed-version) 1998 changed-version)
1965 1999
1966 (cond 2000 (cond
1967 ((< version 2)
1968 (error "gnus-agent-read-agentview no longer supports version %d. Stop gnus, manually evaluate gnus-agent-convert-to-compressed-agentview, then restart gnus." version))
1969 ((= version 0) 2001 ((= version 0)
1970 (let ((inhibit-quit t) 2002 (let ((inhibit-quit t)
1971 entry) 2003 entry)
1972 (gnus-agent-open-history) 2004 (gnus-agent-open-history)
1973 (set-buffer (gnus-agent-history-buffer)) 2005 (set-buffer (gnus-agent-history-buffer))
1994 (cdr comp-list))))) 2026 (cdr comp-list)))))
1995 (mapcar (lambda (article-id) 2027 (mapcar (lambda (article-id)
1996 (setq uncomp (cons (cons article-id state) uncomp))) 2028 (setq uncomp (cons (cons article-id state) uncomp)))
1997 sequence))) 2029 sequence)))
1998 alist) 2030 alist)
1999 (setq alist (sort uncomp 'car-less-than-car))))) 2031 (setq alist (sort uncomp 'car-less-than-car)))
2032 (setq changed-version (not (= 2 gnus-agent-article-alist-save-format)))))
2000 (when changed-version 2033 (when changed-version
2001 (let ((gnus-agent-article-alist alist)) 2034 (let ((gnus-agent-article-alist alist))
2002 (gnus-agent-save-alist gnus-agent-read-agentview))) 2035 (gnus-agent-save-alist gnus-agent-read-agentview)))
2003 alist)) 2036 alist))
2004 (file-error nil)))) 2037 (file-error nil))))
2108 (setq group (intern group my-obarray))) 2141 (setq group (intern group my-obarray)))
2109 2142
2110 ;; NOTE: The '+ 0' ensure that min and max are both numerics. 2143 ;; NOTE: The '+ 0' ensure that min and max are both numerics.
2111 (set group (cons (+ 0 min) (+ 0 max)))) 2144 (set group (cons (+ 0 min) (+ 0 max))))
2112 (error 2145 (error
2113 (gnus-message 3 "Warning - invalid agent local: %s on line %d: " 2146 (gnus-message 3 "Warning - invalid agent local: %s on line %d: %s"
2114 file line (error-message-string err)))) 2147 file line (error-message-string err))))
2115 (forward-line 1) 2148 (forward-line 1)
2116 (setq line (1+ line)))) 2149 (setq line (1+ line))))
2117 2150
2118 (set (intern "+dirty" my-obarray) nil) 2151 (set (intern "+dirty" my-obarray) nil)
2139 (cond ((not (boundp symbol)) 2172 (cond ((not (boundp symbol))
2140 nil) 2173 nil)
2141 ((member (symbol-name symbol) '("+dirty" "+method")) 2174 ((member (symbol-name symbol) '("+dirty" "+method"))
2142 nil) 2175 nil)
2143 (t 2176 (t
2177 (let ((range (symbol-value symbol)))
2178 (when range
2144 (prin1 symbol) 2179 (prin1 symbol)
2145 (let ((range (symbol-value symbol)))
2146 (princ " ") 2180 (princ " ")
2147 (princ (car range)) 2181 (princ (car range))
2148 (princ " ") 2182 (princ " ")
2149 (princ (cdr range)) 2183 (princ (cdr range))
2150 (princ "\n"))))) 2184 (princ "\n"))))))
2151 my-obarray)))))))) 2185 my-obarray))))))))
2152 2186
2153 (defun gnus-agent-get-local (group &optional gmane method) 2187 (defun gnus-agent-get-local (group &optional gmane method)
2154 (let* ((gmane (or gmane (gnus-group-real-name group))) 2188 (let* ((gmane (or gmane (gnus-group-real-name group)))
2155 (gnus-command-method (or method (gnus-find-method-for-group group))) 2189 (gnus-command-method (or method (gnus-find-method-for-group group)))
2400 ;; Update the summary buffer 2434 ;; Update the summary buffer
2401 (progn 2435 (progn
2402 (dolist (article marked-articles) 2436 (dolist (article marked-articles)
2403 (gnus-summary-set-agent-mark article t)) 2437 (gnus-summary-set-agent-mark article t))
2404 (dolist (article fetched-articles) 2438 (dolist (article fetched-articles)
2405 (if gnus-agent-mark-unread-after-downloaded 2439 (when gnus-agent-mark-unread-after-downloaded
2440 (setq gnus-newsgroup-downloadable
2441 (delq article gnus-newsgroup-downloadable))
2406 (gnus-summary-mark-article 2442 (gnus-summary-mark-article
2407 article gnus-unread-mark)) 2443 article gnus-unread-mark))
2408 (when (gnus-summary-goto-subject article nil t) 2444 (when (gnus-summary-goto-subject article nil t)
2409 (gnus-summary-update-download-mark article))) 2445 (gnus-summary-update-download-mark article)))
2410 (dolist (article unfetched-articles) 2446 (dolist (article unfetched-articles)
3189 ;; The following articles are READ, UNMARKED, and 3225 ;; The following articles are READ, UNMARKED, and
3190 ;; ORDINARY. See if they can be EXPIRED!!! 3226 ;; ORDINARY. See if they can be EXPIRED!!!
3191 ((setq type 3227 ((setq type
3192 (cond 3228 (cond
3193 ((not (integerp fetch-date)) 3229 ((not (integerp fetch-date))
3194 'read) ;; never fetched article (may expire 3230 'read) ;; never fetched article (may expire
3195 ;; right now) 3231 ;; right now)
3196 ((not (file-exists-p 3232 ((not (file-exists-p
3197 (concat dir (number-to-string 3233 (concat dir (number-to-string
3198 article-number)))) 3234 article-number))))
3199 (setf (nth 1 entry) nil) 3235 (setf (nth 1 entry) nil)
3869 (group-active (or (gnus-active group) 3905 (group-active (or (gnus-active group)
3870 (gnus-activate-group group)))) 3906 (gnus-activate-group group))))
3871 (gnus-agent-possibly-alter-active group group-active))))) 3907 (gnus-agent-possibly-alter-active group group-active)))))
3872 3908
3873 (when (and reread gnus-agent-article-alist) 3909 (when (and reread gnus-agent-article-alist)
3874 (gnus-make-ascending-articles-unread 3910 (gnus-agent-synchronize-group-flags
3875 group 3911 group
3912 (list (list
3876 (if (listp reread) 3913 (if (listp reread)
3877 reread 3914 reread
3878 (delq nil (mapcar (function (lambda (c) 3915 (delq nil (mapcar (function (lambda (c)
3879 (cond ((eq reread t) 3916 (cond ((eq reread t)
3880 (car c)) 3917 (car c))
3881 ((cdr c) 3918 ((cdr c)
3882 (car c))))) 3919 (car c)))))
3883 gnus-agent-article-alist)))) 3920 gnus-agent-article-alist)))
3921 'del '(read)))
3922 gnus-command-method)
3884 3923
3885 (when (gnus-buffer-live-p gnus-group-buffer) 3924 (when (gnus-buffer-live-p gnus-group-buffer)
3886 (gnus-group-update-group group t))) 3925 (gnus-group-update-group group t)))
3887 3926
3888 (gnus-message 5 "") 3927 (gnus-message 5 "")