1
1
;;; rmailmsc.el --- miscellaneous support functions for the RMAIL mail reader
3
;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005,
4
;; 2006, 2007, 2008 Free Software Foundation, Inc.
3
;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
4
;; 2009 Free Software Foundation, Inc.
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
31
(defun set-rmail-inbox-list (file-name)
36
32
"Set the inbox list of the current RMAIL file to FILE-NAME.
37
33
You can specify one file name, or several names separated by commas.
38
If FILE-NAME is empty, remove any existing inbox list."
34
If FILE-NAME is empty, remove any existing inbox list.
36
This applies only to the current session."
39
37
(interactive "sSet mailbox list to (comma-separated list of filenames): ")
41
38
(unless (eq major-mode 'rmail-mode)
42
39
(error "set-rmail-inbox-list works only for an Rmail file"))
45
(let ((names (rmail-parse-file-inboxes))
46
(standard-output nil))
43
(goto-char (point-min))
44
(nreverse (mail-parse-comma-list)))))
45
(when (or (not rmail-inbox-list)
48
46
(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))
51
(message "Setting the inbox list for %s for this session"
52
(file-name-nondirectory (buffer-file-name)))
53
(setq rmail-inbox-list inbox-list)))
54
(rmail-show-message-1 rmail-current-message))
66
;; arch-tag: 74ed1d50-2c25-4cbd-b5ae-d29ed8aba6e4
56
;; arch-tag: 94614a62-2a0a-4e25-bac9-06f461ed4c60
67
57
;;; rmailmsc.el ends here