1 ;;; nnfolder.el --- mail folder access for Gnus
2 ;; Copyright (C) 1995,96 Free Software Foundation, Inc.
4 ;; Author: Scott Byer <byer@mv.us.adobe.com>
5 ;; Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
6 ;; Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
9 ;; This file is part of GNU Emacs.
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
16 ;; GNU Emacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
28 ;; For an overview of what the interface functions do, please see the
31 ;; Various enhancements by byer@mv.us.adobe.com (Scott Byer).
39 (eval-when-compile (require 'cl))
41 (nnoo-declare nnfolder)
43 (defvoo nnfolder-directory (expand-file-name message-directory)
44 "The name of the nnfolder directory.")
46 (defvoo nnfolder-active-file
47 (nnheader-concat nnfolder-directory "active")
48 "The name of the active file.")
50 ;; I renamed this variable to something more in keeping with the general GNU
53 (defvoo nnfolder-ignore-active-file nil
54 "If non-nil, causes nnfolder to do some extra work in order to determine the true active ranges of an mbox file.
55 Note that the active file is still saved, but it's values are not
56 used. This costs some extra time when scanning an mbox when opening
59 (defvoo nnfolder-newsgroups-file
60 (concat (file-name-as-directory nnfolder-directory) "newsgroups")
61 "Mail newsgroups description file.")
63 (defvoo nnfolder-get-new-mail t
64 "If non-nil, nnfolder will check the incoming mail file and split the mail.")
66 (defvoo nnfolder-prepare-save-mail-hook nil
67 "Hook run narrowed to an article before saving.")
69 (defvoo nnfolder-save-buffer-hook nil
70 "Hook run before saving the nnfolder mbox buffer.")
72 (defvoo nnfolder-inhibit-expiry nil
73 "If non-nil, inhibit expiry.")
77 (defconst nnfolder-version "nnfolder 1.0"
80 (defconst nnfolder-article-marker "X-Gnus-Article-Number: "
81 "String used to demarcate what the article number for a message is.")
83 (defvoo nnfolder-current-group nil)
84 (defvoo nnfolder-current-buffer nil)
85 (defvoo nnfolder-status-string "")
86 (defvoo nnfolder-group-alist nil)
87 (defvoo nnfolder-buffer-alist nil)
88 (defvoo nnfolder-active-timestamp nil)
92 ;;; Interface functions
94 (nnoo-define-basics nnfolder)
96 (deffoo nnfolder-retrieve-headers (articles &optional group server fetch-old)
98 (set-buffer nntp-server-buffer)
100 (let ((delim-string (concat "^" message-unix-mail-delimiter))
101 article art-string start stop)
102 (nnfolder-possibly-change-group group server)
103 (set-buffer nnfolder-current-buffer)
104 (goto-char (point-min))
105 (if (stringp (car articles))
108 (setq article (car articles))
109 (setq art-string (nnfolder-article-string article))
110 (set-buffer nnfolder-current-buffer)
111 (if (or (search-forward art-string nil t)
112 ;; Don't search the whole file twice! Also, articles
113 ;; probably have some locality by number, so searching
114 ;; backwards will be faster. Especially if we're at the
115 ;; beginning of the buffer :-). -SLB
116 (search-backward art-string nil t))
118 (setq start (or (re-search-backward delim-string nil t)
120 (search-forward "\n\n" nil t)
121 (setq stop (1- (point)))
122 (set-buffer nntp-server-buffer)
123 (insert (format "221 %d Article retrieved.\n" article))
124 (insert-buffer-substring nnfolder-current-buffer start stop)
125 (goto-char (point-max))
127 (setq articles (cdr articles)))
129 (set-buffer nntp-server-buffer)
130 (nnheader-fold-continuation-lines)
133 (deffoo nnfolder-open-server (server &optional defs)
134 (nnoo-change-server 'nnfolder server defs)
135 (when (not (file-exists-p nnfolder-directory))
137 (make-directory nnfolder-directory t)
140 ((not (file-exists-p nnfolder-directory))
141 (nnfolder-close-server)
142 (nnheader-report 'nnfolder "Couldn't create directory: %s"
144 ((not (file-directory-p (file-truename nnfolder-directory)))
145 (nnfolder-close-server)
146 (nnheader-report 'nnfolder "Not a directory: %s" nnfolder-directory))
148 (nnheader-report 'nnfolder "Opened server %s using directory %s"
149 server nnfolder-directory)
152 (deffoo nnfolder-request-close ()
153 (let ((alist nnfolder-buffer-alist))
155 (nnfolder-close-group (caar alist) nil t)
156 (setq alist (cdr alist))))
157 (nnoo-close-server 'nnfolder)
158 (setq nnfolder-buffer-alist nil
159 nnfolder-group-alist nil))
161 (deffoo nnfolder-request-article (article &optional group server buffer)
162 (nnfolder-possibly-change-group group server)
164 (set-buffer nnfolder-current-buffer)
165 (goto-char (point-min))
166 (if (search-forward (nnfolder-article-string article) nil t)
168 (re-search-backward (concat "^" message-unix-mail-delimiter) nil t)
171 (or (and (re-search-forward
172 (concat "^" message-unix-mail-delimiter) nil t)
174 (goto-char (point-max)))
176 (let ((nntp-server-buffer (or buffer nntp-server-buffer)))
177 (set-buffer nntp-server-buffer)
179 (insert-buffer-substring nnfolder-current-buffer start stop)
180 (goto-char (point-min))
181 (while (looking-at "From ")
183 (insert "X-From-Line: ")
185 (if (numberp article)
186 (cons nnfolder-current-group article)
187 (goto-char (point-min))
188 (search-forward (concat "\n" nnfolder-article-marker))
189 (cons nnfolder-current-group
192 (point) (progn (end-of-line) (point)))))))))))
194 (deffoo nnfolder-request-group (group &optional server dont-check)
196 (nnmail-activate 'nnfolder)
197 (if (not (assoc group nnfolder-group-alist))
198 (nnheader-report 'nnfolder "No such group: %s" group)
199 (nnfolder-possibly-change-group group server)
202 (nnheader-report 'nnfolder "Selected group %s" group)
204 (let* ((active (assoc group nnfolder-group-alist))
206 (range (cadr active)))
209 (nnheader-report 'nnfolder "No such group: %s" group))
211 (nnheader-report 'nnfolder "Selected group %s" group)
212 (nnheader-insert "211 %d %d %d %s\n"
213 (1+ (- (cdr range) (car range)))
214 (car range) (cdr range) group))))))))
216 (deffoo nnfolder-request-scan (&optional group server)
217 (nnfolder-possibly-change-group group server)
221 (let ((bufs nnfolder-buffer-alist))
224 (if (not (buffer-name (nth 1 (car bufs))))
225 (setq nnfolder-buffer-alist
226 (delq (car bufs) nnfolder-buffer-alist))
227 (set-buffer (nth 1 (car bufs)))
228 (nnfolder-save-buffer)
229 (kill-buffer (current-buffer)))
230 (setq bufs (cdr bufs))))))
234 ;; Don't close the buffer if we're not shutting down the server. This way,
235 ;; we can keep the buffer in the group buffer cache, and not have to grovel
236 ;; over the buffer again unless we add new mail to it or modify it in some
239 (deffoo nnfolder-close-group (group &optional server force)
240 ;; Make sure we _had_ the group open.
241 (when (or (assoc group nnfolder-buffer-alist)
242 (equal group nnfolder-current-group))
243 (let ((inf (assoc group nnfolder-buffer-alist)))
245 (when nnfolder-current-group
246 (push (list nnfolder-current-group nnfolder-current-buffer)
247 nnfolder-buffer-alist))
248 (setq nnfolder-buffer-alist
249 (delq inf nnfolder-buffer-alist))
250 (setq nnfolder-current-buffer (cadr inf)
251 nnfolder-current-group (car inf))))
252 (when (and nnfolder-current-buffer
253 (buffer-name nnfolder-current-buffer))
255 (set-buffer nnfolder-current-buffer)
256 ;; If the buffer was modified, write the file out now.
257 (nnfolder-save-buffer)
258 ;; If we're shutting the server down, we need to kill the
259 ;; buffer and remove it from the open buffer list. Or, of
260 ;; course, if we're trying to minimize our space impact.
261 (kill-buffer (current-buffer))
262 (setq nnfolder-buffer-alist (delq (assoc group nnfolder-buffer-alist)
263 nnfolder-buffer-alist)))))
264 (setq nnfolder-current-group nil
265 nnfolder-current-buffer nil)
268 (deffoo nnfolder-request-create-group (group &optional server)
269 (nnfolder-possibly-change-group nil server)
270 (nnmail-activate 'nnfolder)
272 (unless (assoc group nnfolder-group-alist)
273 (push (list group (cons 1 0)) nnfolder-group-alist)
274 (nnmail-save-active nnfolder-group-alist nnfolder-active-file)))
277 (deffoo nnfolder-request-list (&optional server)
278 (nnfolder-possibly-change-group nil server)
280 (nnmail-find-file nnfolder-active-file)
281 (setq nnfolder-group-alist (nnmail-get-active))))
283 (deffoo nnfolder-request-newgroups (date &optional server)
284 (nnfolder-possibly-change-group nil server)
285 (nnfolder-request-list server))
287 (deffoo nnfolder-request-list-newsgroups (&optional server)
288 (nnfolder-possibly-change-group nil server)
290 (nnmail-find-file nnfolder-newsgroups-file)))
292 (deffoo nnfolder-request-expire-articles
293 (articles newsgroup &optional server force)
294 (nnfolder-possibly-change-group newsgroup server)
297 (nnmail-activate 'nnfolder)
300 (set-buffer nnfolder-current-buffer)
301 (while (and articles is-old)
302 (goto-char (point-min))
303 (if (search-forward (nnfolder-article-string (car articles)) nil t)
305 (nnmail-expired-article-p
308 (point) (progn (end-of-line) (point)))
309 force nnfolder-inhibit-expiry))
311 (nnheader-message 5 "Deleting article %d..."
312 (car articles) newsgroup)
313 (nnfolder-delete-mail))
314 (setq rest (cons (car articles) rest))))
315 (setq articles (cdr articles)))
316 (nnfolder-save-buffer)
317 ;; Find the lowest active article in this group.
318 (let* ((active (cadr (assoc newsgroup nnfolder-group-alist)))
319 (marker (concat "\n" nnfolder-article-marker))
321 (activemin (cdr active)))
322 (goto-char (point-min))
323 (while (and (search-forward marker nil t)
324 (re-search-forward number nil t))
325 (setq activemin (min activemin
326 (string-to-number (buffer-substring
329 (setcar active activemin))
330 (nnmail-save-active nnfolder-group-alist nnfolder-active-file)
331 (nconc rest articles))))
333 (deffoo nnfolder-request-move-article
334 (article group server accept-form &optional last)
335 (nnfolder-possibly-change-group group server)
336 (let ((buf (get-buffer-create " *nnfolder move*"))
339 (nnfolder-request-article article group server)
342 (buffer-disable-undo (current-buffer))
344 (insert-buffer-substring nntp-server-buffer)
345 (goto-char (point-min))
346 (while (re-search-forward
347 (concat "^" nnfolder-article-marker)
348 (save-excursion (search-forward "\n\n" nil t) (point)) t)
349 (delete-region (progn (beginning-of-line) (point))
350 (progn (forward-line 1) (point))))
351 (setq result (eval accept-form))
355 (nnfolder-possibly-change-group group server)
356 (set-buffer nnfolder-current-buffer)
357 (goto-char (point-min))
358 (if (search-forward (nnfolder-article-string article) nil t)
359 (nnfolder-delete-mail))
360 (and last (nnfolder-save-buffer))))
363 (deffoo nnfolder-request-accept-article (group &optional server last)
364 (nnfolder-possibly-change-group group server)
365 (and (stringp group) (nnfolder-possibly-change-group group))
366 (let ((buf (current-buffer))
368 (goto-char (point-min))
369 (when (looking-at "X-From-Line: ")
370 (replace-match "From "))
372 (nnfolder-request-list)
375 (goto-char (point-min))
376 (search-forward "\n\n" nil t)
378 (while (re-search-backward (concat "^" nnfolder-article-marker) nil t)
379 (delete-region (point) (progn (forward-line 1) (point))))
380 (setq result (car (nnfolder-save-mail (and (stringp group) group)))))
382 (set-buffer nnfolder-current-buffer)
383 (and last (nnfolder-save-buffer))))
384 (nnmail-save-active nnfolder-group-alist nnfolder-active-file)
386 (nnheader-report 'nnfolder "Couldn't store article"))
389 (deffoo nnfolder-request-replace-article (article group buffer)
390 (nnfolder-possibly-change-group group)
392 (set-buffer nnfolder-current-buffer)
393 (goto-char (point-min))
394 (if (not (search-forward (nnfolder-article-string article) nil t))
396 (nnfolder-delete-mail t t)
397 (insert-buffer-substring buffer)
398 (nnfolder-save-buffer)
401 (deffoo nnfolder-request-delete-group (group &optional force server)
402 (nnfolder-close-group group server t)
403 ;; Delete all articles in GROUP.
405 () ; Don't delete the articles.
406 ;; Delete the file that holds the group.
408 (delete-file (nnfolder-group-pathname group))
410 ;; Remove the group from all structures.
411 (setq nnfolder-group-alist
412 (delq (assoc group nnfolder-group-alist) nnfolder-group-alist)
413 nnfolder-current-group nil
414 nnfolder-current-buffer nil)
415 ;; Save the active file.
416 (nnmail-save-active nnfolder-group-alist nnfolder-active-file)
419 (deffoo nnfolder-request-rename-group (group new-name &optional server)
420 (nnfolder-possibly-change-group group server)
422 (set-buffer nnfolder-current-buffer)
423 (and (file-writable-p buffer-file-name)
428 (nnfolder-group-pathname new-name))
431 ;; That went ok, so we change the internal structures.
432 (let ((entry (assoc group nnfolder-group-alist)))
433 (and entry (setcar entry new-name))
434 (setq nnfolder-current-buffer nil
435 nnfolder-current-group nil)
436 ;; Save the new group alist.
437 (nnmail-save-active nnfolder-group-alist nnfolder-active-file)
438 ;; We kill the buffer instead of renaming it and stuff.
439 (kill-buffer (current-buffer))
443 ;;; Internal functions.
445 (defun nnfolder-article-string (article)
446 (if (numberp article)
447 (concat "\n" nnfolder-article-marker (int-to-string article) " ")
448 (concat "\nMessage-ID: " article)))
450 (defun nnfolder-delete-mail (&optional force leave-delim)
451 "Delete the message that point is in."
455 (re-search-backward (concat "^" message-unix-mail-delimiter) nil t)
456 (if leave-delim (progn (forward-line 1) (point))
457 (match-beginning 0)))
460 (if (re-search-forward (concat "^" message-unix-mail-delimiter) nil t)
461 (if (and (not (bobp)) leave-delim)
462 (progn (forward-line -2) (point))
466 (defun nnfolder-possibly-change-group (group &optional server)
468 (not (nnfolder-server-opened server)))
469 (nnfolder-open-server server))
471 (unless (file-exists-p nnfolder-directory)
472 (make-directory (directory-file-name nnfolder-directory) t))
473 (nnfolder-possibly-activate-groups nil)
474 (or (assoc group nnfolder-group-alist)
476 (nnfolder-group-pathname group)))
478 (setq nnfolder-group-alist
479 (cons (list group (cons 1 0)) nnfolder-group-alist))
480 (nnmail-save-active nnfolder-group-alist nnfolder-active-file)))
482 (if (and (equal group nnfolder-current-group)
483 nnfolder-current-buffer
484 (buffer-name nnfolder-current-buffer))
486 (setq nnfolder-current-group group)
488 ;; If we have to change groups, see if we don't already have the mbox
489 ;; in memory. If we do, verify the modtime and destroy the mbox if
490 ;; needed so we can rescan it.
491 (if (setq inf (assoc group nnfolder-buffer-alist))
492 (setq nnfolder-current-buffer (nth 1 inf)))
494 ;; If the buffer is not live, make sure it isn't in the alist. If it
495 ;; is live, verify that nobody else has touched the file since last
497 (if (or (not (and nnfolder-current-buffer
498 (buffer-name nnfolder-current-buffer)))
499 (not (and (bufferp nnfolder-current-buffer)
500 (verify-visited-file-modtime
501 nnfolder-current-buffer))))
503 (if (and nnfolder-current-buffer
504 (buffer-name nnfolder-current-buffer)
505 (bufferp nnfolder-current-buffer))
506 (kill-buffer nnfolder-current-buffer))
507 (setq nnfolder-buffer-alist (delq inf nnfolder-buffer-alist))
513 (setq file (nnfolder-group-pathname group))
514 (if (file-directory-p (file-truename file))
516 (unless (file-exists-p file)
517 (unless (file-exists-p (file-name-directory file))
518 (make-directory (file-name-directory file) t))
519 (write-region 1 1 file t 'nomesg))
520 (setq nnfolder-current-buffer
521 (set-buffer (nnfolder-read-folder file)))
522 (setq nnfolder-buffer-alist (cons (list group (current-buffer))
523 nnfolder-buffer-alist)))))))
524 (setq nnfolder-current-group group)))
526 (defun nnfolder-save-mail (&optional group)
527 "Called narrowed to an article."
528 (let* ((nnmail-split-methods
529 (if group (list (list group "")) nnmail-split-methods))
531 (nreverse (nnmail-article-group 'nnfolder-active-number)))
532 (delim (concat "^" message-unix-mail-delimiter))
534 (goto-char (point-min))
535 ;; This might come from somewhere else.
536 (unless (looking-at delim)
537 (insert "From nobody " (current-time-string) "\n")
538 (goto-char (point-min)))
539 ;; Quote all "From " lines in the article.
541 (while (re-search-forward delim nil t)
544 (setq save-list group-art-list)
545 (nnmail-insert-lines)
546 (nnmail-insert-xref group-art-list)
547 (run-hooks 'nnmail-prepare-save-mail-hook)
548 (run-hooks 'nnfolder-prepare-save-mail-hook)
550 ;; Insert the mail into each of the destination groups.
551 (while group-art-list
552 (setq group-art (car group-art-list)
553 group-art-list (cdr group-art-list))
555 ;; Kill the previous newsgroup markers.
556 (goto-char (point-min))
557 (search-forward "\n\n" nil t)
559 (while (search-backward (concat "\n" nnfolder-article-marker) nil t)
560 (delete-region (1+ (point)) (progn (forward-line 2) (point))))
562 (nnfolder-possibly-change-group (car group-art))
563 ;; Insert the new newsgroup marker.
564 (nnfolder-insert-newsgroup-line group-art)
565 (unless nnfolder-current-buffer
566 (nnfolder-request-create-group (car group-art))
567 (nnfolder-possibly-change-group (car group-art)))
568 (let ((beg (point-min))
570 (obuf (current-buffer)))
571 (set-buffer nnfolder-current-buffer)
572 (goto-char (point-max))
576 (insert-buffer-substring obuf beg end)
579 ;; Did we save it anywhere?
582 (defun nnfolder-insert-newsgroup-line (group-art)
584 (goto-char (point-min))
585 (if (search-forward "\n\n" nil t)
588 (insert (format (concat nnfolder-article-marker "%d %s\n")
589 (cdr group-art) (current-time-string)))))))
591 (defun nnfolder-possibly-activate-groups (&optional group)
593 ;; If we're looking for the activation of a specific group, find out
594 ;; its real name and switch to it.
595 (if group (nnfolder-possibly-change-group group))
596 ;; If the group alist isn't active, activate it now.
597 (nnmail-activate 'nnfolder)))
599 (defun nnfolder-active-number (group)
602 ;; Find the next article number in GROUP.
604 (let ((active (cadr (assoc group nnfolder-group-alist))))
606 (setcdr active (1+ (cdr active)))
607 ;; This group is new, so we create a new entry for it.
608 ;; This might be a bit naughty... creating groups on the drop of
609 ;; a hat, but I don't know...
610 (setq nnfolder-group-alist
611 (cons (list group (setq active (cons 1 1)))
612 nnfolder-group-alist)))
614 (nnmail-save-active nnfolder-group-alist nnfolder-active-file)
615 (nnfolder-possibly-activate-groups group)))))
618 ;; This method has a problem if you've accidentally let the active list get
619 ;; out of sync with the files. This could happen, say, if you've
620 ;; accidentally gotten new mail with something other than Gnus (but why
621 ;; would _that_ ever happen? :-). In that case, we will be in the middle of
622 ;; processing the file, ready to add new X-Gnus article number markers, and
623 ;; we'll run across a message with no ID yet - the active list _may_not_ be
626 ;; To handle this, I'm modifying this routine to maintain the maximum ID seen
627 ;; so far, and when we hit a message with no ID, we will _manually_ scan the
628 ;; rest of the message looking for any more, possibly higher IDs. We'll
629 ;; assume the maximum that we find is the highest active. Note that this
630 ;; shouldn't cost us much extra time at all, but will be a lot less
631 ;; vulnerable to glitches between the mbox and the active file.
633 (defun nnfolder-read-folder (file)
635 (nnfolder-possibly-activate-groups nil)
636 ;; We should be paranoid here and make sure the group is in the alist,
637 ;; and add it if it isn't.
638 ;;(if (not (assoc nnfoler-current-group nnfolder-group-alist)
639 (set-buffer (setq nnfolder-current-buffer
640 (nnheader-find-file-noselect file nil 'raw)))
641 (buffer-disable-undo (current-buffer))
642 (let* ((delim (concat "^" message-unix-mail-delimiter))
643 (marker (concat "\n" nnfolder-article-marker))
645 (active (cadr (assoc nnfolder-current-group
646 nnfolder-group-alist)))
647 ;; Set min to Big Number.
648 (min (max (1- (lsh 1 23)) (1- (lsh 1 24)) (1- (lsh 1 25))))
651 (goto-char (point-min))
653 ;; Anytime the active number is 1 or 0, it is suspect. In that case,
654 ;; search the file manually to find the active number. Or, of course,
655 ;; if we're being paranoid. (This would also be the place to build
656 ;; other lists from the header markers, such as expunge lists, etc., if
657 ;; we ever desired to abandon the active file entirely for mboxes.)
658 (when (or nnfolder-ignore-active-file
660 (while (and (search-forward marker nil t)
661 (re-search-forward number nil t))
662 (let ((newnum (string-to-number (match-string 0))))
663 (setq max (max max newnum))
664 (setq min (min min newnum))))
665 (setcar active (max 1 (min min max)))
666 (setcdr active (max max (cdr active)))
667 (goto-char (point-min)))
669 ;; Keep track of the active number on our own, and insert it back into
670 ;; the active list when we're done. Also, prime the pump to cut down on
671 ;; the number of searches we do.
672 (setq end (point-marker))
673 (set-marker end (or (and (re-search-forward delim nil t)
676 (while (not (= end (point-max)))
677 (setq start (marker-position end))
679 ;; There may be more than one "From " line, so we skip past
681 (while (looking-at delim)
683 (set-marker end (or (and (re-search-forward delim nil t)
687 (if (not (search-forward marker end t))
689 (narrow-to-region start end)
690 (nnmail-insert-lines)
691 (nnfolder-insert-newsgroup-line
692 (cons nil (nnfolder-active-number nnfolder-current-group)))
695 ;; Make absolutely sure that the active list reflects reality!
696 (nnmail-save-active nnfolder-group-alist nnfolder-active-file)
700 (defun nnfolder-generate-active-file ()
701 "Look for mbox folders in the nnfolder directory and make them into groups."
703 (nnmail-activate 'nnfolder)
704 (let ((files (directory-files nnfolder-directory))
706 (while (setq file (pop files))
707 (when (nnheader-mail-file-mbox-p file)
708 (nnheader-message 5 "Adding group %s..." file)
709 (push (list file (cons 1 0)) nnfolder-group-alist)
710 (nnfolder-read-folder file)
711 (nnfolder-close-group file))
714 (defun nnfolder-group-pathname (group)
715 "Make pathname for GROUP."
716 (let ((dir (file-name-as-directory (expand-file-name nnfolder-directory))))
717 ;; If this file exists, we use it directly.
718 (if (or nnmail-use-long-file-names
719 (file-exists-p (concat dir group)))
721 ;; If not, we translate dots into slashes.
722 (concat dir (nnheader-replace-chars-in-string group ?. ?/)))))
724 (defun nnfolder-save-buffer ()
726 (when (buffer-modified-p)
727 (run-hooks 'nnfolder-save-buffer-hook)
732 ;;; nnfolder.el ends here