Mercurial > emacs
annotate lisp/mail/rmailmsc.el @ 95833:111bfc3b69a7
(rmail-cease-edit): Check tool-bar-mode is bound.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Thu, 12 Jun 2008 03:49:33 +0000 |
parents | ef65fa4dca3b |
children | a9dc0e7c3f2b |
rev | line source |
---|---|
658
7cbd4fcd8b0f
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
35
diff
changeset
|
1 ;;; rmailmsc.el --- miscellaneous support functions for the RMAIL mail reader |
7cbd4fcd8b0f
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
35
diff
changeset
|
2 |
74509 | 3 ;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005, |
79712 | 4 ;; 2006, 2007, 2008 Free Software Foundation, Inc. |
845 | 5 |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
658
diff
changeset
|
6 ;; Maintainer: FSF |
814
38b2499cb3e9
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
807
diff
changeset
|
7 ;; Keywords: mail |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
658
diff
changeset
|
8 |
35 | 9 ;; This file is part of GNU Emacs. |
10 | |
94674
ef65fa4dca3b
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
11 ;; GNU Emacs is free software: you can redistribute it and/or modify |
35 | 12 ;; it under the terms of the GNU General Public License as published by |
94674
ef65fa4dca3b
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
13 ;; the Free Software Foundation, either version 3 of the License, or |
ef65fa4dca3b
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
14 ;; (at your option) any later version. |
35 | 15 |
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. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
94674
ef65fa4dca3b
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
35 | 23 |
38412
253f761ad37b
Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents:
22955
diff
changeset
|
24 ;;; Commentary: |
253f761ad37b
Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents:
22955
diff
changeset
|
25 |
2233
fb0ed5a1d0f3
Add standard library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
845
diff
changeset
|
26 ;;; Code: |
35 | 27 |
65207
0275d55d477d
(rmail-current-message, rmail-inbox-list): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents:
64754
diff
changeset
|
28 (defvar rmail-current-message) |
0275d55d477d
(rmail-current-message, rmail-inbox-list): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents:
64754
diff
changeset
|
29 (defvar rmail-inbox-list) |
0275d55d477d
(rmail-current-message, rmail-inbox-list): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents:
64754
diff
changeset
|
30 |
86440
4aedd218aad1
* mail/mspools.el (rmail-get-new-mail):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78232
diff
changeset
|
31 (declare-function rmail-parse-file-inboxes "rmail" ()) |
4aedd218aad1
* mail/mspools.el (rmail-get-new-mail):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78232
diff
changeset
|
32 (declare-function rmail-show-message "rmail" (&optional n no-summary)) |
4aedd218aad1
* mail/mspools.el (rmail-get-new-mail):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78232
diff
changeset
|
33 |
16346
09fccbb1dcf1
(set-rmail-inbox-list): Add autoload cookie.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
34 ;;;###autoload |
35 | 35 (defun set-rmail-inbox-list (file-name) |
36 "Set the inbox list of the current RMAIL file to FILE-NAME. | |
8715
b4cfdc266626
(set-rmail-inbox-list): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
7954
diff
changeset
|
37 You can specify one file name, or several names separated by commas. |
b4cfdc266626
(set-rmail-inbox-list): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
7954
diff
changeset
|
38 If FILE-NAME is empty, remove any existing inbox list." |
35 | 39 (interactive "sSet mailbox list to (comma-separated list of filenames): ") |
22955
e3aa855e560c
(set-rmail-inbox-list): Error if not in Rmail mode.
Richard M. Stallman <rms@gnu.org>
parents:
16346
diff
changeset
|
40 |
e3aa855e560c
(set-rmail-inbox-list): Error if not in Rmail mode.
Richard M. Stallman <rms@gnu.org>
parents:
16346
diff
changeset
|
41 (unless (eq major-mode 'rmail-mode) |
e3aa855e560c
(set-rmail-inbox-list): Error if not in Rmail mode.
Richard M. Stallman <rms@gnu.org>
parents:
16346
diff
changeset
|
42 (error "set-rmail-inbox-list works only for an Rmail file")) |
e3aa855e560c
(set-rmail-inbox-list): Error if not in Rmail mode.
Richard M. Stallman <rms@gnu.org>
parents:
16346
diff
changeset
|
43 |
35 | 44 (save-excursion |
45 (let ((names (rmail-parse-file-inboxes)) | |
46 (standard-output nil)) | |
47 (if (or (not names) | |
48 (y-or-n-p (concat "Replace " | |
49 (mapconcat 'identity names ", ") | |
50 "? "))) | |
51 (let ((buffer-read-only nil)) | |
52 (widen) | |
53 (goto-char (point-min)) | |
54 (search-forward "\n\^_") | |
55 (re-search-backward "^Mail" nil t) | |
56 (forward-line 0) | |
57 (if (looking-at "Mail:") | |
58 (delete-region (point) | |
59 (progn (forward-line 1) | |
60 (point)))) | |
61 (if (not (string= file-name "")) | |
7954
621c28be27a0
(set-rmail-inbox-list): Use insert-before-markers.
Richard M. Stallman <rms@gnu.org>
parents:
2233
diff
changeset
|
62 (insert-before-markers "Mail: " file-name "\n")))))) |
35 | 63 (setq rmail-inbox-list (rmail-parse-file-inboxes)) |
64 (rmail-show-message rmail-current-message)) | |
658
7cbd4fcd8b0f
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
35
diff
changeset
|
65 |
93975
1e3a407766b9
Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
87649
diff
changeset
|
66 ;; arch-tag: 74ed1d50-2c25-4cbd-b5ae-d29ed8aba6e4 |
658
7cbd4fcd8b0f
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
35
diff
changeset
|
67 ;;; rmailmsc.el ends here |