*** empty log message ***
[emacs.git] / lisp / mail / rmailmsc.el
blob7a0871f141473dfbcb1e1079fdf8e01e59fa7097
1 ;;; rmailmsc.el --- miscellaneous support functions for the RMAIL mail reader
3 ;; Copyright (C) 1985 Free Software Foundation, Inc.
5 ;; Maintainer: FSF
6 ;; Keywords: mail
8 ;; This file is part of GNU Emacs.
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; any later version.
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
25 ;;; Commentary:
27 ;;; Code:
29 ;;;###autoload
30 (defun set-rmail-inbox-list (file-name)
31 "Set the inbox list of the current RMAIL file to FILE-NAME.
32 You can specify one file name, or several names separated by commas.
33 If FILE-NAME is empty, remove any existing inbox list."
34 (interactive "sSet mailbox list to (comma-separated list of filenames): ")
36 (unless (eq major-mode 'rmail-mode)
37 (error "set-rmail-inbox-list works only for an Rmail file"))
39 (save-excursion
40 (let ((names (rmail-parse-file-inboxes))
41 (standard-output nil))
42 (if (or (not names)
43 (y-or-n-p (concat "Replace "
44 (mapconcat 'identity names ", ")
45 "? ")))
46 (let ((buffer-read-only nil))
47 (widen)
48 (goto-char (point-min))
49 (search-forward "\n\^_")
50 (re-search-backward "^Mail" nil t)
51 (forward-line 0)
52 (if (looking-at "Mail:")
53 (delete-region (point)
54 (progn (forward-line 1)
55 (point))))
56 (if (not (string= file-name ""))
57 (insert-before-markers "Mail: " file-name "\n"))))))
58 (setq rmail-inbox-list (rmail-parse-file-inboxes))
59 (rmail-show-message rmail-current-message))
61 ;;; rmailmsc.el ends here