/[emacs]/emacs/lisp/gnus/nnfolder.el
ViewVC logotype

Diff of /emacs/lisp/gnus/nnfolder.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by monnier, Fri Apr 12 03:11:40 2002 UTC revision 1.11.2.1 by miles, Fri Apr 4 06:20:21 2003 UTC
# Line 34  Line 34 
34  (require 'nnoo)  (require 'nnoo)
35  (eval-when-compile (require 'cl))  (eval-when-compile (require 'cl))
36  (require 'gnus-util)  (require 'gnus-util)
37    (require 'gnus-range)
38    
39  (nnoo-declare nnfolder)  (nnoo-declare nnfolder)
40    
# Line 94  message, a huge time saver for large mai Line 95  message, a huge time saver for large mai
95  (defvoo nnfolder-scantime-alist nil)  (defvoo nnfolder-scantime-alist nil)
96  (defvoo nnfolder-active-timestamp nil)  (defvoo nnfolder-active-timestamp nil)
97  (defvoo nnfolder-active-file-coding-system mm-text-coding-system)  (defvoo nnfolder-active-file-coding-system mm-text-coding-system)
98  (defvoo nnfolder-active-file-coding-system-for-write  (defvoo nnfolder-active-file-coding-system-for-write
99      nnmail-active-file-coding-system)      nnmail-active-file-coding-system)
100  (defvoo nnfolder-file-coding-system mm-text-coding-system)  (defvoo nnfolder-file-coding-system mm-text-coding-system)
101  (defvoo nnfolder-file-coding-system-for-write nnheader-file-coding-system  (defvoo nnfolder-file-coding-system-for-write nnheader-file-coding-system
# Line 188  If nil, `nnfolder-file-coding-system' is Line 189  If nil, `nnfolder-file-coding-system' is
189                (cons nnfolder-current-group article)                (cons nnfolder-current-group article)
190              (goto-char (point-min))              (goto-char (point-min))
191              (cons nnfolder-current-group              (cons nnfolder-current-group
192                    (if (search-forward (concat "\n" nnfolder-article-marker)                    (if (search-forward (concat "\n" nnfolder-article-marker)
193                                        nil t)                                        nil t)
194                        (string-to-int                        (string-to-int
195                         (buffer-substring                         (buffer-substring
# Line 312  If nil, `nnfolder-file-coding-system' is Line 313  If nil, `nnfolder-file-coding-system' is
313        (let ((marker (concat "\n" nnfolder-article-marker))        (let ((marker (concat "\n" nnfolder-article-marker))
314              (number "[0-9]+")              (number "[0-9]+")
315              numbers)              numbers)
316          
317          (while (and (search-forward marker nil t)          (while (and (search-forward marker nil t)
318                      (re-search-forward number nil t))                      (re-search-forward number nil t))
319            (let ((newnum (string-to-number (match-string 0))))            (let ((newnum (string-to-number (match-string 0))))
# Line 349  If nil, `nnfolder-file-coding-system' is Line 350  If nil, `nnfolder-file-coding-system' is
350                         (buffer-substring                         (buffer-substring
351                          (point) (progn (end-of-line) (point)))                          (point) (progn (end-of-line) (point)))
352                         force nnfolder-inhibit-expiry))                         force nnfolder-inhibit-expiry))
353              (nnheader-message 5 "Deleting article %d..."              (unless (eq nnmail-expiry-target 'delete)
354                  (with-temp-buffer
355                    (nnfolder-request-article (car maybe-expirable)
356                                              newsgroup server (current-buffer))
357                    (let ((nnml-current-directory nil))
358                      (nnmail-expiry-target-group
359                       nnmail-expiry-target newsgroup))))
360                (nnheader-message 5 "Deleting article %d in %s..."
361                                (car maybe-expirable) newsgroup)                                (car maybe-expirable) newsgroup)
362              (nnfolder-delete-mail)              (nnfolder-delete-mail)
363              ;; Must remember which articles were actually deleted              ;; Must remember which articles were actually deleted
# Line 376  If nil, `nnfolder-file-coding-system' is Line 384  If nil, `nnfolder-file-coding-system' is
384           (goto-char (point-min))           (goto-char (point-min))
385           (while (re-search-forward           (while (re-search-forward
386                   (concat "^" nnfolder-article-marker)                   (concat "^" nnfolder-article-marker)
387                   (save-excursion (and (search-forward "\n\n" nil t) (point)))                   (save-excursion (and (search-forward "\n\n" nil t) (point)))
388                   t)                   t)
389             (delete-region (progn (beginning-of-line) (point))             (delete-region (progn (beginning-of-line) (point))
390                            (progn (forward-line 1) (point))))                            (progn (forward-line 1) (point))))
# Line 403  If nil, `nnfolder-file-coding-system' is Line 411  If nil, `nnfolder-file-coding-system' is
411            result art-group)            result art-group)
412        (goto-char (point-min))        (goto-char (point-min))
413        (when (looking-at "X-From-Line: ")        (when (looking-at "X-From-Line: ")
414          (replace-match "From "))          (replace-match "From ")
415            (while (progn (forward-line) (looking-at "[ \t]"))
416              (delete-char -1)))
417        (and        (and
418         (nnfolder-request-list)         (nnfolder-request-list)
419         (save-excursion         (save-excursion
# Line 621  deleted.  Point is left where the delete Line 631  deleted.  Point is left where the delete
631                ;; See whether we need to create the new file.                ;; See whether we need to create the new file.
632                (unless (file-exists-p file)                (unless (file-exists-p file)
633                  (gnus-make-directory (file-name-directory file))                  (gnus-make-directory (file-name-directory file))
634                  (let ((nnmail-file-coding-system                  (let ((nnmail-file-coding-system
635                         (or nnfolder-file-coding-system-for-write                         (or nnfolder-file-coding-system-for-write
636                             nnfolder-file-coding-system-for-write)))                             nnfolder-file-coding-system-for-write)))
637                    (nnmail-write-region (point-min) (point-min)                    (nnmail-write-region (point-min) (point-min)
# Line 738  deleted.  Point is left where the delete Line 748  deleted.  Point is left where the delete
748  (defun nnfolder-read-folder (group)  (defun nnfolder-read-folder (group)
749    (let* ((file (nnfolder-group-pathname group))    (let* ((file (nnfolder-group-pathname group))
750           (buffer (set-buffer           (buffer (set-buffer
751                    (let ((nnheader-file-coding-system                    (let ((nnheader-file-coding-system
752                           nnfolder-file-coding-system))                           nnfolder-file-coding-system))
753                      (nnheader-find-file-noselect file)))))                      (nnheader-find-file-noselect file)))))
754      (mm-enable-multibyte) ;; Use multibyte buffer for future copying.      (mm-enable-multibyte) ;; Use multibyte buffer for future copying.
# Line 862  This command does not work if you use sh Line 872  This command does not work if you use sh
872      (nnheader-message 5 "")))      (nnheader-message 5 "")))
873    
874  (defun nnfolder-group-pathname (group)  (defun nnfolder-group-pathname (group)
875    "Make pathname for GROUP."    "Make file name for GROUP."
876    (setq group    (setq group
877          (mm-encode-coding-string group nnmail-pathname-coding-system))          (mm-encode-coding-string group nnmail-pathname-coding-system))
878    (let ((dir (file-name-as-directory (expand-file-name nnfolder-directory))))    (let ((dir (file-name-as-directory (expand-file-name nnfolder-directory))))
# Line 878  This command does not work if you use sh Line 888  This command does not work if you use sh
888    (when (buffer-modified-p)    (when (buffer-modified-p)
889      (run-hooks 'nnfolder-save-buffer-hook)      (run-hooks 'nnfolder-save-buffer-hook)
890      (gnus-make-directory (file-name-directory (buffer-file-name)))      (gnus-make-directory (file-name-directory (buffer-file-name)))
891      (let ((coding-system-for-write      (let ((coding-system-for-write
892             (or nnfolder-file-coding-system-for-write             (or nnfolder-file-coding-system-for-write
893                 nnfolder-file-coding-system)))                 nnfolder-file-coding-system)))
894        (save-buffer))))        (save-buffer))))

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.11.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26