aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier2010-09-19 11:16:28 +0200
committerStefan Monnier2010-09-19 11:16:28 +0200
commit149caf54c79b771d16f4ce56c5c98a4750ec327f (patch)
tree3add98ce4f83b849d062bc420c1f863d848481dd /lisp
parent7479021013b7560f12919c15e336badb22a6fcc2 (diff)
downloademacs-149caf54c79b771d16f4ce56c5c98a4750ec327f.tar.gz
emacs-149caf54c79b771d16f4ce56c5c98a4750ec327f.zip
* lisp/gnus/nnml.el (nnml-files): Add prefix to dynamic var `files'.
(nnml-generate-nov-databases-directory, nnml-generate-active-info): Update var name. (nnml-generate-nov-file): Use dolist. (nnml-directory-articles, nnml-current-group-article-to-file-alist): Use with-current-buffer.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/gnus/ChangeLog11
-rw-r--r--lisp/gnus/nnml.el31
2 files changed, 23 insertions, 19 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index a7d29366cb7..e82b213747b 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,12 @@
12010-09-19 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * nnml.el (nnml-files): Add prefix to dynamic var `files'.
4 (nnml-generate-nov-databases-directory, nnml-generate-active-info):
5 Update var name.
6 (nnml-generate-nov-file): Use dolist.
7 (nnml-directory-articles, nnml-current-group-article-to-file-alist):
8 Use with-current-buffer.
9
12010-09-18 Julien Danjou <julien@danjou.info> 102010-09-18 Julien Danjou <julien@danjou.info>
2 11
3 * gnus-html.el (gnus-html-schedule-image-fetching): Fetch all images in 12 * gnus-html.el (gnus-html-schedule-image-fetching): Fetch all images in
@@ -9,7 +18,7 @@
9 the range update right. 18 the range update right.
10 (nnimap-request-group): Don't make `M-g' bug out on group with no 19 (nnimap-request-group): Don't make `M-g' bug out on group with no
11 marks. 20 marks.
12 (nnoo): Required, so that other packages can require nnimap. 21 (nnoo): Require, so that other packages can require nnimap.
13 (nnimap-wait-for-response): Be a bit more lax in finding the end of the 22 (nnimap-wait-for-response): Be a bit more lax in finding the end of the
14 command we're looking for. This helps when the server sends more 23 command we're looking for. This helps when the server sends more
15 responses after we've gotten everything we expected. 24 responses after we've gotten everything we expected.
diff --git a/lisp/gnus/nnml.el b/lisp/gnus/nnml.el
index 8fca41eb4d2..11cdfd768c3 100644
--- a/lisp/gnus/nnml.el
+++ b/lisp/gnus/nnml.el
@@ -878,6 +878,7 @@ article number. This function is called narrowed to an article."
878 ;; Save the active file. 878 ;; Save the active file.
879 (nnmail-save-active nnml-group-alist nnml-active-file)) 879 (nnmail-save-active nnml-group-alist nnml-active-file))
880 880
881(defvar nnml-files)
881(defun nnml-generate-nov-databases-directory (dir &optional seen no-active) 882(defun nnml-generate-nov-databases-directory (dir &optional seen no-active)
882 "Regenerate the NOV database in DIR. 883 "Regenerate the NOV database in DIR.
883 884
@@ -897,9 +898,9 @@ Unless no-active is non-nil, update the active file too."
897 (file-directory-p dir)) 898 (file-directory-p dir))
898 (nnml-generate-nov-databases-directory dir seen))) 899 (nnml-generate-nov-databases-directory dir seen)))
899 ;; Do this directory. 900 ;; Do this directory.
900 (let ((files (sort (nnheader-article-to-file-alist dir) 901 (let ((nnml-files (sort (nnheader-article-to-file-alist dir)
901 'car-less-than-car))) 902 'car-less-than-car)))
902 (if (not files) 903 (if (not nnml-files)
903 (let* ((group (nnheader-file-to-group 904 (let* ((group (nnheader-file-to-group
904 (directory-file-name dir) nnml-directory)) 905 (directory-file-name dir) nnml-directory))
905 (info (cadr (assoc group nnml-group-alist)))) 906 (info (cadr (assoc group nnml-group-alist))))
@@ -907,11 +908,10 @@ Unless no-active is non-nil, update the active file too."
907 (setcar info (1+ (cdr info))))) 908 (setcar info (1+ (cdr info)))))
908 (funcall nnml-generate-active-function dir) 909 (funcall nnml-generate-active-function dir)
909 ;; Generate the nov file. 910 ;; Generate the nov file.
910 (nnml-generate-nov-file dir files) 911 (nnml-generate-nov-file dir nnml-files)
911 (unless no-active 912 (unless no-active
912 (nnmail-save-active nnml-group-alist nnml-active-file))))))) 913 (nnmail-save-active nnml-group-alist nnml-active-file)))))))
913 914
914(defvar files)
915(defun nnml-generate-active-info (dir) 915(defun nnml-generate-active-info (dir)
916 ;; Update the active info for this group. 916 ;; Update the active info for this group.
917 (let ((group (directory-file-name dir)) 917 (let ((group (directory-file-name dir))
@@ -922,9 +922,9 @@ Unless no-active is non-nil, update the active file too."
922 last (or (caadr entry) 0) 922 last (or (caadr entry) 0)
923 nnml-group-alist (delq entry nnml-group-alist)) 923 nnml-group-alist (delq entry nnml-group-alist))
924 (push (list group 924 (push (list group
925 (cons (or (caar files) (1+ last)) 925 (cons (or (caar nnml-files) (1+ last))
926 (max last 926 (max last
927 (or (caar (last files)) 927 (or (caar (last nnml-files))
928 0)))) 928 0))))
929 nnml-group-alist))) 929 nnml-group-alist)))
930 930
@@ -941,8 +941,8 @@ Unless no-active is non-nil, update the active file too."
941 ;; Delete the old NOV file. 941 ;; Delete the old NOV file.
942 (when (file-exists-p nov) 942 (when (file-exists-p nov)
943 (funcall nnmail-delete-file-function nov)) 943 (funcall nnmail-delete-file-function nov))
944 (while files 944 (dolist (file files)
945 (unless (file-directory-p (setq file (concat dir (cdar files)))) 945 (unless (file-directory-p (setq file (concat dir (cdr file))))
946 (erase-buffer) 946 (erase-buffer)
947 (nnheader-insert-file-contents file) 947 (nnheader-insert-file-contents file)
948 (narrow-to-region 948 (narrow-to-region
@@ -953,12 +953,11 @@ Unless no-active is non-nil, update the active file too."
953 (max (point-min) (1- (point))))) 953 (max (point-min) (1- (point)))))
954 (unless (zerop (buffer-size)) 954 (unless (zerop (buffer-size))
955 (goto-char (point-min)) 955 (goto-char (point-min))
956 (setq headers (nnml-parse-head chars (caar files))) 956 (setq headers (nnml-parse-head chars (car file)))
957 (with-current-buffer nov-buffer 957 (with-current-buffer nov-buffer
958 (goto-char (point-max)) 958 (goto-char (point-max))
959 (nnheader-insert-nov headers))) 959 (nnheader-insert-nov headers)))
960 (widen)) 960 (widen)))
961 (setq files (cdr files)))
962 (with-current-buffer nov-buffer 961 (with-current-buffer nov-buffer
963 (nnmail-write-region (point-min) (point-max) nov nil 'nomesg) 962 (nnmail-write-region (point-min) (point-max) nov nil 'nomesg)
964 (kill-buffer (current-buffer)))))) 963 (kill-buffer (current-buffer))))))
@@ -995,11 +994,9 @@ Use the nov database for that directory if available."
995 ;; build list from .overview if available 994 ;; build list from .overview if available
996 ;; We would use nnml-open-nov, except that nnml-nov-buffer-alist is 995 ;; We would use nnml-open-nov, except that nnml-nov-buffer-alist is
997 ;; defvoo'd, and we might get called when it hasn't been swapped in. 996 ;; defvoo'd, and we might get called when it hasn't been swapped in.
998 (save-excursion 997 (with-current-buffer (nnml-get-nov-buffer nnml-current-group)
999 (let ((list nil) 998 (let ((list nil)
1000 art 999 art)
1001 (buffer (nnml-get-nov-buffer nnml-current-group)))
1002 (set-buffer buffer)
1003 (goto-char (point-min)) 1000 (goto-char (point-min))
1004 (while (not (eobp)) 1001 (while (not (eobp))
1005 (setq art (read (current-buffer))) 1002 (setq art (read (current-buffer)))
@@ -1018,11 +1015,9 @@ Use the nov database for the current group if available."
1018 nnml-current-directory)))) 1015 nnml-current-directory))))
1019 (nnheader-article-to-file-alist nnml-current-directory) 1016 (nnheader-article-to-file-alist nnml-current-directory)
1020 ;; build list from .overview if available 1017 ;; build list from .overview if available
1021 (save-excursion 1018 (with-current-buffer (nnml-get-nov-buffer nnml-current-group)
1022 (let ((alist nil) 1019 (let ((alist nil)
1023 (buffer (nnml-get-nov-buffer nnml-current-group))
1024 art) 1020 art)
1025 (set-buffer buffer)
1026 (goto-char (point-min)) 1021 (goto-char (point-min))
1027 (while (not (eobp)) 1022 (while (not (eobp))
1028 (setq art (read (current-buffer))) 1023 (setq art (read (current-buffer)))