Commit | Line | Data |
---|---|---|
537ab246 BG |
1 | ;;; rmailmsc.el --- miscellaneous support functions for the RMAIL mail reader |
2 | ||
4474b24a | 3 | ;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, |
114f9c96 | 4 | ;; 2009, 2010 Free Software Foundation, Inc. |
537ab246 BG |
5 | |
6 | ;; Maintainer: FSF | |
7 | ;; Keywords: mail | |
bd78fa1d | 8 | ;; Package: rmail |
537ab246 BG |
9 | |
10 | ;; This file is part of GNU Emacs. | |
11 | ||
12 | ;; GNU Emacs is free software: you can redistribute it and/or modify | |
13 | ;; it under the terms of the GNU General Public License as published by | |
14 | ;; the Free Software Foundation, either version 3 of the License, or | |
15 | ;; (at your option) any later version. | |
16 | ||
17 | ;; GNU Emacs is distributed in the hope that it will be useful, | |
18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 | ;; GNU General Public License for more details. | |
21 | ||
22 | ;; You should have received a copy of the GNU General Public License | |
23 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | |
24 | ||
25 | ;;; Commentary: | |
26 | ||
27 | ;;; Code: | |
28 | ||
7b094a30 | 29 | (require 'rmail) |
537ab246 BG |
30 | |
31 | ;;;###autoload | |
32 | (defun set-rmail-inbox-list (file-name) | |
33 | "Set the inbox list of the current RMAIL file to FILE-NAME. | |
34 | You can specify one file name, or several names separated by commas. | |
57d2296a RS |
35 | If FILE-NAME is empty, remove any existing inbox list. |
36 | ||
37 | This applies only to the current session." | |
537ab246 BG |
38 | (interactive "sSet mailbox list to (comma-separated list of filenames): ") |
39 | (unless (eq major-mode 'rmail-mode) | |
40 | (error "set-rmail-inbox-list works only for an Rmail file")) | |
41 | (let ((inbox-list | |
42 | (with-temp-buffer | |
43 | (insert file-name) | |
44 | (goto-char (point-min)) | |
35426db4 | 45 | ;; split-string does not remove leading/trailing whitespace. |
537ab246 BG |
46 | (nreverse (mail-parse-comma-list))))) |
47 | (when (or (not rmail-inbox-list) | |
48 | (y-or-n-p (concat "Replace " | |
49 | (mapconcat 'identity | |
50 | rmail-inbox-list | |
51 | ", ") | |
52 | "? "))) | |
53 | (message "Setting the inbox list for %s for this session" | |
54 | (file-name-nondirectory (buffer-file-name))) | |
55 | (setq rmail-inbox-list inbox-list))) | |
a1a29341 | 56 | (rmail-show-message-1 rmail-current-message)) |
537ab246 | 57 | |
35426db4 GM |
58 | ;; Local Variables: |
59 | ;; generated-autoload-file: "rmail.el" | |
60 | ;; End: | |
61 | ||
537ab246 BG |
62 | ;; arch-tag: 94614a62-2a0a-4e25-bac9-06f461ed4c60 |
63 | ;;; rmailmsc.el ends here |