]> code.delx.au - gnu-emacs/blob - lisp/mail/rmailmsc.el
(rmail-output-to-rmail-file): Specify the coding system for writing.
[gnu-emacs] / lisp / mail / rmailmsc.el
1 ;;; rmailmsc.el --- miscellaneous support functions for the RMAIL mail reader
2
3 ;; Copyright (C) 1985 Free Software Foundation, Inc.
4
5 ;; Maintainer: FSF
6 ;; Keywords: mail
7
8 ;; This file is part of GNU Emacs.
9
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.
14
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.
19
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.
24
25 ;;; Code:
26
27 ;;;###autoload
28 (defun set-rmail-inbox-list (file-name)
29 "Set the inbox list of the current RMAIL file to FILE-NAME.
30 You can specify one file name, or several names separated by commas.
31 If FILE-NAME is empty, remove any existing inbox list."
32 (interactive "sSet mailbox list to (comma-separated list of filenames): ")
33 (save-excursion
34 (let ((names (rmail-parse-file-inboxes))
35 (standard-output nil))
36 (if (or (not names)
37 (y-or-n-p (concat "Replace "
38 (mapconcat 'identity names ", ")
39 "? ")))
40 (let ((buffer-read-only nil))
41 (widen)
42 (goto-char (point-min))
43 (search-forward "\n\^_")
44 (re-search-backward "^Mail" nil t)
45 (forward-line 0)
46 (if (looking-at "Mail:")
47 (delete-region (point)
48 (progn (forward-line 1)
49 (point))))
50 (if (not (string= file-name ""))
51 (insert-before-markers "Mail: " file-name "\n"))))))
52 (setq rmail-inbox-list (rmail-parse-file-inboxes))
53 (rmail-show-message rmail-current-message))
54
55 ;;; rmailmsc.el ends here