(mail-yank-region): Fix comment.
[bpt/emacs.git] / lisp / mail / pmailmsc.el
CommitLineData
e131541f
PR
1;;; pmailmsc.el --- miscellaneous support functions for the PMAIL mail reader
2
3;; Copyright (C) 1985, 2002, 2003, 2004, 2005,
4;; 2006, 2007, 2008 Free Software Foundation, Inc.
5
6;; Maintainer: FSF
7;; Keywords: mail
8
9;; This file is part of GNU Emacs.
10
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 3 of the License, or
14;; (at your option) any later version.
15
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.
20
21;; You should have received a copy of the GNU General Public License
22;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
23
24;;; Commentary:
25
26;;; Code:
27
28(eval-when-compile
29 (require 'pmail))
30
31(defvar pmail-current-message)
32(defvar pmail-inbox-list)
33
acdc2006 34(declare-function mail-parse-comma-list "mail-utils" ())
e131541f
PR
35(declare-function pmail-parse-file-inboxes "pmail" ())
36(declare-function pmail-show-message "pmail" (&optional n no-summary))
37
38;;;###autoload
39(defun set-pmail-inbox-list (file-name)
40 "Set the inbox list of the current PMAIL file to FILE-NAME.
41You can specify one file name, or several names separated by commas.
42If FILE-NAME is empty, remove any existing inbox list."
43 (interactive "sSet mailbox list to (comma-separated list of filenames): ")
44 (unless (eq major-mode 'pmail-mode)
45 (error "set-pmail-inbox-list works only for an Pmail file"))
46 (let ((inbox-list
47 (with-temp-buffer
48 (insert file-name)
49 (goto-char (point-min))
50 (nreverse (mail-parse-comma-list)))))
51 (when (or (not pmail-inbox-list)
52 (y-or-n-p (concat "Replace "
53 (mapconcat 'identity
54 pmail-inbox-list
55 ", ")
56 "? ")))
57 (message "Setting the inbox list for %s for this session"
58 (file-name-nondirectory (buffer-file-name)))
59 (setq pmail-inbox-list inbox-list)))
60 (pmail-show-message pmail-current-message))
61
0faeefbb 62;; arch-tag: 94614a62-2a0a-4e25-bac9-06f461ed4c60
e131541f 63;;; pmailmsc.el ends here