1 ;;; rmailmsc.el --- miscellaneous support functions for the RMAIL mail reader
3 ;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005,
4 ;; 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
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 3 of the License, or
14 ;; (at your option) any later version.
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. If not, see <http://www.gnu.org/licenses/>.
28 (defvar rmail-current-message
)
29 (defvar rmail-inbox-list
)
31 (declare-function rmail-parse-file-inboxes
"rmail" ())
32 (declare-function rmail-show-message
"rmail" (&optional n no-summary
))
35 (defun set-rmail-inbox-list (file-name)
36 "Set the inbox list of the current RMAIL file to FILE-NAME.
37 You can specify one file name, or several names separated by commas.
38 If FILE-NAME is empty, remove any existing inbox list."
39 (interactive "sSet mailbox list to (comma-separated list of filenames): ")
41 (unless (eq major-mode
'rmail-mode
)
42 (error "set-rmail-inbox-list works only for an Rmail file"))
45 (let ((names (rmail-parse-file-inboxes))
46 (standard-output nil
))
48 (y-or-n-p (concat "Replace "
49 (mapconcat 'identity names
", ")
51 (let ((buffer-read-only nil
))
53 (goto-char (point-min))
54 (search-forward "\n\^_")
55 (re-search-backward "^Mail" nil t
)
57 (if (looking-at "Mail:")
58 (delete-region (point)
59 (progn (forward-line 1)
61 (if (not (string= file-name
""))
62 (insert-before-markers "Mail: " file-name
"\n"))))))
63 (setq rmail-inbox-list
(rmail-parse-file-inboxes))
64 (rmail-show-message rmail-current-message
))
66 ;; arch-tag: 74ed1d50-2c25-4cbd-b5ae-d29ed8aba6e4
67 ;;; rmailmsc.el ends here