+2010-09-19 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * 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.
+
2010-09-18 Julien Danjou <julien@danjou.info>
* gnus-html.el (gnus-html-schedule-image-fetching): Fetch all images in
the range update right.
(nnimap-request-group): Don't make `M-g' bug out on group with no
marks.
- (nnoo): Required, so that other packages can require nnimap.
+ (nnoo): Require, so that other packages can require nnimap.
(nnimap-wait-for-response): Be a bit more lax in finding the end of the
command we're looking for. This helps when the server sends more
responses after we've gotten everything we expected.
;; Save the active file.
(nnmail-save-active nnml-group-alist nnml-active-file))
+(defvar nnml-files)
(defun nnml-generate-nov-databases-directory (dir &optional seen no-active)
"Regenerate the NOV database in DIR.
(file-directory-p dir))
(nnml-generate-nov-databases-directory dir seen)))
;; Do this directory.
- (let ((files (sort (nnheader-article-to-file-alist dir)
+ (let ((nnml-files (sort (nnheader-article-to-file-alist dir)
'car-less-than-car)))
- (if (not files)
+ (if (not nnml-files)
(let* ((group (nnheader-file-to-group
(directory-file-name dir) nnml-directory))
(info (cadr (assoc group nnml-group-alist))))
(setcar info (1+ (cdr info)))))
(funcall nnml-generate-active-function dir)
;; Generate the nov file.
- (nnml-generate-nov-file dir files)
+ (nnml-generate-nov-file dir nnml-files)
(unless no-active
(nnmail-save-active nnml-group-alist nnml-active-file)))))))
-(defvar files)
(defun nnml-generate-active-info (dir)
;; Update the active info for this group.
(let ((group (directory-file-name dir))
last (or (caadr entry) 0)
nnml-group-alist (delq entry nnml-group-alist))
(push (list group
- (cons (or (caar files) (1+ last))
+ (cons (or (caar nnml-files) (1+ last))
(max last
- (or (caar (last files))
+ (or (caar (last nnml-files))
0))))
nnml-group-alist)))
;; Delete the old NOV file.
(when (file-exists-p nov)
(funcall nnmail-delete-file-function nov))
- (while files
- (unless (file-directory-p (setq file (concat dir (cdar files))))
+ (dolist (file files)
+ (unless (file-directory-p (setq file (concat dir (cdr file))))
(erase-buffer)
(nnheader-insert-file-contents file)
(narrow-to-region
(max (point-min) (1- (point)))))
(unless (zerop (buffer-size))
(goto-char (point-min))
- (setq headers (nnml-parse-head chars (caar files)))
+ (setq headers (nnml-parse-head chars (car file)))
(with-current-buffer nov-buffer
(goto-char (point-max))
(nnheader-insert-nov headers)))
- (widen))
- (setq files (cdr files)))
+ (widen)))
(with-current-buffer nov-buffer
(nnmail-write-region (point-min) (point-max) nov nil 'nomesg)
(kill-buffer (current-buffer))))))
;; build list from .overview if available
;; We would use nnml-open-nov, except that nnml-nov-buffer-alist is
;; defvoo'd, and we might get called when it hasn't been swapped in.
- (save-excursion
+ (with-current-buffer (nnml-get-nov-buffer nnml-current-group)
(let ((list nil)
- art
- (buffer (nnml-get-nov-buffer nnml-current-group)))
- (set-buffer buffer)
+ art)
(goto-char (point-min))
(while (not (eobp))
(setq art (read (current-buffer)))
nnml-current-directory))))
(nnheader-article-to-file-alist nnml-current-directory)
;; build list from .overview if available
- (save-excursion
+ (with-current-buffer (nnml-get-nov-buffer nnml-current-group)
(let ((alist nil)
- (buffer (nnml-get-nov-buffer nnml-current-group))
art)
- (set-buffer buffer)
(goto-char (point-min))
(while (not (eobp))
(setq art (read (current-buffer)))