X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fnnfolder.el;h=0cfa0f2b2fc0c7f614b6092d99761879e5ecfabf;hb=4cacb5f23eb830e6950dba987063f413977708d7;hp=cad461af1bf0202addd42299cd173001948f43f5;hpb=ac78c4d5143ba0ed346e8bc5fcd189cb519175e1;p=elisp%2Fgnus.git- diff --git a/lisp/nnfolder.el b/lisp/nnfolder.el index cad461a..0cfa0f2 100644 --- a/lisp/nnfolder.el +++ b/lisp/nnfolder.el @@ -1,6 +1,7 @@ ;;; nnfolder.el --- mail folder access for Gnus -;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -;; Free Software Foundation, Inc. + +;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +;; 2005 Free Software Foundation, Inc. ;; Author: Simon Josefsson (adding MARKS) ;; ShengHuo Zhu (adding NOV) @@ -23,8 +24,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -201,7 +202,7 @@ the group. Then the marks file will be regenerated properly by Gnus.") ((search-backward (concat "\n" nnfolder-article-marker) nil t) (goto-char (match-end 0)) - (setq num (string-to-int + (setq num (string-to-number (buffer-substring (point) (point-at-eol)))) (goto-char start) @@ -211,7 +212,7 @@ the group. Then the marks file will be regenerated properly by Gnus.") (search-forward (concat "\n" nnfolder-article-marker) nil t) (progn - (setq num (string-to-int + (setq num (string-to-number (buffer-substring (point) (point-at-eol)))) (> num article)) @@ -286,7 +287,7 @@ the group. Then the marks file will be regenerated properly by Gnus.") (cons nnfolder-current-group (if (search-forward (concat "\n" nnfolder-article-marker) nil t) - (string-to-int (buffer-substring + (string-to-number (buffer-substring (point) (point-at-eol))) -1)))))))) @@ -371,10 +372,11 @@ the group. Then the marks file will be regenerated properly by Gnus.") (deffoo nnfolder-request-create-group (group &optional server args) (nnfolder-possibly-change-group nil server) (nnmail-activate 'nnfolder) - (when group - (unless (assoc group nnfolder-group-alist) - (push (list group (cons 1 0)) nnfolder-group-alist) - (nnfolder-save-active nnfolder-group-alist nnfolder-active-file) + (when (and group + (not (assoc group nnfolder-group-alist))) + (push (list group (cons 1 0)) nnfolder-group-alist) + (nnfolder-save-active nnfolder-group-alist nnfolder-active-file) + (save-current-buffer (nnfolder-read-folder group))) t) @@ -467,8 +469,8 @@ the group. Then the marks file will be regenerated properly by Gnus.") (nnfolder-save-active nnfolder-group-alist nnfolder-active-file) (gnus-sorted-difference articles (nreverse deleted-articles))))) -(deffoo nnfolder-request-move-article (article group server - accept-form &optional last) +(deffoo nnfolder-request-move-article (article group server accept-form + &optional last move-is-internal) (save-excursion (let ((buf (get-buffer-create " *nnfolder move*")) result) @@ -873,8 +875,9 @@ deleted. Point is left where the deleted region was." (buffer (set-buffer (let ((nnheader-file-coding-system nnfolder-file-coding-system)) - (nnheader-find-file-noselect file))))) + (nnheader-find-file-noselect file t))))) (set-buffer-multibyte t) ;; Use multibyte buffer for future copying. + (buffer-disable-undo) (if (equal (cadr (assoc group nnfolder-scantime-alist)) (nth 5 (file-attributes file))) ;; This looks up-to-date, so we don't do any scanning. @@ -901,7 +904,6 @@ deleted. Point is left where the deleted region was." maxid start end newscantime novbuf articles newnum buffer-read-only) - (buffer-disable-undo) (setq maxid (cdr active)) (unless (or gnus-nov-is-evil nnfolder-nov-is-evil @@ -1028,9 +1030,7 @@ This command does not work if you use short group names." (when (not (message-mail-file-mbox-p file)) (ignore-errors (delete-file file))))) - (let ((files (directory-files nnfolder-directory)) - file) - (while (setq file (pop files)) + (dolist (file (directory-files nnfolder-directory)) (when (and (not (backup-file-name-p file)) (message-mail-file-mbox-p (nnheader-concat nnfolder-directory file))) @@ -1045,7 +1045,7 @@ This command does not work if you use short group names." (nnfolder-possibly-change-folder file) (nnfolder-possibly-change-group file) (nnfolder-close-group file)))) - (nnheader-message 5 ""))) + (nnheader-message 5 "")) (defun nnfolder-group-pathname (group) "Make file name for GROUP." @@ -1072,7 +1072,8 @@ This command does not work if you use short group names." (gnus-make-directory (file-name-directory (buffer-file-name))) (let ((coding-system-for-write (or nnfolder-file-coding-system-for-write - nnfolder-file-coding-system))) + nnfolder-file-coding-system)) + (copyright-update nil)) (save-buffer))) (unless (or gnus-nov-is-evil nnfolder-nov-is-evil) (nnfolder-save-nov)))