*** empty log message ***
[emacs.git] / lisp / mail / rmailmsc.el
blobcd042ae94c0d55d2ee5e5d91f8dbde126d746d7f
1 ;;; rmailmsc.el --- miscellaneous support functions for the RMAIL mail reader
3 ;; Copyright (C) 1985 Free Software Foundation, Inc.
5 ;; This file is part of GNU Emacs.
7 ;; GNU Emacs is free software; you can redistribute it and/or modify
8 ;; it under the terms of the GNU General Public License as published by
9 ;; the Free Software Foundation; either version 1, or (at your option)
10 ;; any later version.
12 ;; GNU Emacs is distributed in the hope that it will be useful,
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;; GNU General Public License for more details.
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GNU Emacs; see the file COPYING. If not, write to
19 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
22 (defun set-rmail-inbox-list (file-name)
23 "Set the inbox list of the current RMAIL file to FILE-NAME.
24 This may be a list of file names separated by commas.
25 If FILE-NAME is empty, remove any inbox list."
26 (interactive "sSet mailbox list to (comma-separated list of filenames): ")
27 (save-excursion
28 (let ((names (rmail-parse-file-inboxes))
29 (standard-output nil))
30 (if (or (not names)
31 (y-or-n-p (concat "Replace "
32 (mapconcat 'identity names ", ")
33 "? ")))
34 (let ((buffer-read-only nil))
35 (widen)
36 (goto-char (point-min))
37 (search-forward "\n\^_")
38 (re-search-backward "^Mail" nil t)
39 (forward-line 0)
40 (if (looking-at "Mail:")
41 (delete-region (point)
42 (progn (forward-line 1)
43 (point))))
44 (if (not (string= file-name ""))
45 (insert "Mail: " file-name "\n"))))))
46 (setq rmail-inbox-list (rmail-parse-file-inboxes))
47 (rmail-show-message rmail-current-message))
49 ;;; rmailmsc.el ends here