Mercurial > emacs
annotate lisp/mail/mh-utils.el @ 13933:efd6ce432dc5
(browse-url-mosaic): Print "done" message
after starting mosaic. Change the message about sending a signal.
(browse-url-netscape): Print "done" message after starting.
(browse-url-usr1-signal): Use SIGUSR1 in upper case.
(browse-url-at-point, browse-url-at-mouse, browse-url-of-buffer)
(browse-url-of-file, browse-url-of-dired-file): Add autoload cookies.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 04 Jan 1996 08:32:49 +0000 |
parents | 78c7ebcbd9fe |
children | e7809b53da4d |
rev | line source |
---|---|
6365 | 1 ;;; mh-utils.el --- mh-e code needed for both sending and reading |
13386
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
2 ;; Time-stamp: <95/10/22 17:58:16 gildea> |
6365 | 3 |
11331 | 4 ;; Copyright (C) 1993, 1995 Free Software Foundation, Inc. |
6365 | 5 |
13386
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
6 ;; This file is part of mh-e, part of GNU Emacs. |
6365 | 7 |
11333 | 8 ;; GNU Emacs is free software; you can redistribute it and/or modify |
6365 | 9 ;; it under the terms of the GNU General Public License as published by |
10 ;; the Free Software Foundation; either version 2, or (at your option) | |
11 ;; any later version. | |
12 | |
11333 | 13 ;; GNU Emacs is distributed in the hope that it will be useful, |
6365 | 14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 ;; GNU General Public License for more details. | |
17 | |
18 ;; You should have received a copy of the GNU General Public License | |
11333 | 19 ;; along with GNU Emacs; see the file COPYING. If not, write to |
6365 | 20 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
21 | |
22 ;;; Commentary: | |
23 | |
24 ;; Internal support for mh-e package. | |
25 | |
11331 | 26 ;;; Change Log: |
27 | |
13386
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
28 ;; $Id: mh-utils.el,v 1.5 1995/04/25 22:27:45 kwzh Exp kwzh $ |
11331 | 29 |
6365 | 30 ;;; Code: |
31 | |
6856
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
32 ;;; Set for local environment: |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
33 ;;; mh-progs and mh-lib used to be set in paths.el, which tried to |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
34 ;;; figure out at build time which of several possible directories MH |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
35 ;;; was installed into. But if you installed MH after building Emacs, |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
36 ;;; this would almost certainly be wrong, so now we do it at run time. |
6365 | 37 |
6856
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
38 (defvar mh-progs nil |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
39 "Directory containing MH commands, such as inc, repl, and rmm.") |
6365 | 40 |
6856
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
41 (defvar mh-lib nil |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
42 "Directory containing the MH library. |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
43 This directory contains, among other things, |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
44 the mhl program and the components file.") |
6365 | 45 |
11331 | 46 ;;;###autoload |
47 (put 'mh-progs 'risky-local-variable t) | |
48 ;;;###autoload | |
49 (put 'mh-lib 'risky-local-variable t) | |
50 | |
6856
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
51 ;;; User preferences: |
6365 | 52 |
53 (defvar mh-auto-folder-collect t | |
54 "*Whether to start collecting MH folder names immediately in the background. | |
55 Non-nil means start a background process collecting the names of all | |
56 folders as soon as mh-e is loaded.") | |
57 | |
58 (defvar mh-recursive-folders nil | |
59 "*If non-nil, then commands which operate on folders do so recursively.") | |
60 | |
61 (defvar mh-clean-message-header nil | |
62 "*Non-nil means clean headers of messages that are displayed or inserted. | |
63 The variables `mh-visible-headers' and `mh-invisible-headers' control what | |
64 is removed.") | |
65 | |
66 (defvar mh-visible-headers nil | |
67 "*If non-nil, contains a regexp specifying the headers to keep when cleaning. | |
68 Only used if `mh-clean-message-header' is non-nil. Setting this variable | |
69 overrides `mh-invisible-headers'.") | |
70 | |
71 (defvar mh-invisible-headers | |
11331 | 72 "^Received: \\|^Message-Id: \\|^Remailed-\\|^Via: \\|^Mail-from: \\|^Return-Path: \\|^Delivery-Date: \\|^In-Reply-To: \\|^Resent-" |
6365 | 73 "Regexp matching lines in a message header that are not to be shown. |
74 If `mh-visible-headers' is non-nil, it is used instead to specify what | |
75 to keep.") | |
76 | |
77 (defvar mh-bury-show-buffer t | |
78 "*Non-nil means that the displayed show buffer for a folder is buried.") | |
79 | |
80 (defvar mh-summary-height 4 | |
81 "*Number of lines in MH-Folder window (including the mode line).") | |
82 | |
83 (defvar mh-msg-number-regexp "^ *\\([0-9]+\\)" | |
84 "Regexp to find the number of a message in a scan line. | |
85 The message's number must be surrounded with \\( \\)") | |
86 | |
87 (defvar mh-msg-search-regexp "^[^0-9]*%d[^0-9]" | |
88 "Format string containing a regexp matching the scan listing for a message. | |
89 The desired message's number will be an argument to format.") | |
90 | |
91 (defvar mhl-formfile nil | |
92 "*Name of format file to be used by mhl to show and print messages. | |
93 A value of T means use the default format file. | |
94 Nil means don't use mhl to format messages when showing; mhl is still used, | |
95 with the default format file, to format messages when printing them. | |
96 The format used should specify a non-zero value for overflowoffset so | |
97 the message continues to conform to RFC 822 and mh-e can parse the headers.") | |
13386
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
98 (put 'mhl-formfile 'info-file "mh-e") |
6365 | 99 |
11331 | 100 (defvar mh-default-folder-for-message-function nil |
101 "Function to select a default folder for refiling or Fcc. | |
102 If set to a function, that function is called with no arguments by | |
103 `\\[mh-refile-msg]' and `\\[mh-to-fcc]' to get a default when | |
104 prompting the user for a folder. The function is called from within a | |
105 save-excursion, with point at the start of the message. It should | |
106 return the folder to offer as the refile or Fcc folder, as a string | |
107 with a leading `+' sign. It can also return an empty string to use no | |
108 default, or NIL to calculate the default the usual way. | |
109 NOTE: This variable is not an ordinary hook; | |
110 It may not be a list of functions.") | |
6365 | 111 |
11331 | 112 (defvar mh-find-path-hook nil |
113 "Invoked by mh-find-path while reading the user's MH profile.") | |
114 | |
115 (defvar mh-folder-list-change-hook nil | |
116 "Invoked whenever the cached folder list `mh-folder-list' is changed.") | |
117 | |
118 (defvar mh-show-buffer-mode-line-buffer-id "{show-%s} %d" | |
119 "Format string to produce `mode-line-buffer-identification' for show buffers. | |
120 First argument is folder name. Second is message number.") | |
6365 | 121 |
122 (defvar mh-cmd-note 4 | |
123 "Offset to insert notation.") | |
124 | |
11331 | 125 (defvar mh-note-seq "%" |
126 "String whose first character is used to notate messages in a sequence.") | |
127 | |
128 ;;; Internal bookkeeping variables: | |
6365 | 129 |
11331 | 130 ;; The value of `mh-folder-list-change-hook' is called whenever |
131 ;; mh-folder-list variable is set. | |
132 (defvar mh-folder-list nil) ;List of folder names for completion. | |
133 | |
134 ;; Cached value of the `Path:' component in the user's MH profile. | |
135 (defvar mh-user-path nil) ;User's mail folder directory. | |
6365 | 136 |
11331 | 137 ;; An mh-draft-folder of NIL means do not use a draft folder. |
138 ;; Cached value of the `Draft-Folder:' component in the user's MH profile. | |
139 (defvar mh-draft-folder nil) ;Name of folder containing draft messages. | |
140 | |
141 ;; Cached value of the `Unseen-Sequence:' component in the user's MH profile. | |
142 (defvar mh-unseen-seq nil) ;Name of the Unseen sequence. | |
6365 | 143 |
11331 | 144 ;; Cached value of the `Previous-Sequence:' component in the user's MH profile. |
145 (defvar mh-previous-seq nil) ;Name of the Previous sequence. | |
6365 | 146 |
11331 | 147 ;; Cached value of the `Inbox:' component in the user's MH profile, |
148 ;; or "+inbox" if no such component. | |
149 (defvar mh-inbox nil) ;Name of the Inbox folder. | |
6365 | 150 |
11331 | 151 (defconst mh-temp-buffer " *mh-temp*") ;Name of mh-e scratch buffer. |
152 | |
153 (defvar mh-previous-window-config nil) ;Window configuration before mh-e command. | |
154 | |
155 ;;; Internal variables local to a folder. | |
6365 | 156 |
11331 | 157 (defvar mh-current-folder nil) ;Name of current folder, a string. |
158 | |
159 (defvar mh-show-buffer nil) ;Buffer that displays message for this folder. | |
6365 | 160 |
11331 | 161 (defvar mh-folder-filename nil) ;Full path of directory for this folder. |
13386
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
162 |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
163 (defvar mh-msg-count nil) ;Number of msgs in buffer. |
11331 | 164 |
165 (defvar mh-showing nil) ;If non-nil, show the message in a separate window. | |
6365 | 166 |
11331 | 167 ;;; This holds a documentation string used by describe-mode. |
168 (defun mh-showing () | |
169 "When moving to a new message in the Folder window, | |
170 also show it in a separate Show window." | |
171 nil) | |
6365 | 172 |
11331 | 173 (defvar mh-seq-list nil) ;The sequences of this folder. An alist of (seq . msgs). |
174 | |
175 (defvar mh-seen-list nil) ;List of displayed messages to be removed from the Unseen sequence. | |
6365 | 176 |
11331 | 177 ;; If non-nil, show buffer contains message with all headers. |
178 ;; If nil, show buffer contains message processed normally. | |
179 (defvar mh-showing-with-headers nil) ;Showing message with headers or normally. | |
6365 | 180 |
181 | |
6856
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
182 ;;; mh-e macros |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
183 |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
184 (defmacro with-mh-folder-updating (save-modification-flag-p &rest body) |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
185 ;; Format is (with-mh-folder-updating (SAVE-MODIFICATION-FLAG-P) &body BODY). |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
186 ;; Execute BODY, which can modify the folder buffer without having to |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
187 ;; worry about file locking or the read-only flag, and return its result. |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
188 ;; If SAVE-MODIFICATION-FLAG-P is non-nil, the buffer's modification |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
189 ;; flag is unchanged, otherwise it is cleared. |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
190 (setq save-modification-flag-p (car save-modification-flag-p)) ; CL style |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
191 (` (prog1 |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
192 (let ((mh-folder-updating-mod-flag (buffer-modified-p)) |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
193 (buffer-read-only nil) |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
194 (buffer-file-name nil)) ;don't let the buffer get locked |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
195 (prog1 |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
196 (progn |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
197 (,@ body)) |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
198 (mh-set-folder-modified-p mh-folder-updating-mod-flag))) |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
199 (,@ (if (not save-modification-flag-p) |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
200 '((mh-set-folder-modified-p nil))))))) |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
201 |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
202 (put 'with-mh-folder-updating 'lisp-indent-hook 1) |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
203 |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
204 (defmacro mh-in-show-buffer (show-buffer &rest body) |
11331 | 205 ;; Format is (mh-in-show-buffer (SHOW-BUFFER) &body BODY). |
6856
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
206 ;; Display buffer SHOW-BUFFER in other window and execute BODY in it. |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
207 ;; Stronger than save-excursion, weaker than save-window-excursion. |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
208 (setq show-buffer (car show-buffer)) ; CL style |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
209 (` (let ((mh-in-show-buffer-saved-window (selected-window))) |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
210 (switch-to-buffer-other-window (, show-buffer)) |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
211 (if mh-bury-show-buffer (bury-buffer (current-buffer))) |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
212 (unwind-protect |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
213 (progn |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
214 (,@ body)) |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
215 (select-window mh-in-show-buffer-saved-window))))) |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
216 |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
217 (put 'mh-in-show-buffer 'lisp-indent-hook 1) |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
218 |
11331 | 219 (defmacro mh-make-seq (name msgs) (list 'cons name msgs)) |
220 | |
6856
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
221 (defmacro mh-seq-name (pair) (list 'car pair)) |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
222 |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
223 (defmacro mh-seq-msgs (pair) (list 'cdr pair)) |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
224 |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
225 |
6365 | 226 ;;; Ensure new buffers won't get this mode if default-major-mode is nil. |
227 (put 'mh-show-mode 'mode-class 'special) | |
228 | |
229 (defun mh-show-mode () | |
230 "Major mode for showing messages in mh-e. | |
231 The value of mh-show-mode-hook is called when a new message is displayed." | |
232 (kill-all-local-variables) | |
233 (setq major-mode 'mh-show-mode) | |
234 (mh-set-mode-name "MH-Show") | |
235 (run-hooks 'mh-show-mode-hook)) | |
236 | |
237 | |
238 (defun mh-maybe-show (&optional msg) | |
239 ;; If in showing mode, then display the message pointed to by the cursor. | |
240 (if mh-showing (mh-show msg))) | |
241 | |
11331 | 242 (defun mh-show (&optional message) |
6856
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
243 "Show MESSAGE (default: message at cursor). |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
244 Force a two-window display with the folder window on top (size |
6365 | 245 mh-summary-height) and the show buffer below it. |
6856
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
246 If the message is already visible, display the start of the message. |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
247 |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
248 Display of the message is controlled by setting the variables |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
249 `mh-clean-message-header' and `mhl-formfile'. The default behavior is |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
250 to scroll uninteresting headers off the top of the window. |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
251 Type \"\\[mh-header-display]\" to see the message with all its headers." |
6365 | 252 (interactive) |
253 (and mh-showing-with-headers | |
254 (or mhl-formfile mh-clean-message-header) | |
255 (mh-invalidate-show-buffer)) | |
11331 | 256 (mh-show-msg message)) |
6365 | 257 |
258 | |
259 (defun mh-show-msg (msg) | |
260 (if (not msg) | |
261 (setq msg (mh-get-msg-num t))) | |
262 (setq mh-showing t) | |
263 (let ((folder mh-current-folder) | |
264 (clean-message-header mh-clean-message-header) | |
265 (show-window (get-buffer-window mh-show-buffer))) | |
266 (if (not (eql (next-window (minibuffer-window)) (selected-window))) | |
267 (delete-other-windows)) ; force ourself to the top window | |
268 (mh-in-show-buffer (mh-show-buffer) | |
269 (if (and show-window | |
270 (equal (mh-msg-filename msg folder) buffer-file-name)) | |
271 (progn ;just back up to start | |
272 (goto-char (point-min)) | |
273 (if (not clean-message-header) | |
274 (mh-start-of-uncleaned-message))) | |
275 (mh-display-msg msg folder)))) | |
276 (if (not (= (1+ (window-height)) (screen-height))) ;not horizontally split | |
277 (shrink-window (- (window-height) mh-summary-height))) | |
278 (mh-recenter nil) | |
279 (if (not (memq msg mh-seen-list)) (setq mh-seen-list (cons msg mh-seen-list))) | |
280 (run-hooks 'mh-show-hook)) | |
281 | |
282 | |
283 (defun mh-display-msg (msg-num folder) | |
284 ;; Display message NUMBER of FOLDER. | |
285 ;; Sets the current buffer to the show buffer. | |
286 (set-buffer folder) | |
287 ;; Bind variables in folder buffer in case they are local | |
288 (let ((formfile mhl-formfile) | |
289 (clean-message-header mh-clean-message-header) | |
290 (invisible-headers mh-invisible-headers) | |
291 (visible-headers mh-visible-headers) | |
292 (msg-filename (mh-msg-filename msg-num)) | |
293 (show-buffer mh-show-buffer)) | |
294 (if (not (file-exists-p msg-filename)) | |
295 (error "Message %d does not exist" msg-num)) | |
296 (set-buffer show-buffer) | |
297 (cond ((not (equal msg-filename buffer-file-name)) | |
11331 | 298 (mh-unvisit-file) |
6365 | 299 (erase-buffer) |
11331 | 300 ;; Changing contents, so this hook needs to be reinitialized. |
301 ;; pgp.el uses this. | |
302 (if (boundp 'write-contents-hooks) ;Emacs 19 | |
303 (setq write-contents-hooks nil)) | |
6365 | 304 (if formfile |
305 (mh-exec-lib-cmd-output "mhl" "-nobell" "-noclear" | |
306 (if (stringp formfile) | |
307 (list "-form" formfile)) | |
308 msg-filename) | |
309 (insert-file-contents msg-filename)) | |
310 (goto-char (point-min)) | |
311 (cond (clean-message-header | |
312 (mh-clean-msg-header (point-min) | |
313 invisible-headers | |
314 visible-headers) | |
315 (goto-char (point-min))) | |
316 (t | |
317 (mh-start-of-uncleaned-message))) | |
11331 | 318 ;; the parts of visiting we want to do (no locking) |
6365 | 319 (or (eq buffer-undo-list t) ;don't save undo info for prev msgs |
320 (setq buffer-undo-list nil)) | |
11331 | 321 (set-buffer-modified-p nil) |
322 (set-buffer-auto-saved) | |
323 ;; the parts of set-visited-file-name we want to do (no locking) | |
6365 | 324 (setq buffer-file-name msg-filename) |
11331 | 325 (setq buffer-backed-up nil) |
326 (auto-save-mode 1) | |
6365 | 327 (set-mark nil) |
328 (mh-show-mode) | |
329 (setq mode-line-buffer-identification | |
330 (list (format mh-show-buffer-mode-line-buffer-id | |
331 folder msg-num))) | |
332 (set-buffer folder) | |
333 (setq mh-showing-with-headers nil))))) | |
334 | |
335 (defun mh-start-of-uncleaned-message () | |
336 ;; position uninteresting headers off the top of the window | |
337 (let ((case-fold-search t)) | |
338 (re-search-forward | |
11331 | 339 "^To:\\|^Cc:\\|^From:\\|^Subject:\\|^Date:" nil t) |
6365 | 340 (beginning-of-line) |
341 (mh-recenter 0))) | |
342 | |
343 | |
344 (defun mh-invalidate-show-buffer () | |
345 ;; Invalidate the show buffer so we must update it to use it. | |
346 (if (get-buffer mh-show-buffer) | |
347 (save-excursion | |
348 (set-buffer mh-show-buffer) | |
11331 | 349 (mh-unvisit-file)))) |
6365 | 350 |
351 | |
11331 | 352 (defun mh-unvisit-file () |
353 ;; Separate current buffer from the message file it was visiting. | |
354 (or (not (buffer-modified-p)) | |
355 (null buffer-file-name) ;we've been here before | |
356 (yes-or-no-p (format "Message %s modified; flush changes? " | |
357 (file-name-nondirectory buffer-file-name))) | |
358 (error "Flushing changes not confirmed")) | |
359 (clear-visited-file-modtime) | |
360 (unlock-buffer) | |
361 (setq buffer-file-name nil)) | |
362 | |
363 | |
6365 | 364 (defun mh-get-msg-num (error-if-no-message) |
365 ;; Return the message number of the displayed message. If the argument | |
366 ;; ERROR-IF-NO-MESSAGE is non-nil, then complain if the cursor is not | |
367 ;; pointing to a message. | |
368 (save-excursion | |
369 (beginning-of-line) | |
370 (cond ((looking-at mh-msg-number-regexp) | |
371 (string-to-int (buffer-substring (match-beginning 1) | |
372 (match-end 1)))) | |
373 (error-if-no-message | |
374 (error "Cursor not pointing to message")) | |
375 (t nil)))) | |
376 | |
377 | |
378 (defun mh-msg-filename (msg &optional folder) | |
379 ;; Return the file name of MESSAGE in FOLDER (default current folder). | |
380 (expand-file-name (int-to-string msg) | |
381 (if folder | |
382 (mh-expand-file-name folder) | |
383 mh-folder-filename))) | |
384 | |
385 | |
386 (defun mh-clean-msg-header (start invisible-headers visible-headers) | |
387 ;; Flush extraneous lines in a message header, from the given POINT to the | |
388 ;; end of the message header. If VISIBLE-HEADERS is non-nil, it contains a | |
389 ;; regular expression specifying the lines to display, otherwise | |
390 ;; INVISIBLE-HEADERS contains a regular expression specifying lines to | |
391 ;; delete from the header. | |
392 (let ((case-fold-search t)) | |
393 (save-restriction | |
394 (goto-char start) | |
395 (if (search-forward "\n\n" nil 'move) | |
396 (backward-char 1)) | |
397 (narrow-to-region start (point)) | |
398 (goto-char (point-min)) | |
399 (if visible-headers | |
400 (while (< (point) (point-max)) | |
401 (cond ((looking-at visible-headers) | |
402 (forward-line 1) | |
403 (while (looking-at "[ \t]") (forward-line 1))) | |
404 (t | |
405 (mh-delete-line 1) | |
406 (while (looking-at "[ \t]") | |
407 (mh-delete-line 1))))) | |
408 (while (re-search-forward invisible-headers nil t) | |
409 (beginning-of-line) | |
410 (mh-delete-line 1) | |
411 (while (looking-at "[ \t]") | |
412 (mh-delete-line 1)))) | |
413 (unlock-buffer)))) | |
414 | |
415 | |
416 (defun mh-recenter (arg) | |
417 ;; Like recenter but with two improvements: nil arg means recenter, | |
418 ;; and only does anything if the current buffer is in the selected | |
419 ;; window. (Commands like save-some-buffers can make this false.) | |
420 (if (eql (get-buffer-window (current-buffer)) | |
421 (selected-window)) | |
422 (recenter (if arg arg '(t))))) | |
423 | |
424 | |
425 (defun mh-delete-line (lines) | |
426 ;; Delete version of kill-line. | |
13386
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
427 (delete-region (point) (progn (forward-line lines) (point)))) |
6365 | 428 |
429 | |
430 (defun mh-notate (msg notation offset) | |
431 ;; Marks MESSAGE with the character NOTATION at position OFFSET. | |
432 ;; Null MESSAGE means the message that the cursor points to. | |
433 (save-excursion | |
434 (if (or (null msg) | |
435 (mh-goto-msg msg t t)) | |
436 (with-mh-folder-updating (t) | |
437 (beginning-of-line) | |
438 (forward-char offset) | |
439 (delete-char 1) | |
440 (insert notation))))) | |
441 | |
442 | |
13386
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
443 (defun mh-find-msg-get-num (step) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
444 ;; Return the message number of the message on the current scan line |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
445 ;; or one nearby. Jumps over non-message lines, such as inc errors. |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
446 ;; STEP tells whether to search forward or backward if we have to search. |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
447 (or (mh-get-msg-num nil) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
448 (let ((msg-num nil) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
449 (nreverses 0)) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
450 (while (and (not msg-num) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
451 (< nreverses 2)) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
452 (cond ((eobp) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
453 (setq step -1) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
454 (setq nreverses (1+ nreverses))) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
455 ((bobp) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
456 (setq step 1) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
457 (setq nreverses (1+ nreverses)))) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
458 (forward-line step) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
459 (setq msg-num (mh-get-msg-num nil))) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
460 msg-num))) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
461 |
6365 | 462 (defun mh-goto-msg (number &optional no-error-if-no-message dont-show) |
463 "Position the cursor at message NUMBER. | |
11331 | 464 Optional non-nil second argument means return nil instead of |
13386
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
465 signaling an error if message does not exist; in this case, |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
466 the cursor is positioned near where the message would have been. |
11331 | 467 Non-nil third argument means not to show the message." |
468 (interactive "NGo to message: ") | |
469 (setq number (prefix-numeric-value number)) ;Emacs 19 | |
13386
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
470 ;; This basic routine tries to be as fast as possible, |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
471 ;; using a binary search and minimal regexps. |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
472 (let ((cur-msg (mh-find-msg-get-num -1)) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
473 (jump-size mh-msg-count)) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
474 (while (and (> jump-size 1) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
475 cur-msg |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
476 (not (eq cur-msg number))) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
477 (cond ((< cur-msg number) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
478 (setq jump-size (min (- number cur-msg) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
479 (ash (1+ jump-size) -1))) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
480 (forward-line jump-size) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
481 (setq cur-msg (mh-find-msg-get-num 1))) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
482 (t |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
483 (setq jump-size (min (- cur-msg number) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
484 (ash (1+ jump-size) -1))) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
485 (forward-line (- jump-size)) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
486 (setq cur-msg (mh-find-msg-get-num -1))))) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
487 (if (eq cur-msg number) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
488 (progn |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
489 (beginning-of-line) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
490 (or dont-show |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
491 (mh-maybe-show number) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
492 t)) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
493 (if (not no-error-if-no-message) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
494 (error "No message %d" number))))) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
495 |
6365 | 496 |
497 (defun mh-msg-search-pat (n) | |
498 ;; Return a search pattern for message N in the scan listing. | |
499 (format mh-msg-search-regexp n)) | |
500 | |
501 | |
11331 | 502 (defun mh-get-profile-field (field) |
503 ;; Find and return the value of FIELD in the current buffer. | |
504 ;; Returns NIL if the field is not in the buffer. | |
505 (let ((case-fold-search t)) | |
506 (goto-char (point-min)) | |
507 (cond ((not (re-search-forward (format "^%s" field) nil t)) nil) | |
508 ((looking-at "[\t ]*$") nil) | |
509 (t | |
510 (re-search-forward "[\t ]*\\([^\t \n].*\\)$" nil t) | |
511 (let ((start (match-beginning 1))) | |
512 (end-of-line) | |
513 (buffer-substring start (point))))))) | |
514 | |
13386
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
515 (defvar mua-paradigm "MH-E") ;from mua.el |
11331 | 516 |
6365 | 517 (defun mh-find-path () |
518 ;; Set mh-progs and mh-lib. | |
519 ;; (This step is necessary if MH was installed after this Emacs was dumped.) | |
11331 | 520 ;; From profile file, set mh-user-path, mh-draft-folder, |
521 ;; mh-unseen-seq, mh-previous-seq, mh-inbox. | |
6365 | 522 (mh-find-progs) |
523 (save-excursion | |
524 ;; Be sure profile is fully expanded before switching buffers | |
525 (let ((profile (expand-file-name (or (getenv "MH") "~/.mh_profile")))) | |
11331 | 526 (set-buffer (get-buffer-create mh-temp-buffer)) |
6365 | 527 (setq buffer-offer-save nil) ;for people who set default to t |
528 (erase-buffer) | |
529 (condition-case err | |
530 (insert-file-contents profile) | |
531 (file-error | |
532 (mh-install profile err))) | |
11331 | 533 (setq mh-user-path (mh-get-profile-field "Path:")) |
534 (if (not mh-user-path) | |
6365 | 535 (setq mh-user-path "Mail")) |
536 (setq mh-user-path | |
537 (file-name-as-directory | |
538 (expand-file-name mh-user-path (expand-file-name "~")))) | |
11331 | 539 (setq mh-draft-folder (mh-get-profile-field "Draft-Folder:")) |
540 (if mh-draft-folder | |
541 (progn | |
542 (if (not (mh-folder-name-p mh-draft-folder)) | |
543 (setq mh-draft-folder (format "+%s" mh-draft-folder))) | |
544 (if (not (file-exists-p (mh-expand-file-name mh-draft-folder))) | |
545 (error "Draft folder \"%s\" not found. Create it and try again." | |
546 (mh-expand-file-name mh-draft-folder))))) | |
547 (setq mh-inbox (mh-get-profile-field "Inbox:")) | |
548 (cond ((not mh-inbox) | |
549 (setq mh-inbox "+inbox")) | |
550 ((not (mh-folder-name-p mh-inbox)) | |
551 (setq mh-inbox (format "+%s" mh-inbox)))) | |
552 (setq mh-unseen-seq (mh-get-profile-field "Unseen-Sequence:")) | |
553 (if mh-unseen-seq | |
554 (setq mh-unseen-seq (intern mh-unseen-seq)) | |
555 (setq mh-unseen-seq 'unseen)) ;old MH default? | |
556 (setq mh-previous-seq (mh-get-profile-field "Previous-Sequence:")) | |
557 (if mh-previous-seq | |
558 (setq mh-previous-seq (intern mh-previous-seq))) | |
13386
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
559 (setq mua-paradigm "MH-E") |
11331 | 560 (run-hooks 'mh-find-path-hook)))) |
6365 | 561 |
562 (defun mh-find-progs () | |
563 (or (file-exists-p (expand-file-name "inc" mh-progs)) | |
564 (setq mh-progs | |
565 (or (mh-path-search exec-path "inc") | |
6856
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
566 (mh-path-search '("/usr/local/bin/mh/" |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
567 "/usr/local/mh/" |
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
568 "/usr/bin/mh/" ;Ultrix 4.2 |
6365 | 569 "/usr/new/mh/" ;Ultrix <4.2 |
11331 | 570 "/usr/contrib/mh/bin/" ;BSDI |
571 "/usr/local/bin/" | |
6856
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
572 ) |
6365 | 573 "inc") |
11331 | 574 mh-progs |
6365 | 575 "/usr/local/bin/"))) |
576 (or (file-exists-p (expand-file-name "mhl" mh-lib)) | |
577 (setq mh-lib | |
6856
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
578 (or (mh-path-search '("/usr/local/lib/mh/" |
11331 | 579 "/usr/local/mh/lib/" |
580 "/usr/local/bin/mh/" | |
6856
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
581 "/usr/lib/mh/" ;Ultrix 4.2 |
6365 | 582 "/usr/new/lib/mh/" ;Ultrix <4.2 |
11331 | 583 "/usr/contrib/mh/lib/" ;BSDI |
6856
396254137b30
(mh-progs, mh-lib): Move from mh-e.el
Richard M. Stallman <rms@gnu.org>
parents:
6365
diff
changeset
|
584 ) |
6365 | 585 "mhl") |
586 (mh-path-search exec-path "mhl") ;unlikely | |
11331 | 587 mh-lib |
588 "/usr/local/lib/mh/")))) | |
6365 | 589 |
590 (defun mh-path-search (path file) | |
591 ;; Search PATH, a list of directory names, for FILE. | |
592 ;; Returns the element of PATH that contains FILE, or nil if not found. | |
593 (while (and path | |
594 (not (file-exists-p (expand-file-name file (car path))))) | |
595 (setq path (cdr path))) | |
596 (car path)) | |
597 | |
13386
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
598 (defvar mh-no-install nil) ;do not run install-mh |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
599 |
6365 | 600 (defun mh-install (profile error-val) |
601 ;; Called to do error recovery if we fail to read the profile file. | |
602 ;; If possible, initialize the MH environment. | |
603 (if (or (getenv "MH") | |
13386
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
604 (file-exists-p profile) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
605 mh-no-install) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
606 (signal (car error-val) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
607 (list (format "Cannot read MH profile \"%s\"" profile) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
608 (car (cdr (cdr error-val)))))) |
6365 | 609 ;; The "install-mh" command will output a short note which |
610 ;; mh-exec-cmd will display to the user. | |
11331 | 611 ;; The MH 5 version of install-mh might try prompt the user |
612 ;; for information, which would fail here. | |
6365 | 613 (mh-exec-cmd (expand-file-name "install-mh" mh-lib) "-auto") |
614 ;; now try again to read the profile file | |
615 (erase-buffer) | |
616 (condition-case err | |
617 (insert-file-contents profile) | |
618 (file-error | |
13386
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
619 (signal (car err) ;re-signal with more specific msg |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
620 (list (format "Cannot read MH profile \"%s\"" profile) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
621 (car (cdr (cdr err)))))))) |
6365 | 622 |
623 | |
624 (defun mh-set-folder-modified-p (flag) | |
11331 | 625 ;; Mark current folder as modified or unmodified according to FLAG. |
6365 | 626 (set-buffer-modified-p flag)) |
627 | |
628 | |
629 (defun mh-find-seq (name) (assoc name mh-seq-list)) | |
630 | |
631 (defun mh-seq-to-msgs (seq) | |
11331 | 632 ;; Return a list of the messages in SEQUENCE. |
6365 | 633 (mh-seq-msgs (mh-find-seq seq))) |
634 | |
635 | |
636 (defun mh-add-msgs-to-seq (msgs seq &optional internal-flag) | |
637 ;; Add MESSAGE(s) to the SEQUENCE. If optional FLAG is non-nil, do not mark | |
638 ;; the message in the scan listing or inform MH of the addition. | |
639 (let ((entry (mh-find-seq seq))) | |
640 (if (and msgs (atom msgs)) (setq msgs (list msgs))) | |
641 (if (null entry) | |
642 (setq mh-seq-list (cons (mh-make-seq seq msgs) mh-seq-list)) | |
11331 | 643 (if msgs (setcdr entry (append msgs (mh-seq-msgs entry))))) |
6365 | 644 (cond ((not internal-flag) |
645 (mh-add-to-sequence seq msgs) | |
11331 | 646 (mh-notate-seq seq mh-note-seq (1+ mh-cmd-note)))))) |
6365 | 647 |
648 (autoload 'mh-add-to-sequence "mh-seq") | |
649 (autoload 'mh-notate-seq "mh-seq") | |
650 (autoload 'mh-read-seq-default "mh-seq") | |
651 (autoload 'mh-map-to-seq-msgs "mh-seq") | |
652 | |
653 | |
654 (defun mh-set-mode-name (mode-name-string) | |
655 ;; Set the mode-name and ensure that the mode line is updated. | |
656 (setq mode-name mode-name-string) | |
11576
f0906608aa63
(mh-set-mode-name): Use force-mode-line-update.
Karl Heuer <kwzh@gnu.org>
parents:
11333
diff
changeset
|
657 (force-mode-line-update t)) |
6365 | 658 |
659 | |
660 (defun mh-prompt-for-folder (prompt default can-create) | |
661 ;; Prompt for a folder name with PROMPT. Returns the folder's name as a | |
662 ;; string. DEFAULT is used if the folder exists and the user types return. | |
663 ;; If the CAN-CREATE flag is t, then a non-existent folder is made. | |
664 (if (null default) | |
665 (setq default "")) | |
666 (let* ((prompt (format "%s folder%s" prompt | |
667 (if (equal "" default) | |
668 "? " | |
669 (format " [%s]? " default)))) | |
670 read-name folder-name) | |
671 (if (null mh-folder-list) | |
672 (mh-set-folder-list)) | |
673 (while (and (setq read-name (completing-read prompt mh-folder-list | |
674 nil nil "+")) | |
675 (equal read-name "") | |
676 (equal default ""))) | |
677 (cond ((or (equal read-name "") (equal read-name "+")) | |
678 (setq read-name default)) | |
679 ((not (mh-folder-name-p read-name)) | |
680 (setq read-name (format "+%s" read-name)))) | |
681 (setq folder-name read-name) | |
682 (cond ((and (> (length folder-name) 0) | |
683 (eql (aref folder-name (1- (length folder-name))) ?/)) | |
684 (setq folder-name (substring folder-name 0 -1)))) | |
685 (let ((new-file-p (not (file-exists-p (mh-expand-file-name folder-name))))) | |
686 (cond ((and new-file-p | |
687 (y-or-n-p | |
688 (format "Folder %s does not exist. Create it? " folder-name))) | |
689 (message "Creating %s" folder-name) | |
690 (call-process "mkdir" nil nil nil (mh-expand-file-name folder-name)) | |
691 (message "Creating %s...done" folder-name) | |
11331 | 692 (setq mh-folder-list (cons (list read-name) mh-folder-list)) |
693 (run-hooks 'mh-folder-list-change-hook)) | |
6365 | 694 (new-file-p |
695 (error "Folder %s is not created" folder-name)) | |
13386
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
696 ((not (file-directory-p (mh-expand-file-name folder-name))) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
697 (error "\"%s\" is not a directory" |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
698 (mh-expand-file-name folder-name))) |
6365 | 699 ((and (null (assoc read-name mh-folder-list)) |
700 (null (assoc (concat read-name "/") mh-folder-list))) | |
11331 | 701 (setq mh-folder-list (cons (list read-name) mh-folder-list)) |
702 (run-hooks 'mh-folder-list-change-hook)))) | |
6365 | 703 folder-name)) |
704 | |
705 | |
11331 | 706 (defvar mh-make-folder-list-process nil) ;The background process collecting the folder list. |
6365 | 707 |
11331 | 708 (defvar mh-folder-list-temp nil) ;mh-folder-list as it is being built. |
6365 | 709 |
11331 | 710 (defvar mh-folder-list-partial-line "") ;Start of last incomplete line from folder process. |
6365 | 711 |
712 (defun mh-set-folder-list () | |
11331 | 713 ;; Sets mh-folder-list correctly. |
714 ;; A useful function for the command line or for when you need to | |
715 ;; sync by hand. Format is in a form suitable for completing read. | |
6365 | 716 (message "Collecting folder names...") |
717 (if (not mh-make-folder-list-process) | |
718 (mh-make-folder-list-background)) | |
719 (while (eq (process-status mh-make-folder-list-process) 'run) | |
720 (accept-process-output mh-make-folder-list-process)) | |
721 (setq mh-folder-list mh-folder-list-temp) | |
11331 | 722 (run-hooks 'mh-folder-list-change-hook) |
6365 | 723 (setq mh-folder-list-temp nil) |
724 (delete-process mh-make-folder-list-process) | |
725 (setq mh-make-folder-list-process nil) | |
726 (message "Collecting folder names...done")) | |
727 | |
728 (defun mh-make-folder-list-background () | |
11331 | 729 ;; Start a background process to compute a list of the user's folders. |
730 ;; Call mh-set-folder-list to wait for the result. | |
6365 | 731 (cond |
732 ((not mh-make-folder-list-process) | |
13386
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
733 (mh-find-path) |
6365 | 734 (let ((process-connection-type nil)) |
735 (setq mh-make-folder-list-process | |
736 (start-process "folders" nil (expand-file-name "folders" mh-progs) | |
737 "-fast" | |
738 (if mh-recursive-folders | |
739 "-recurse" | |
740 "-norecurse"))) | |
741 (set-process-filter mh-make-folder-list-process | |
742 'mh-make-folder-list-filter) | |
743 (process-kill-without-query mh-make-folder-list-process))))) | |
744 | |
745 (defun mh-make-folder-list-filter (process output) | |
746 ;; parse output from "folders -fast" | |
747 (let ((position 0) | |
13386
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
748 line-end |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
749 new-folder |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
750 (prevailing-match-data (match-data))) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
751 (unwind-protect |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
752 ;; make sure got complete line |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
753 (while (setq line-end (string-match "\n" output position)) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
754 (setq new-folder (format "+%s%s" |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
755 mh-folder-list-partial-line |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
756 (substring output position line-end))) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
757 (setq mh-folder-list-partial-line "") |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
758 ;; is new folder a subfolder of previous? |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
759 (if (and mh-folder-list-temp |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
760 (string-match |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
761 (regexp-quote |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
762 (concat (car (car mh-folder-list-temp)) "/")) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
763 new-folder)) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
764 ;; append slash to parent folder for better completion |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
765 ;; (undone by mh-prompt-for-folder) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
766 (setq mh-folder-list-temp |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
767 (cons |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
768 (list new-folder) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
769 (cons |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
770 (list (concat (car (car mh-folder-list-temp)) "/")) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
771 (cdr mh-folder-list-temp)))) |
6365 | 772 (setq mh-folder-list-temp |
773 (cons (list new-folder) | |
13386
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
774 mh-folder-list-temp))) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
775 (setq position (1+ line-end))) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
776 (store-match-data prevailing-match-data)) |
6365 | 777 (setq mh-folder-list-partial-line (substring output position)))) |
778 | |
779 | |
780 (defun mh-folder-name-p (name) | |
781 ;; Return non-NIL if NAME is possibly the name of a folder. | |
782 ;; A name (a string or symbol) can be a folder name if it begins with "+". | |
783 (if (symbolp name) | |
784 (eql (aref (symbol-name name) 0) ?+) | |
785 (and (> (length name) 0) | |
786 (eql (aref name 0) ?+)))) | |
787 | |
788 | |
789 ;;; Issue commands to MH. | |
790 | |
791 | |
792 (defun mh-exec-cmd (command &rest args) | |
793 ;; Execute mh-command COMMAND with ARGS. | |
11331 | 794 ;; The side effects are what is desired. |
6365 | 795 ;; Any output is assumed to be an error and is shown to the user. |
11331 | 796 ;; The output is not read or parsed by mh-e. |
6365 | 797 (save-excursion |
11331 | 798 (set-buffer (get-buffer-create mh-temp-buffer)) |
6365 | 799 (erase-buffer) |
800 (apply 'call-process | |
801 (expand-file-name command mh-progs) nil t nil | |
802 (mh-list-to-string args)) | |
803 (if (> (buffer-size) 0) | |
804 (save-window-excursion | |
11331 | 805 (switch-to-buffer-other-window mh-temp-buffer) |
6365 | 806 (sit-for 5))))) |
807 | |
808 | |
809 (defun mh-exec-cmd-error (env command &rest args) | |
810 ;; In environment ENV, execute mh-command COMMAND with args ARGS. | |
811 ;; ENV is nil or a string of space-separated "var=value" elements. | |
812 ;; Signals an error if process does not complete successfully. | |
813 (save-excursion | |
11331 | 814 (set-buffer (get-buffer-create mh-temp-buffer)) |
6365 | 815 (erase-buffer) |
816 (let ((status | |
817 (if env | |
818 ;; the shell hacks necessary here shows just how broken Unix is | |
819 (apply 'call-process "/bin/sh" nil t nil "-c" | |
820 (format "%s %s ${1+\"$@\"}" | |
821 env | |
822 (expand-file-name command mh-progs)) | |
823 command | |
824 (mh-list-to-string args)) | |
825 (apply 'call-process | |
826 (expand-file-name command mh-progs) nil t nil | |
827 (mh-list-to-string args))))) | |
828 (mh-handle-process-error command status)))) | |
829 | |
830 | |
831 (defun mh-exec-cmd-daemon (command &rest args) | |
11331 | 832 ;; Execute MH command COMMAND with ARGS in the background. |
833 ;; Any output from command is displayed in an asynchronous pop-up window. | |
6365 | 834 (save-excursion |
11331 | 835 (set-buffer (get-buffer-create mh-temp-buffer)) |
6365 | 836 (erase-buffer)) |
837 (let* ((process-connection-type nil) | |
838 (process (apply 'start-process | |
839 command nil | |
840 (expand-file-name command mh-progs) | |
841 (mh-list-to-string args)))) | |
842 (set-process-filter process 'mh-process-daemon))) | |
843 | |
844 (defun mh-process-daemon (process output) | |
845 ;; Process daemon that puts output into a temporary buffer. | |
11331 | 846 (set-buffer (get-buffer-create mh-temp-buffer)) |
6365 | 847 (insert-before-markers output) |
11331 | 848 (display-buffer mh-temp-buffer)) |
6365 | 849 |
850 | |
851 (defun mh-exec-cmd-quiet (raise-error command &rest args) | |
852 ;; Args are RAISE-ERROR, COMMANDS, ARGS.... | |
853 ;; Execute MH command COMMAND with ARGS. ARGS is a list of strings. | |
854 ;; Return at start of mh-temp buffer, where output can be parsed and used. | |
855 ;; Returns value of call-process, which is 0 for success, | |
856 ;; unless RAISE-ERROR is non-nil, in which case an error is signaled | |
857 ;; if call-process returns non-0. | |
11331 | 858 (set-buffer (get-buffer-create mh-temp-buffer)) |
6365 | 859 (erase-buffer) |
860 (let ((value | |
861 (apply 'call-process | |
862 (expand-file-name command mh-progs) nil t nil | |
863 args))) | |
864 (goto-char (point-min)) | |
865 (if raise-error | |
866 (mh-handle-process-error command value) | |
867 value))) | |
868 | |
869 | |
870 (defun mh-exec-cmd-output (command display &rest args) | |
871 ;; Execute MH command COMMAND with DISPLAY flag and ARGS. | |
872 ;; Put the output into buffer after point. Set mark after inserted text. | |
11331 | 873 ;; Output is expected to be shown to user, not parsed by mh-e. |
6365 | 874 (push-mark (point) t) |
875 (apply 'call-process | |
876 (expand-file-name command mh-progs) nil t display | |
877 (mh-list-to-string args)) | |
878 (exchange-point-and-mark)) | |
879 | |
880 | |
881 (defun mh-exec-lib-cmd-output (command &rest args) | |
882 ;; Execute MH library command COMMAND with ARGS. | |
883 ;; Put the output into buffer after point. Set mark after inserted text. | |
884 (apply 'mh-exec-cmd-output (expand-file-name command mh-lib) nil args)) | |
885 | |
886 | |
887 (defun mh-handle-process-error (command status) | |
888 ;; Raise error if COMMAND returned non-0 STATUS, otherwise return STATUS. | |
889 ;; STATUS is return value from call-process. | |
890 ;; Program output is in current buffer. | |
11331 | 891 ;; If output is too long to include in error message, display the buffer. |
6365 | 892 (cond ((eql status 0) ;success |
893 status) | |
894 ((stringp status) ;kill string | |
895 (error (format "%s: %s" command status))) | |
896 (t ;exit code | |
897 (cond | |
898 ((= (buffer-size) 0) ;program produced no error message | |
899 (error (format "%s: exit code %d" command status))) | |
900 (t | |
901 ;; will error message fit on one line? | |
902 (goto-line 2) | |
903 (if (and (< (buffer-size) (screen-width)) | |
904 (eobp)) | |
905 (error (buffer-substring 1 (progn (goto-char 1) | |
906 (end-of-line) | |
907 (point)))) | |
908 (display-buffer (current-buffer)) | |
909 (error (format | |
910 "%s failed with status %d. See error message in other window." | |
911 command status)))))))) | |
912 | |
913 | |
914 (defun mh-expand-file-name (filename &optional default) | |
11331 | 915 ;; Just like `expand-file-name', but also handles MH folder names. |
916 ;; Assumes that any filename that starts with '+' is a folder name. | |
6365 | 917 (if (mh-folder-name-p filename) |
918 (expand-file-name (substring filename 1) mh-user-path) | |
919 (expand-file-name filename default))) | |
920 | |
921 | |
922 (defun mh-list-to-string (l) | |
923 ;; Flattens the list L and makes every element of the new list into a string. | |
924 (nreverse (mh-list-to-string-1 l))) | |
925 | |
926 (defun mh-list-to-string-1 (l) | |
927 (let ((new-list nil)) | |
928 (while l | |
929 (cond ((null (car l))) | |
930 ((symbolp (car l)) | |
931 (setq new-list (cons (symbol-name (car l)) new-list))) | |
932 ((numberp (car l)) | |
933 (setq new-list (cons (int-to-string (car l)) new-list))) | |
934 ((equal (car l) "")) | |
935 ((stringp (car l)) (setq new-list (cons (car l) new-list))) | |
936 ((listp (car l)) | |
937 (setq new-list (nconc (mh-list-to-string-1 (car l)) | |
938 new-list))) | |
939 (t (error "Bad element in mh-list-to-string: %s" (car l)))) | |
940 (setq l (cdr l))) | |
941 new-list)) | |
942 | |
943 (provide 'mh-utils) | |
944 | |
945 (and (not noninteractive) | |
946 mh-auto-folder-collect | |
13386
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
947 (let ((mh-no-install t)) ;only get folders if MH installed |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
948 (condition-case err |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
949 (mh-make-folder-list-background) |
78c7ebcbd9fe
(mh-goto-msg): binary search (much faster!).
Karl Heuer <kwzh@gnu.org>
parents:
11576
diff
changeset
|
950 (file-error)))) ;so don't complain if not installed |
6365 | 951 |
952 ;;; mh-utils.el ends here |