Commit | Line | Data |
---|---|---|
c88ab9ce ER |
1 | ;;; rmailmsc.el --- miscellaneous support functions for the RMAIL mail reader |
2 | ||
f2e3589a | 3 | ;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005, |
2f043267 | 4 | ;; 2006, 2007, 2008 Free Software Foundation, Inc. |
9750e079 | 5 | |
e5167999 | 6 | ;; Maintainer: FSF |
d7b4d18f | 7 | ;; Keywords: mail |
e5167999 | 8 | |
0d20f9a0 JB |
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 | |
ceaeecb0 | 13 | ;; the Free Software Foundation; either version 3, or (at your option) |
0d20f9a0 JB |
14 | ;; 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 | |
b578f267 | 22 | ;; along with GNU Emacs; see the file COPYING. If not, write to the |
3a35cf56 LK |
23 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
24 | ;; Boston, MA 02110-1301, USA. | |
0d20f9a0 | 25 | |
55535639 PJ |
26 | ;;; Commentary: |
27 | ||
76550a57 | 28 | ;;; Code: |
0d20f9a0 | 29 | |
1b74c434 JB |
30 | (defvar rmail-current-message) |
31 | (defvar rmail-inbox-list) | |
32 | ||
2b54af74 DN |
33 | (declare-function rmail-parse-file-inboxes "rmail" ()) |
34 | (declare-function rmail-show-message "rmail" (&optional n no-summary)) | |
35 | ||
19ee6bfc | 36 | ;;;###autoload |
0d20f9a0 JB |
37 | (defun set-rmail-inbox-list (file-name) |
38 | "Set the inbox list of the current RMAIL file to FILE-NAME. | |
7e3333dd RS |
39 | You can specify one file name, or several names separated by commas. |
40 | If FILE-NAME is empty, remove any existing inbox list." | |
0d20f9a0 | 41 | (interactive "sSet mailbox list to (comma-separated list of filenames): ") |
349b1f31 RS |
42 | |
43 | (unless (eq major-mode 'rmail-mode) | |
44 | (error "set-rmail-inbox-list works only for an Rmail file")) | |
45 | ||
0d20f9a0 JB |
46 | (save-excursion |
47 | (let ((names (rmail-parse-file-inboxes)) | |
48 | (standard-output nil)) | |
49 | (if (or (not names) | |
50 | (y-or-n-p (concat "Replace " | |
51 | (mapconcat 'identity names ", ") | |
52 | "? "))) | |
53 | (let ((buffer-read-only nil)) | |
54 | (widen) | |
55 | (goto-char (point-min)) | |
56 | (search-forward "\n\^_") | |
57 | (re-search-backward "^Mail" nil t) | |
58 | (forward-line 0) | |
59 | (if (looking-at "Mail:") | |
60 | (delete-region (point) | |
61 | (progn (forward-line 1) | |
62 | (point)))) | |
63 | (if (not (string= file-name "")) | |
eedf8416 | 64 | (insert-before-markers "Mail: " file-name "\n")))))) |
0d20f9a0 JB |
65 | (setq rmail-inbox-list (rmail-parse-file-inboxes)) |
66 | (rmail-show-message rmail-current-message)) | |
c88ab9ce | 67 | |
cbee283d | 68 | ;; arch-tag: 74ed1d50-2c25-4cbd-b5ae-d29ed8aba6e4 |
c88ab9ce | 69 | ;;; rmailmsc.el ends here |