Mercurial > emacs
annotate lisp/mh-e/mh-utils.el @ 69195:477ba8c8d22c
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-126
Merge from gnus--rel--5.10
Patches applied:
* gnus--rel--5.10 (patch 40-42)
- Merge from emacs--devo--0
- Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Tue, 28 Feb 2006 00:38:35 +0000 |
parents | 18babada4b1e |
children | 16877a343711 d1c5430c5bff |
rev | line source |
---|---|
68465 | 1 ;;; mh-utils.el --- MH-E general utilities |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2 |
62847
aa8c2e12ee24
Upgraded to MH-E version 7.84.
Bill Wohler <wohler@newt.com>
parents:
62767
diff
changeset
|
3 ;; Copyright (C) 1993, 1995, 1997, |
67988
7882fc7df359
* mh-alias.el (mh-alias-grab-from-field): Remove leading * from
Bill Wohler <wohler@newt.com>
parents:
67969
diff
changeset
|
4 ;; 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
5 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
6 ;; Author: Bill Wohler <wohler@newt.com> |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
7 ;; Maintainer: Bill Wohler <wohler@newt.com> |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
8 ;; Keywords: mail |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
9 ;; See: mh-e.el |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
10 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
11 ;; This file is part of GNU Emacs. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
12 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
13 ;; GNU Emacs is free software; you can redistribute it and/or modify |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
14 ;; it under the terms of the GNU General Public License as published by |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
15 ;; the Free Software Foundation; either version 2, or (at your option) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
16 ;; any later version. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
17 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
18 ;; GNU Emacs is distributed in the hope that it will be useful, |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
21 ;; GNU General Public License for more details. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
22 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
23 ;; You should have received a copy of the GNU General Public License |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
64085 | 25 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
26 ;; Boston, MA 02110-1301, USA. | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
27 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
28 ;;; Commentary: |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
29 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
30 ;;; Change Log: |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
31 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
32 ;;; Code: |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
33 |
68465 | 34 (require 'mh-e) |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
35 (mh-require-cl) |
68096
57c4e7929f99
* mh-alias.el (mh-alias-gecos-name): Use replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents:
68013
diff
changeset
|
36 |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
37 (require 'font-lock) |
67681 | 38 |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
39 ;;; CL Replacements |
67681 | 40 |
68465 | 41 ;;;###mh-autoload |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
42 (defun mh-search-from-end (char string) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
43 "Return the position of last occurrence of CHAR in STRING. |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
44 If CHAR is not present in STRING then return nil. The function is |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
45 used in lieu of `search' in the CL package." |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
46 (loop for index from (1- (length string)) downto 0 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
47 when (equal (aref string index) char) return index |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
48 finally return nil)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
49 |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
50 |
67681 | 51 |
68465 | 52 ;;; General Utilities |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
53 |
68465 | 54 ;;;###mh-autoload |
55 (defun mh-beginning-of-word (&optional n) | |
56 "Return position of the N th word backwards." | |
57 (unless n (setq n 1)) | |
58 (let ((syntax-table (syntax-table))) | |
59 (unwind-protect | |
60 (save-excursion | |
68520
6a7173abcf59
* mh-acros.el (mh-defun-compat, mh-defmacro-compat): Add name argument
Bill Wohler <wohler@newt.com>
parents:
68477
diff
changeset
|
61 (mh-mail-abbrev-make-syntax-table) |
68465 | 62 (set-syntax-table mail-abbrev-syntax-table) |
63 (backward-word n) | |
64 (point)) | |
65 (set-syntax-table syntax-table)))) | |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
66 |
68465 | 67 ;;;###mh-autoload |
68 (defun mh-colors-available-p () | |
69 "Check if colors are available in the Emacs being used." | |
70 (or mh-xemacs-flag | |
68529
7daec5f4a289
* mh-alias.el (mh-alias-gecos-name): Use mh-replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents:
68520
diff
changeset
|
71 (let ((color-cells (mh-display-color-cells))) |
68465 | 72 (and (numberp color-cells) (>= color-cells 8))))) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
73 |
68465 | 74 ;;;###mh-autoload |
75 (defun mh-colors-in-use-p () | |
76 "Check if colors are being used in the folder buffer." | |
77 (and mh-colors-available-flag font-lock-mode)) | |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
78 |
68465 | 79 ;;;###mh-autoload |
80 (defun mh-delete-line (lines) | |
81 "Delete the next LINES lines." | |
82 (delete-region (point) (progn (forward-line lines) (point)))) | |
83 | |
68598
164eb9d4f124
(mh-image-load-path): New variable to optionally hold the directory where
Peter Galbraith <galbraith@mixing.qc.dfo.ca>
parents:
68529
diff
changeset
|
84 (defvar mh-image-load-path nil |
164eb9d4f124
(mh-image-load-path): New variable to optionally hold the directory where
Peter Galbraith <galbraith@mixing.qc.dfo.ca>
parents:
68529
diff
changeset
|
85 "Directory where images for MH-E are found. |
68602
cad657a1f438
(mh-image-load-path, mh-image-load-path-called-flag)
Bill Wohler <wohler@newt.com>
parents:
68598
diff
changeset
|
86 If nil, then the function `mh-image-load-path' will search for |
cad657a1f438
(mh-image-load-path, mh-image-load-path-called-flag)
Bill Wohler <wohler@newt.com>
parents:
68598
diff
changeset
|
87 the images in \"../../etc/images\" relative to the files in |
cad657a1f438
(mh-image-load-path, mh-image-load-path-called-flag)
Bill Wohler <wohler@newt.com>
parents:
68598
diff
changeset
|
88 \"lisp/mh-e\".") |
68598
164eb9d4f124
(mh-image-load-path): New variable to optionally hold the directory where
Peter Galbraith <galbraith@mixing.qc.dfo.ca>
parents:
68529
diff
changeset
|
89 |
68602
cad657a1f438
(mh-image-load-path, mh-image-load-path-called-flag)
Bill Wohler <wohler@newt.com>
parents:
68598
diff
changeset
|
90 (defvar mh-image-load-path-called-flag nil |
cad657a1f438
(mh-image-load-path, mh-image-load-path-called-flag)
Bill Wohler <wohler@newt.com>
parents:
68598
diff
changeset
|
91 "Non-nil means that the function `mh-image-load-path' has been called. |
cad657a1f438
(mh-image-load-path, mh-image-load-path-called-flag)
Bill Wohler <wohler@newt.com>
parents:
68598
diff
changeset
|
92 This variable is used by that function to avoid doing the work repeatedly.") |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
93 |
68465 | 94 ;;;###mh-autoload |
95 (defun mh-image-load-path () | |
96 "Ensure that the MH-E images are accessible by `find-image'. | |
68602
cad657a1f438
(mh-image-load-path, mh-image-load-path-called-flag)
Bill Wohler <wohler@newt.com>
parents:
68598
diff
changeset
|
97 |
cad657a1f438
(mh-image-load-path, mh-image-load-path-called-flag)
Bill Wohler <wohler@newt.com>
parents:
68598
diff
changeset
|
98 Images for MH-E are found in \"../../etc/images\" relative to the |
68936
133a58334c29
(mh-image-load-path): The variables image-load-path or load-path would
Bill Wohler <wohler@newt.com>
parents:
68929
diff
changeset
|
99 files in \"lisp/mh-e\", in `image-load-path', or in `load-path'. |
133a58334c29
(mh-image-load-path): The variables image-load-path or load-path would
Bill Wohler <wohler@newt.com>
parents:
68929
diff
changeset
|
100 This function saves the actual location found in the variable |
133a58334c29
(mh-image-load-path): The variables image-load-path or load-path would
Bill Wohler <wohler@newt.com>
parents:
68929
diff
changeset
|
101 `mh-image-load-path'. If the images on your system are actually |
133a58334c29
(mh-image-load-path): The variables image-load-path or load-path would
Bill Wohler <wohler@newt.com>
parents:
68929
diff
changeset
|
102 located elsewhere, then set the variable `mh-image-load-path' |
133a58334c29
(mh-image-load-path): The variables image-load-path or load-path would
Bill Wohler <wohler@newt.com>
parents:
68929
diff
changeset
|
103 before starting MH-E. |
68602
cad657a1f438
(mh-image-load-path, mh-image-load-path-called-flag)
Bill Wohler <wohler@newt.com>
parents:
68598
diff
changeset
|
104 |
cad657a1f438
(mh-image-load-path, mh-image-load-path-called-flag)
Bill Wohler <wohler@newt.com>
parents:
68598
diff
changeset
|
105 If `image-load-path' exists (since Emacs 22), then the contents |
cad657a1f438
(mh-image-load-path, mh-image-load-path-called-flag)
Bill Wohler <wohler@newt.com>
parents:
68598
diff
changeset
|
106 of the variable `mh-image-load-path' is added to it if isn't |
cad657a1f438
(mh-image-load-path, mh-image-load-path-called-flag)
Bill Wohler <wohler@newt.com>
parents:
68598
diff
changeset
|
107 already there. Otherwise, the contents of the variable |
cad657a1f438
(mh-image-load-path, mh-image-load-path-called-flag)
Bill Wohler <wohler@newt.com>
parents:
68598
diff
changeset
|
108 `mh-image-load-path' is added to the `load-path' if it isn't |
cad657a1f438
(mh-image-load-path, mh-image-load-path-called-flag)
Bill Wohler <wohler@newt.com>
parents:
68598
diff
changeset
|
109 already there. |
cad657a1f438
(mh-image-load-path, mh-image-load-path-called-flag)
Bill Wohler <wohler@newt.com>
parents:
68598
diff
changeset
|
110 |
cad657a1f438
(mh-image-load-path, mh-image-load-path-called-flag)
Bill Wohler <wohler@newt.com>
parents:
68598
diff
changeset
|
111 See also variable `mh-image-load-path-called-flag'." |
68465 | 112 (unless mh-image-load-path-called-flag |
68929
3f537f106072
mh-compat.el (mh-image-search-load-path): Compatibility code. Emacs 21 and
Peter Galbraith <galbraith@mixing.qc.dfo.ca>
parents:
68750
diff
changeset
|
113 (cond |
68975
90801dac7d88
(mh-image-load-path): Fix problem that images on load-path or
Bill Wohler <wohler@newt.com>
parents:
68936
diff
changeset
|
114 (mh-image-load-path) ; user setting exists |
90801dac7d88
(mh-image-load-path): Fix problem that images on load-path or
Bill Wohler <wohler@newt.com>
parents:
68936
diff
changeset
|
115 ((let (mh-library-name) ; try relative setting |
68929
3f537f106072
mh-compat.el (mh-image-search-load-path): Compatibility code. Emacs 21 and
Peter Galbraith <galbraith@mixing.qc.dfo.ca>
parents:
68750
diff
changeset
|
116 ;; First, find mh-e in the load-path. |
3f537f106072
mh-compat.el (mh-image-search-load-path): Compatibility code. Emacs 21 and
Peter Galbraith <galbraith@mixing.qc.dfo.ca>
parents:
68750
diff
changeset
|
117 (setq mh-library-name (locate-library "mh-e")) |
3f537f106072
mh-compat.el (mh-image-search-load-path): Compatibility code. Emacs 21 and
Peter Galbraith <galbraith@mixing.qc.dfo.ca>
parents:
68750
diff
changeset
|
118 (if (not mh-library-name) |
3f537f106072
mh-compat.el (mh-image-search-load-path): Compatibility code. Emacs 21 and
Peter Galbraith <galbraith@mixing.qc.dfo.ca>
parents:
68750
diff
changeset
|
119 (error "Can not find MH-E in load-path")) |
68936
133a58334c29
(mh-image-load-path): The variables image-load-path or load-path would
Bill Wohler <wohler@newt.com>
parents:
68929
diff
changeset
|
120 ;; And then set mh-image-load-path relative to that. |
68929
3f537f106072
mh-compat.el (mh-image-search-load-path): Compatibility code. Emacs 21 and
Peter Galbraith <galbraith@mixing.qc.dfo.ca>
parents:
68750
diff
changeset
|
121 (setq mh-image-load-path |
3f537f106072
mh-compat.el (mh-image-search-load-path): Compatibility code. Emacs 21 and
Peter Galbraith <galbraith@mixing.qc.dfo.ca>
parents:
68750
diff
changeset
|
122 (expand-file-name (concat |
3f537f106072
mh-compat.el (mh-image-search-load-path): Compatibility code. Emacs 21 and
Peter Galbraith <galbraith@mixing.qc.dfo.ca>
parents:
68750
diff
changeset
|
123 (file-name-directory mh-library-name) |
68975
90801dac7d88
(mh-image-load-path): Fix problem that images on load-path or
Bill Wohler <wohler@newt.com>
parents:
68936
diff
changeset
|
124 "../../etc/images"))) |
90801dac7d88
(mh-image-load-path): Fix problem that images on load-path or
Bill Wohler <wohler@newt.com>
parents:
68936
diff
changeset
|
125 (file-exists-p (expand-file-name "mh-logo.xpm" mh-image-load-path)))) |
90801dac7d88
(mh-image-load-path): Fix problem that images on load-path or
Bill Wohler <wohler@newt.com>
parents:
68936
diff
changeset
|
126 ((mh-image-search-load-path "mh-logo.xpm") |
90801dac7d88
(mh-image-load-path): Fix problem that images on load-path or
Bill Wohler <wohler@newt.com>
parents:
68936
diff
changeset
|
127 ;; Images in image-load-path. |
90801dac7d88
(mh-image-load-path): Fix problem that images on load-path or
Bill Wohler <wohler@newt.com>
parents:
68936
diff
changeset
|
128 (setq mh-image-load-path |
90801dac7d88
(mh-image-load-path): Fix problem that images on load-path or
Bill Wohler <wohler@newt.com>
parents:
68936
diff
changeset
|
129 (file-name-directory (mh-image-search-load-path "mh-logo.xpm")))) |
90801dac7d88
(mh-image-load-path): Fix problem that images on load-path or
Bill Wohler <wohler@newt.com>
parents:
68936
diff
changeset
|
130 ((locate-library "mh-logo.xpm") |
90801dac7d88
(mh-image-load-path): Fix problem that images on load-path or
Bill Wohler <wohler@newt.com>
parents:
68936
diff
changeset
|
131 ;; Images in load-path. |
90801dac7d88
(mh-image-load-path): Fix problem that images on load-path or
Bill Wohler <wohler@newt.com>
parents:
68936
diff
changeset
|
132 (setq mh-image-load-path |
90801dac7d88
(mh-image-load-path): Fix problem that images on load-path or
Bill Wohler <wohler@newt.com>
parents:
68936
diff
changeset
|
133 (file-name-directory (locate-library "mh-logo.xpm"))))) |
68986
18babada4b1e
Remove trailing whitespace (checkdoc fix).
Bill Wohler <wohler@newt.com>
parents:
68975
diff
changeset
|
134 |
68936
133a58334c29
(mh-image-load-path): The variables image-load-path or load-path would
Bill Wohler <wohler@newt.com>
parents:
68929
diff
changeset
|
135 (if (not (file-exists-p mh-image-load-path)) |
133a58334c29
(mh-image-load-path): The variables image-load-path or load-path would
Bill Wohler <wohler@newt.com>
parents:
68929
diff
changeset
|
136 (error "Directory %s in mh-image-load-path does not exist" |
133a58334c29
(mh-image-load-path): The variables image-load-path or load-path would
Bill Wohler <wohler@newt.com>
parents:
68929
diff
changeset
|
137 mh-image-load-path)) |
133a58334c29
(mh-image-load-path): The variables image-load-path or load-path would
Bill Wohler <wohler@newt.com>
parents:
68929
diff
changeset
|
138 (if (not (file-exists-p |
133a58334c29
(mh-image-load-path): The variables image-load-path or load-path would
Bill Wohler <wohler@newt.com>
parents:
68929
diff
changeset
|
139 (expand-file-name "mh-logo.xpm" mh-image-load-path))) |
133a58334c29
(mh-image-load-path): The variables image-load-path or load-path would
Bill Wohler <wohler@newt.com>
parents:
68929
diff
changeset
|
140 (error "Directory %s in mh-image-load-path does not contain MH-E images" |
133a58334c29
(mh-image-load-path): The variables image-load-path or load-path would
Bill Wohler <wohler@newt.com>
parents:
68929
diff
changeset
|
141 mh-image-load-path)) |
133a58334c29
(mh-image-load-path): The variables image-load-path or load-path would
Bill Wohler <wohler@newt.com>
parents:
68929
diff
changeset
|
142 (if (boundp 'image-load-path) |
133a58334c29
(mh-image-load-path): The variables image-load-path or load-path would
Bill Wohler <wohler@newt.com>
parents:
68929
diff
changeset
|
143 (add-to-list 'image-load-path mh-image-load-path) |
133a58334c29
(mh-image-load-path): The variables image-load-path or load-path would
Bill Wohler <wohler@newt.com>
parents:
68929
diff
changeset
|
144 (add-to-list 'load-path mh-image-load-path)) |
133a58334c29
(mh-image-load-path): The variables image-load-path or load-path would
Bill Wohler <wohler@newt.com>
parents:
68929
diff
changeset
|
145 |
68465 | 146 (setq mh-image-load-path-called-flag t))) |
66477
117f8e71b37a
* mh-customize.el (mh-adaptive-cmd-note-flag)
Bill Wohler <wohler@newt.com>
parents:
66354
diff
changeset
|
147 |
68465 | 148 ;;;###mh-autoload |
149 (defun mh-make-local-vars (&rest pairs) | |
150 "Initialize local variables according to the variable-value PAIRS." | |
151 (while pairs | |
152 (set (make-local-variable (car pairs)) (car (cdr pairs))) | |
153 (setq pairs (cdr (cdr pairs))))) | |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
154 |
68465 | 155 ;;;###mh-autoload |
156 (defun mh-mapc (function list) | |
157 "Apply FUNCTION to each element of LIST for side effects only." | |
158 (while list | |
159 (funcall function (car list)) | |
160 (setq list (cdr list)))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
161 |
68465 | 162 ;;;###mh-autoload |
163 (defun mh-replace-string (old new) | |
164 "Replace all occurrences of OLD with NEW in the current buffer. | |
165 Ignores case when searching for OLD." | |
166 (goto-char (point-min)) | |
167 (let ((case-fold-search t)) | |
168 (while (search-forward old nil t) | |
169 (replace-match new t t)))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
170 |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
171 |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
172 |
68465 | 173 ;;; Logo Display |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
174 |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
175 (defvar mh-logo-cache nil) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
176 |
68465 | 177 ;;;###mh-autoload |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
178 (defun mh-logo-display () |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
179 "Modify mode line to display MH-E logo." |
68465 | 180 (mh-image-load-path) |
50702
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
181 (mh-do-in-gnu-emacs |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
182 (add-text-properties |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
183 0 2 |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
184 `(display ,(or mh-logo-cache |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
185 (setq mh-logo-cache |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
186 (mh-funcall-if-exists |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
187 find-image '((:type xpm :ascent center |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
188 :file "mh-logo.xpm")))))) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
189 (car mode-line-buffer-identification))) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
190 (mh-do-in-xemacs |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
191 (setq modeline-buffer-identification |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
192 (list |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
193 (if mh-modeline-glyph |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
194 (cons modeline-buffer-id-left-extent mh-modeline-glyph) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
195 (cons modeline-buffer-id-left-extent "XEmacs%N:")) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
196 (cons modeline-buffer-id-right-extent " %17b"))))) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
197 |
68465 | 198 |
199 | |
200 ;;; Read MH Profile | |
201 | |
202 (defvar mh-find-path-run nil | |
203 "Non-nil if `mh-find-path' has been run already. | |
204 Do not access this variable; `mh-find-path' already uses it to | |
205 avoid running more than once.") | |
67756
7ff92ad99326
* mh-alias.el (mh-alias-reload): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents:
67681
diff
changeset
|
206 |
68465 | 207 ;;;###mh-autoload |
208 (defun mh-find-path () | |
209 "Set variables from user's MH profile. | |
210 | |
211 This function sets `mh-user-path' from your \"Path:\" MH profile | |
212 component (but defaults to \"Mail\" if one isn't present), | |
213 `mh-draft-folder' from \"Draft-Folder:\", `mh-unseen-seq' from | |
214 \"Unseen-Sequence:\", `mh-previous-seq' from | |
215 \"Previous-Sequence:\", and `mh-inbox' from \"Inbox:\" (defaults | |
216 to \"+inbox\"). | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
217 |
68465 | 218 The hook `mh-find-path-hook' is run after these variables have |
219 been set. This hook can be used the change the value of these | |
220 variables if you need to run with different values between MH and | |
221 MH-E." | |
222 (unless mh-find-path-run | |
223 ;; Sanity checks. | |
224 (if (and (getenv "MH") | |
225 (not (file-readable-p (getenv "MH")))) | |
226 (error "MH environment variable contains unreadable file %s" | |
227 (getenv "MH"))) | |
228 (if (null (mh-variants)) | |
229 (error "Install MH and run install-mh before running MH-E")) | |
230 (let ((profile "~/.mh_profile")) | |
231 (if (not (file-readable-p profile)) | |
232 (error "Run install-mh before running MH-E"))) | |
233 ;; Read MH profile. | |
234 (setq mh-user-path (mh-profile-component "Path")) | |
235 (if (not mh-user-path) | |
236 (setq mh-user-path "Mail")) | |
237 (setq mh-user-path | |
238 (file-name-as-directory | |
239 (expand-file-name mh-user-path (expand-file-name "~")))) | |
240 (mh-set-x-image-cache-directory (expand-file-name ".mhe-x-image-cache" | |
241 mh-user-path)) | |
242 (setq mh-draft-folder (mh-profile-component "Draft-Folder")) | |
243 (if mh-draft-folder | |
244 (progn | |
245 (if (not (mh-folder-name-p mh-draft-folder)) | |
246 (setq mh-draft-folder (format "+%s" mh-draft-folder))) | |
247 (if (not (file-exists-p (mh-expand-file-name mh-draft-folder))) | |
248 (error | |
249 "Draft folder \"%s\" not found; create it and try again" | |
250 (mh-expand-file-name mh-draft-folder))))) | |
251 (setq mh-inbox (mh-profile-component "Inbox")) | |
252 (cond ((not mh-inbox) | |
253 (setq mh-inbox "+inbox")) | |
254 ((not (mh-folder-name-p mh-inbox)) | |
255 (setq mh-inbox (format "+%s" mh-inbox)))) | |
256 (setq mh-unseen-seq (mh-profile-component "Unseen-Sequence")) | |
257 (if mh-unseen-seq | |
258 (setq mh-unseen-seq (intern mh-unseen-seq)) | |
259 (setq mh-unseen-seq 'unseen)) ;old MH default? | |
260 (setq mh-previous-seq (mh-profile-component "Previous-Sequence")) | |
261 (if mh-previous-seq | |
262 (setq mh-previous-seq (intern mh-previous-seq))) | |
263 (run-hooks 'mh-find-path-hook) | |
264 (mh-collect-folder-names) | |
265 (setq mh-find-path-run t))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
266 |
67681 | 267 |
268 | |
68465 | 269 ;;; Help Functions |
270 | |
271 ;;;###mh-autoload | |
272 (defun mh-ephem-message (string) | |
273 "Display STRING in the minibuffer momentarily." | |
274 (message "%s" string) | |
275 (sit-for 5) | |
276 (message "")) | |
277 | |
278 (defvar mh-help-default nil | |
279 "Mode to use if messages are not present for the current mode.") | |
280 | |
281 (defvar mh-help-messages nil | |
282 "Help messages for all modes. | |
283 This is an alist of alists. The primary key is a symbol | |
284 representing the mode; the value is described in `mh-set-help'.") | |
285 | |
286 ;;;###mh-autoload | |
287 (defun mh-set-help (messages &optional default) | |
288 "Set help messages. | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
289 |
68465 | 290 The MESSAGES are assumed to be an associative array. It is used |
291 to show help for the most common commands in the current mode. | |
292 The key is a prefix char. The value is one or more strings which | |
293 are concatenated together and displayed in a help buffer if ? is | |
294 pressed after the prefix character. The special key nil is used | |
295 to display the non-prefixed commands. | |
296 | |
297 The substitutions described in `substitute-command-keys' are performed as | |
298 well. | |
299 | |
300 If optional argument DEFAULT is non-nil, then these messages will | |
301 be used if help is asked for an unknown mode." | |
302 (add-to-list 'mh-help-messages (cons major-mode messages)) | |
303 (if default | |
304 (setq mh-help-default major-mode))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
305 |
68465 | 306 ;;;###mh-autoload |
307 (defun mh-help (&optional help-messages) | |
308 "Display cheat sheet for the MH-E commands. | |
309 See `mh-set-help' for setting the help messages. | |
310 HELP-MESSAGES are used instead if given. | |
311 This is a list of one or more strings which are concatenated together | |
312 and displayed in a help buffer." | |
313 (interactive) | |
314 (let* ((help (or help-messages | |
315 (cdr (assoc nil (assoc major-mode mh-help-messages))))) | |
316 (text (substitute-command-keys (mapconcat 'identity help "")))) | |
317 (with-electric-help | |
318 (function | |
319 (lambda () | |
320 (insert text))) | |
321 mh-help-buffer))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
322 |
68465 | 323 ;;;###mh-autoload |
324 (defun mh-prefix-help () | |
325 "Display cheat sheet for the commands of the current prefix in minibuffer." | |
326 (interactive) | |
327 ;; We got here because the user pressed a "?", but he pressed a prefix key | |
328 ;; before that. Since the the key vector starts at index 0, the index of the | |
329 ;; last keystroke is length-1 and thus the second to last keystroke is at | |
330 ;; length-2. We use that information to obtain a suitable prefix character | |
331 ;; from the recent keys. | |
332 (let* ((keys (recent-keys)) | |
333 (prefix-char (elt keys (- (length keys) 2))) | |
334 (help (cdr (assoc prefix-char (assoc major-mode mh-help-messages))))) | |
335 (mh-help help))) | |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
336 |
68465 | 337 |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
338 |
68465 | 339 ;;; Message Number Utilities |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
340 |
68465 | 341 ;;;###mh-autoload |
342 (defun mh-coalesce-msg-list (messages) | |
343 "Given a list of MESSAGES, return a list of message number ranges. | |
344 This is the inverse of `mh-read-msg-list', which expands ranges. | |
345 Message lists passed to MH programs should be processed by this | |
346 function to avoid exceeding system command line argument limits." | |
347 (let ((msgs (sort (copy-sequence messages) 'mh-greaterp)) | |
348 (range-high nil) | |
349 (prev -1) | |
350 (ranges nil)) | |
351 (while prev | |
352 (if range-high | |
353 (if (or (not (numberp prev)) | |
354 (not (equal (car msgs) (1- prev)))) | |
355 (progn ;non-sequential, flush old range | |
356 (if (eq prev range-high) | |
357 (setq ranges (cons range-high ranges)) | |
358 (setq ranges (cons (format "%s-%s" prev range-high) ranges))) | |
359 (setq range-high nil)))) | |
360 (or range-high | |
361 (setq range-high (car msgs))) ;start new or first range | |
362 (setq prev (car msgs)) | |
363 (setq msgs (cdr msgs))) | |
364 ranges)) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
365 |
68465 | 366 (defun mh-greaterp (msg1 msg2) |
367 "Return the greater of two message indicators MSG1 and MSG2. | |
368 Strings are \"smaller\" than numbers. | |
369 Valid values are things like \"cur\", \"last\", 1, and 1820." | |
370 (if (numberp msg1) | |
371 (if (numberp msg2) | |
372 (> msg1 msg2) | |
373 t) | |
374 (if (numberp msg2) | |
375 nil | |
376 (string-lessp msg2 msg1)))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
377 |
68465 | 378 ;;;###mh-autoload |
379 (defun mh-lessp (msg1 msg2) | |
380 "Return the lesser of two message indicators MSG1 and MSG2. | |
381 Strings are \"smaller\" than numbers. | |
382 Valid values are things like \"cur\", \"last\", 1, and 1820." | |
383 (not (mh-greaterp msg1 msg2))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
384 |
68465 | 385 ;;;###mh-autoload |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
386 (defun mh-get-msg-num (error-if-no-message) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
387 "Return the message number of the displayed message. |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
388 If the argument ERROR-IF-NO-MESSAGE is non-nil, then complain if |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
389 the cursor is not pointing to a message." |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
390 (save-excursion |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
391 (beginning-of-line) |
68465 | 392 (cond ((looking-at (mh-scan-msg-number-regexp)) |
62847
aa8c2e12ee24
Upgraded to MH-E version 7.84.
Bill Wohler <wohler@newt.com>
parents:
62767
diff
changeset
|
393 (string-to-number (buffer-substring (match-beginning 1) |
aa8c2e12ee24
Upgraded to MH-E version 7.84.
Bill Wohler <wohler@newt.com>
parents:
62767
diff
changeset
|
394 (match-end 1)))) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
395 (error-if-no-message |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
396 (error "Cursor not pointing to message")) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
397 (t nil)))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
398 |
68465 | 399 (add-to-list 'debug-ignored-errors "^Cursor not pointing to message$") |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
400 |
50702
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
401 |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
402 |
68465 | 403 ;;; Folder Cache and Access |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
404 |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
405 (defvar mh-sub-folders-cache (make-hash-table :test #'equal)) |
50702
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
406 (defvar mh-current-folder-name nil) |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
407 (defvar mh-flists-partial-line "") |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
408 (defvar mh-flists-process nil) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
409 |
68465 | 410 ;;;###mh-autoload |
411 (defun mh-clear-sub-folders-cache () | |
412 "Clear `mh-sub-folders-cache'." | |
413 (clrhash mh-sub-folders-cache)) | |
414 | |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
415 ;; Initialize mh-sub-folders-cache... |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
416 (defun mh-collect-folder-names () |
68188
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
417 "Collect folder names by running \"folders\"." |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
418 (unless mh-flists-process |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
419 (setq mh-flists-process |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
420 (mh-exec-cmd-daemon "folders" 'mh-collect-folder-names-filter |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
421 "-recurse" "-fast")))) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
422 |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
423 (defun mh-collect-folder-names-filter (process output) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
424 "Read folder names. |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
425 PROCESS is the flists process that was run to collect folder |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
426 names and the function is called when OUTPUT is available." |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
427 (let ((position 0) |
68465 | 428 (prevailing-match-data (match-data)) |
429 line-end folder) | |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
430 (unwind-protect |
68465 | 431 (while (setq line-end (string-match "\n" output position)) |
432 (setq folder (format "+%s%s" | |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
433 mh-flists-partial-line |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
434 (substring output position line-end))) |
68465 | 435 (setq mh-flists-partial-line "") |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
436 (unless (equal (aref folder 1) ?.) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
437 (mh-populate-sub-folders-cache folder)) |
68465 | 438 (setq position (1+ line-end))) |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
439 (set-match-data prevailing-match-data)) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
440 (setq mh-flists-partial-line (substring output position)))) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
441 |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
442 (defun mh-populate-sub-folders-cache (folder) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
443 "Tell `mh-sub-folders-cache' about FOLDER." |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
444 (let* ((last-slash (mh-search-from-end ?/ folder)) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
445 (child1 (substring folder (1+ (or last-slash 0)))) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
446 (parent (and last-slash (substring folder 0 last-slash))) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
447 (parent-slash (and parent (mh-search-from-end ?/ parent))) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
448 (child2 (and parent (substring parent (1+ (or parent-slash 0))))) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
449 (grand-parent (and parent-slash (substring parent 0 parent-slash))) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
450 (cache-entry (gethash parent mh-sub-folders-cache))) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
451 (unless (loop for x in cache-entry when (equal (car x) child1) return t |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
452 finally return nil) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
453 (push (list child1) cache-entry) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
454 (setf (gethash parent mh-sub-folders-cache) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
455 (sort cache-entry (lambda (x y) (string< (car x) (car y))))) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
456 (when parent |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
457 (loop for x in (gethash grand-parent mh-sub-folders-cache) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
458 when (equal (car x) child2) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
459 do (progn (setf (cdr x) t) (return))))))) |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
460 |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
461 (defun mh-normalize-folder-name (folder &optional empty-string-okay |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
462 dont-remove-trailing-slash) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
463 "Normalizes FOLDER name. |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
464 |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
465 Makes sure that two '/' characters never occur next to each |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
466 other. Also all occurrences of \"..\" and \".\" are suitably |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
467 processed. So \"+inbox/../news\" will be normalized to \"+news\". |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
468 |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
469 If optional argument EMPTY-STRING-OKAY is nil then a '+' is added |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
470 at the front if FOLDER lacks one. If non-nil and FOLDER is the |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
471 empty string then nothing is added. |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
472 |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
473 If optional argument DONT-REMOVE-TRAILING-SLASH is non-nil then a |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
474 trailing '/' if present is retained (if present), otherwise it is |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
475 removed." |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
476 (when (stringp folder) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
477 ;; Replace two or more consecutive '/' characters with a single '/' |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
478 (while (string-match "//" folder) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
479 (setq folder (replace-match "/" nil t folder))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
480 (let* ((length (length folder)) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
481 (trailing-slash-present (and (> length 0) |
50702
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
482 (equal (aref folder (1- length)) ?/))) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
483 (leading-slash-present (and (> length 0) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
484 (equal (aref folder 0) ?/)))) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
485 (when (and (> length 0) (equal (aref folder 0) ?@) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
486 (stringp mh-current-folder-name)) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
487 (setq folder (format "%s/%s/" mh-current-folder-name |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
488 (substring folder 1)))) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
489 ;; XXX: Purge empty strings from the list that split-string returns. In |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
490 ;; XEmacs, (split-string "+foo/" "/") returns ("+foo" "") while in GNU |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
491 ;; Emacs it returns ("+foo"). In the code it is assumed that the |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
492 ;; components list has no empty strings. |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
493 (let ((components (delete "" (split-string folder "/"))) |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
494 (result ())) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
495 ;; Remove .. and . from the pathname. |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
496 (dolist (component components) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
497 (cond ((and (equal component "..") result) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
498 (pop result)) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
499 ((equal component "..")) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
500 ((equal component ".")) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
501 (t (push component result)))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
502 (setq folder "") |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
503 (dolist (component result) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
504 (setq folder (concat component "/" folder))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
505 ;; Remove trailing '/' if needed. |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
506 (unless (and trailing-slash-present dont-remove-trailing-slash) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
507 (when (not (equal folder "")) |
50702
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
508 (setq folder (substring folder 0 (1- (length folder)))))) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
509 (when leading-slash-present |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
510 (setq folder (concat "/" folder))))) |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
511 (cond ((and empty-string-okay (equal folder ""))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
512 ((equal folder "") (setq folder "+")) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
513 ((not (equal (aref folder 0) ?+)) (setq folder (concat "+" folder))))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
514 folder) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
515 |
68188
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
516 (defmacro mh-children-p (folder) |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
517 "Return t if FOLDER from sub-folders cache has children. |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
518 The car of folder is the name, and the cdr is either t or some |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
519 sort of count that I do not understand. It's too small to be the |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
520 number of messages in the sub-folders and too large to be the |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
521 number of sub-folders. XXX" |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
522 `(if (cdr ,folder) |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
523 t |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
524 nil)) |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
525 |
68465 | 526 ;;;###mh-autoload |
68188
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
527 (defun mh-folder-list (folder) |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
528 "Return FOLDER and its descendents. |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
529 Returns a list of strings. For example, |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
530 |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
531 '(\"inbox\" \"lists\" \"lists/mh-e\"). |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
532 |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
533 If folder is nil, then all folders are considered. Respects the |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
534 value of `mh-recursive-folders-flag'. If this flag is nil, and |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
535 the sub-folders have not been explicitly viewed, then they will |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
536 not be returned." |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
537 (let ((folder-list)) |
68750
475285e9bca9
(mh-folder-list): Don't replace "/*$" with "/" since that causes an
Bill Wohler <wohler@newt.com>
parents:
68602
diff
changeset
|
538 ;; Normalize folder. Strip leading +. Add trailing slash (done in |
475285e9bca9
(mh-folder-list): Don't replace "/*$" with "/" since that causes an
Bill Wohler <wohler@newt.com>
parents:
68602
diff
changeset
|
539 ;; two steps to avoid infinite loops when replacing "/*$" with "/" |
475285e9bca9
(mh-folder-list): Don't replace "/*$" with "/" since that causes an
Bill Wohler <wohler@newt.com>
parents:
68602
diff
changeset
|
540 ;; in XEmacs). If no folder is specified, ensure it is nil to |
475285e9bca9
(mh-folder-list): Don't replace "/*$" with "/" since that causes an
Bill Wohler <wohler@newt.com>
parents:
68602
diff
changeset
|
541 ;; ensure we get the top-level folders; otherwise mh-sub-folders |
475285e9bca9
(mh-folder-list): Don't replace "/*$" with "/" since that causes an
Bill Wohler <wohler@newt.com>
parents:
68602
diff
changeset
|
542 ;; returns all the files in / if given an empty string or +. |
68188
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
543 (when folder |
68529
7daec5f4a289
* mh-alias.el (mh-alias-gecos-name): Use mh-replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents:
68520
diff
changeset
|
544 (setq folder (mh-replace-regexp-in-string "^\+" "" folder)) |
68750
475285e9bca9
(mh-folder-list): Don't replace "/*$" with "/" since that causes an
Bill Wohler <wohler@newt.com>
parents:
68602
diff
changeset
|
545 (setq folder (mh-replace-regexp-in-string "/+$" "" folder)) |
475285e9bca9
(mh-folder-list): Don't replace "/*$" with "/" since that causes an
Bill Wohler <wohler@newt.com>
parents:
68602
diff
changeset
|
546 (setq folder (concat folder "/")) |
68188
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
547 (if (equal folder "") |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
548 (setq folder nil))) |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
549 (loop for f in (mh-sub-folders folder) do |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
550 (setq folder-list (append folder-list (list (concat folder (car f))))) |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
551 (if (mh-children-p f) |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
552 (setq folder-list |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
553 (append folder-list |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
554 (mh-folder-list (concat folder (car f))))))) |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
555 folder-list)) |
dcf226991252
* mh-search.el (mh-index-next-result-function): Add format to
Bill Wohler <wohler@newt.com>
parents:
68163
diff
changeset
|
556 |
68465 | 557 ;;;###mh-autoload |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
558 (defun mh-sub-folders (folder &optional add-trailing-slash-flag) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
559 "Find the subfolders of FOLDER. |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
560 The function avoids running folders unnecessarily by caching the |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
561 results of the actual folders call. |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
562 |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
563 If optional argument ADD-TRAILING-SLASH-FLAG is non-nil then a |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
564 slash is added to each of the sub-folder names that may have |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
565 nested folders within them." |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
566 (let* ((folder (mh-normalize-folder-name folder)) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
567 (match (gethash folder mh-sub-folders-cache 'no-result)) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
568 (sub-folders (cond ((eq match 'no-result) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
569 (setf (gethash folder mh-sub-folders-cache) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
570 (mh-sub-folders-actual folder))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
571 (t match)))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
572 (if add-trailing-slash-flag |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
573 (mapcar #'(lambda (x) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
574 (if (cdr x) (cons (concat (car x) "/") (cdr x)) x)) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
575 sub-folders) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
576 sub-folders))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
577 |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
578 (defun mh-sub-folders-actual (folder) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
579 "Execute the command folders to return the sub-folders of FOLDER. |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
580 Filters out the folder names that start with \".\" so that |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
581 directories that aren't usually mail folders are hidden." |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
582 (let ((arg-list `(,(expand-file-name "folders" mh-progs) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
583 nil (t nil) nil "-noheader" "-norecurse" "-nototal" |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
584 ,@(if (stringp folder) (list folder) ()))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
585 (results ()) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
586 (current-folder (concat |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
587 (with-temp-buffer |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
588 (call-process (expand-file-name "folder" mh-progs) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
589 nil '(t nil) nil "-fast") |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
590 (buffer-substring (point-min) (1- (point-max)))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
591 "+"))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
592 (with-temp-buffer |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
593 (apply #'call-process arg-list) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
594 (goto-char (point-min)) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
595 (while (not (and (eolp) (bolp))) |
68529
7daec5f4a289
* mh-alias.el (mh-alias-gecos-name): Use mh-replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents:
68520
diff
changeset
|
596 (goto-char (mh-line-end-position)) |
7daec5f4a289
* mh-alias.el (mh-alias-gecos-name): Use mh-replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents:
68520
diff
changeset
|
597 (let ((start-pos (mh-line-beginning-position)) |
7daec5f4a289
* mh-alias.el (mh-alias-gecos-name): Use mh-replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents:
68520
diff
changeset
|
598 (has-pos (search-backward " has " |
7daec5f4a289
* mh-alias.el (mh-alias-gecos-name): Use mh-replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents:
68520
diff
changeset
|
599 (mh-line-beginning-position) t))) |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
600 (when (integerp has-pos) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
601 (while (equal (char-after has-pos) ? ) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
602 (decf has-pos)) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
603 (incf has-pos) |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
604 (while (equal (char-after start-pos) ? ) |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
605 (incf start-pos)) |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
606 (let* ((name (buffer-substring start-pos has-pos)) |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
607 (first-char (aref name 0)) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
608 (last-char (aref name (1- (length name))))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
609 (unless (member first-char '(?. ?# ?,)) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
610 (when (and (equal last-char ?+) (equal name current-folder)) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
611 (setq name (substring name 0 (1- (length name))))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
612 (push |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
613 (cons name |
68529
7daec5f4a289
* mh-alias.el (mh-alias-gecos-name): Use mh-replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents:
68520
diff
changeset
|
614 (search-forward "(others)" (mh-line-end-position) t)) |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
615 results)))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
616 (forward-line 1)))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
617 (setq results (nreverse results)) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
618 (when (stringp folder) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
619 (setq results (cdr results)) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
620 (let ((folder-name-len (length (format "%s/" (substring folder 1))))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
621 (setq results (mapcar (lambda (f) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
622 (cons (substring (car f) folder-name-len) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
623 (cdr f))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
624 results)))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
625 results)) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
626 |
68465 | 627 ;;;###mh-autoload |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
628 (defun mh-remove-from-sub-folders-cache (folder) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
629 "Remove FOLDER and its parent from `mh-sub-folders-cache'. |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
630 FOLDER should be unconditionally removed from the cache. Also the |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
631 last ancestor of FOLDER present in the cache must be removed as |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
632 well. |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
633 |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
634 To see why this is needed assume we have a folder +foo which has |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
635 a single sub-folder qux. Now we create the folder +foo/bar/baz. |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
636 Here we will need to invalidate the cached sub-folders of +foo, |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
637 otherwise completion on +foo won't tell us about the option |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
638 +foo/bar!" |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
639 (remhash folder mh-sub-folders-cache) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
640 (block ancestor-found |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
641 (let ((parent folder) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
642 (one-ancestor-found nil) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
643 last-slash) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
644 (while (setq last-slash (mh-search-from-end ?/ parent)) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
645 (setq parent (substring parent 0 last-slash)) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
646 (unless (eq (gethash parent mh-sub-folders-cache 'none) 'none) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
647 (remhash parent mh-sub-folders-cache) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
648 (if one-ancestor-found |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
649 (return-from ancestor-found) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
650 (setq one-ancestor-found t)))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
651 (remhash nil mh-sub-folders-cache)))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
652 |
68465 | 653 |
654 | |
655 ;;; Folder Utilities | |
656 | |
657 ;;;###mh-autoload | |
658 (defun mh-folder-name-p (name) | |
659 "Return non-nil if NAME is the name of a folder. | |
660 A name (a string or symbol) can be a folder name if it begins | |
661 with \"+\"." | |
662 (if (symbolp name) | |
663 (eq (aref (symbol-name name) 0) ?+) | |
664 (and (> (length name) 0) | |
665 (eq (aref name 0) ?+)))) | |
666 | |
667 ;;;###mh-autoload | |
668 (defun mh-expand-file-name (filename &optional default) | |
669 "Expand FILENAME like `expand-file-name', but also handle MH folder names. | |
670 Any filename that starts with '+' is treated as a folder name. | |
671 See `expand-file-name' for description of DEFAULT." | |
672 (if (mh-folder-name-p filename) | |
673 (expand-file-name (substring filename 1) mh-user-path) | |
674 (expand-file-name filename default))) | |
675 | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
676 (defvar mh-folder-hist nil) |
68096
57c4e7929f99
* mh-alias.el (mh-alias-gecos-name): Use replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents:
68013
diff
changeset
|
677 |
57c4e7929f99
* mh-alias.el (mh-alias-gecos-name): Use replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents:
68013
diff
changeset
|
678 ;; Shush compiler. |
68465 | 679 (eval-when-compile (defvar mh-speed-flists-cache)) |
50702
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
680 |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
681 (defvar mh-allow-root-folder-flag nil |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
682 "Non-nil means \"+\" is an acceptable folder name. |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
683 This variable is used to communicate with |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
684 `mh-folder-completion-function'. That function can have exactly |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
685 three arguments so we bind this variable to t or nil. |
50702
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
686 |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
687 This variable should never be set.") |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
688 |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
689 (defvar mh-folder-completion-map (copy-keymap minibuffer-local-completion-map)) |
67852
5b7ceef33307
(mh-process-daemon): Don't change buffer in proc-filter.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
67760
diff
changeset
|
690 (define-key mh-folder-completion-map " " 'minibuffer-complete) ;Why??? |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
691 |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
692 (defvar mh-speed-flists-inhibit-flag nil) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
693 |
68465 | 694 ;;;###mh-autoload |
50702
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
695 (defun mh-speed-flists-active-p () |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
696 "Check if speedbar is running with message counts enabled." |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
697 (and (featurep 'mh-speed) |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
698 (not mh-speed-flists-inhibit-flag) |
50702
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
699 (> (hash-table-count mh-speed-flists-cache) 0))) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
700 |
68465 | 701 ;;;###mh-autoload |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
702 (defun mh-folder-completion-function (name predicate flag) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
703 "Programmable completion for folder names. |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
704 NAME is the partial folder name that has been input. PREDICATE if |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
705 non-nil is a function that is used to filter the possible choices |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
706 and FLAG determines whether the completion is over." |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
707 (let* ((orig-name name) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
708 (name (mh-normalize-folder-name name nil t)) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
709 (last-slash (mh-search-from-end ?/ name)) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
710 (last-complete (if last-slash (substring name 0 last-slash) nil)) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
711 (remainder (cond (last-complete (substring name (1+ last-slash))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
712 ((and (> (length name) 0) (equal (aref name 0) ?+)) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
713 (substring name 1)) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
714 (t "")))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
715 (cond ((eq flag nil) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
716 (let ((try-res (try-completion |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
717 name |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
718 (mapcar (lambda (x) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
719 (cons (if (not last-complete) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
720 (concat "+" (car x)) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
721 (concat last-complete "/" (car x))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
722 (cdr x))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
723 (mh-sub-folders last-complete t)) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
724 predicate))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
725 (cond ((eq try-res nil) nil) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
726 ((and (eq try-res t) (equal name orig-name)) t) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
727 ((eq try-res t) name) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
728 (t try-res)))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
729 ((eq flag t) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
730 (all-completions |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
731 remainder (mh-sub-folders last-complete t) predicate)) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
732 ((eq flag 'lambda) |
50702
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
733 (let ((path (concat mh-user-path |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
734 (substring (mh-normalize-folder-name name) 1)))) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
735 (cond (mh-allow-root-folder-flag (file-exists-p path)) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
736 ((equal path mh-user-path) nil) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
737 (t (file-exists-p path)))))))) |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
738 |
68465 | 739 ;; Shush compiler. |
740 (eval-when-compile | |
741 (mh-do-in-xemacs | |
742 (defvar completion-root-regexp) | |
743 (defvar minibuffer-completing-file-name))) | |
744 | |
50702
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
745 (defun mh-folder-completing-read (prompt default allow-root-folder-flag) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
746 "Read folder name with PROMPT and default result DEFAULT. |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
747 If ALLOW-ROOT-FOLDER-FLAG is non-nil then \"+\" is allowed to be |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
748 a folder name corresponding to `mh-user-path'." |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
749 (mh-normalize-folder-name |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
750 (let ((minibuffer-completing-file-name t) |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
751 (completion-root-regexp "^[+/]") |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
752 (minibuffer-local-completion-map mh-folder-completion-map) |
50702
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
753 (mh-allow-root-folder-flag allow-root-folder-flag)) |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
754 (completing-read prompt 'mh-folder-completion-function nil nil nil |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
755 'mh-folder-hist default)) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
756 t)) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
757 |
68465 | 758 ;;;###mh-autoload |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
759 (defun mh-prompt-for-folder (prompt default can-create |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
760 &optional default-string allow-root-folder-flag) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
761 "Prompt for a folder name with PROMPT. |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
762 Returns the folder's name as a string. DEFAULT is used if the |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
763 folder exists and the user types return. If the CAN-CREATE flag |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
764 is t, then a folder is created if it doesn't already exist. If |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
765 optional argument DEFAULT-STRING is non-nil, use it in the prompt |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
766 instead of DEFAULT. If ALLOW-ROOT-FOLDER-FLAG is non-nil then the |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
767 function will accept the folder +, which means all folders when |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
768 used in searching." |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
769 (if (null default) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
770 (setq default "")) |
65681
4312387e37c8
2005-09-24 Emilio C. Lopes <eclig@gmx.net>
Romain Francoise <romain@orebokech.com>
parents:
64085
diff
changeset
|
771 (let* ((default-string (cond (default-string (format " (default %s)" default-string)) |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
772 ((equal "" default) "") |
65681
4312387e37c8
2005-09-24 Emilio C. Lopes <eclig@gmx.net>
Romain Francoise <romain@orebokech.com>
parents:
64085
diff
changeset
|
773 (t (format " (default %s)" default)))) |
4312387e37c8
2005-09-24 Emilio C. Lopes <eclig@gmx.net>
Romain Francoise <romain@orebokech.com>
parents:
64085
diff
changeset
|
774 (prompt (format "%s folder%s: " prompt default-string)) |
50702
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
775 (mh-current-folder-name mh-current-folder) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
776 read-name folder-name) |
50702
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
777 (while (and (setq read-name (mh-folder-completing-read |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
778 prompt default allow-root-folder-flag)) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
779 (equal read-name "") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
780 (equal default ""))) |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
781 (cond ((or (equal read-name "") |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
782 (and (equal read-name "+") (not allow-root-folder-flag))) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
783 (setq read-name default)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
784 ((not (mh-folder-name-p read-name)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
785 (setq read-name (format "+%s" read-name)))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
786 (if (or (not read-name) (equal "" read-name)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
787 (error "No folder specified")) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
788 (setq folder-name read-name) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
789 (cond ((and (> (length folder-name) 0) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
790 (eq (aref folder-name (1- (length folder-name))) ?/)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
791 (setq folder-name (substring folder-name 0 -1)))) |
50702
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
792 (let* ((last-slash (mh-search-from-end ?/ folder-name)) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
793 (parent (and last-slash (substring folder-name 0 last-slash))) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
794 (child (if last-slash |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
795 (substring folder-name (1+ last-slash)) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
796 (substring folder-name 1)))) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
797 (unless (member child |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
798 (mapcar #'car (gethash parent mh-sub-folders-cache))) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
799 (mh-remove-from-sub-folders-cache folder-name))) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
800 (let ((new-file-flag |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
801 (not (file-exists-p (mh-expand-file-name folder-name))))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
802 (cond ((and new-file-flag |
67857
226904e7d40b
(mh-prompt-for-folder): Use can-create argument to suppress creation
Bill Wohler <wohler@newt.com>
parents:
67852
diff
changeset
|
803 can-create |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
804 (y-or-n-p |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
805 (format "Folder %s does not exist. Create it? " |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
806 folder-name))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
807 (message "Creating %s" folder-name) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
808 (mh-exec-cmd-error nil "folder" folder-name) |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
809 (mh-remove-from-sub-folders-cache folder-name) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
810 (when (boundp 'mh-speed-folder-map) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
811 (mh-speed-add-folder folder-name)) |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
812 (message "Creating %s...done" folder-name)) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
813 (new-file-flag |
67857
226904e7d40b
(mh-prompt-for-folder): Use can-create argument to suppress creation
Bill Wohler <wohler@newt.com>
parents:
67852
diff
changeset
|
814 (error "Folder %s does not exist" folder-name)) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
815 ((not (file-directory-p (mh-expand-file-name folder-name))) |
68013
bbc0e52abce5
* mh-alias.el (mh-alias-add-alias): Grand message and error string
Bill Wohler <wohler@newt.com>
parents:
67988
diff
changeset
|
816 (error "%s is not a directory" |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
817 (mh-expand-file-name folder-name))))) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
818 folder-name)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
819 |
67681 | 820 |
821 | |
68465 | 822 ;;; Message Utilities |
823 | |
824 ;; Functions that would ordinarily be in mh-letter.el that are needed | |
825 ;; by mh-show.el are found here in order to prevent the loading of | |
826 ;; mh-letter.el until a message is actually composed. | |
827 | |
828 ;;;###mh-autoload | |
829 (defun mh-in-header-p () | |
830 "Return non-nil if the point is in the header of a draft message." | |
831 (< (point) (mh-mail-header-end))) | |
68163
3b7532a82079
* mh-search.el: New file containing contents of mh-index.el and
Bill Wohler <wohler@newt.com>
parents:
68137
diff
changeset
|
832 |
68465 | 833 ;;;###mh-autoload |
834 (defun mh-extract-from-header-value () | |
835 "Extract From: string from header." | |
836 (save-excursion | |
837 (if (not (mh-goto-header-field "From:")) | |
838 nil | |
839 (skip-chars-forward " \t") | |
840 (buffer-substring-no-properties | |
841 (point) (progn (mh-header-field-end)(point)))))) | |
842 | |
843 ;;;###mh-autoload | |
68477
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
844 (defun mh-get-header-field (field) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
845 "Find and return the body of FIELD in the mail header. |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
846 Returns the empty string if the field is not in the header of the |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
847 current buffer." |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
848 (if (mh-goto-header-field field) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
849 (progn |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
850 (skip-chars-forward " \t") ;strip leading white space in body |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
851 (let ((start (point))) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
852 (mh-header-field-end) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
853 (buffer-substring-no-properties start (point)))) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
854 "")) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
855 |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
856 ;;;###mh-autoload |
68465 | 857 (defun mh-goto-header-field (field) |
858 "Move to FIELD in the message header. | |
859 Move to the end of the FIELD name, which should end in a colon. | |
860 Returns t if found, nil if not." | |
861 (goto-char (point-min)) | |
862 (let ((case-fold-search t) | |
863 (headers-end (save-excursion | |
864 (mh-goto-header-end 0) | |
865 (point)))) | |
866 (re-search-forward (format "^%s" field) headers-end t))) | |
867 | |
868 ;;;###mh-autoload | |
869 (defun mh-goto-header-end (arg) | |
870 "Move the cursor ARG lines after the header." | |
871 (if (re-search-forward "^-*$" nil nil) | |
872 (forward-line arg))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
873 |
68465 | 874 ;;;###mh-autoload |
875 (defun mh-mail-header-end () | |
876 "Substitute for `mail-header-end' that doesn't widen the buffer. | |
877 | |
878 In MH-E we frequently need to find the end of headers in nested | |
879 messages, where the buffer has been narrowed. This function works | |
880 in this situation." | |
881 (save-excursion | |
882 ;; XXX: The following replaces a call to rfc822-goto-eoh. Occasionally, | |
883 ;; mail headers that MH-E has to read contains lines of the form: | |
884 ;; From xxx@yyy Mon May 10 11:48:07 2004 | |
885 ;; In this situation, rfc822-goto-eoh doesn't go to the end of the | |
886 ;; header. The replacement allows From_ lines in the mail header. | |
887 (goto-char (point-min)) | |
888 (loop for p = (re-search-forward | |
889 "^\\([:\n]\\|[^: \t\n]+[ \t\n]\\)" nil 'move) | |
890 do (cond ((null p) (return)) | |
891 (t (goto-char (match-beginning 0)) | |
892 (unless (looking-at "From ") (return)) | |
893 (goto-char p)))) | |
894 (point))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
895 |
68465 | 896 ;;;###mh-autoload |
897 (defun mh-header-field-beginning () | |
898 "Move to the beginning of the current header field. | |
899 Handles RFC 822 continuation lines." | |
900 (beginning-of-line) | |
901 (while (looking-at "^[ \t]") | |
902 (forward-line -1))) | |
903 | |
904 ;;;###mh-autoload | |
905 (defun mh-header-field-end () | |
906 "Move to the end of the current header field. | |
907 Handles RFC 822 continuation lines." | |
908 (forward-line 1) | |
909 (while (looking-at "^[ \t]") | |
910 (forward-line 1)) | |
911 (backward-char 1)) ;to end of previous line | |
912 | |
913 ;;;###mh-autoload | |
68477
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
914 (defun mh-letter-hide-all-skipped-fields () |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
915 "Hide all skipped fields." |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
916 (save-excursion |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
917 (goto-char (point-min)) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
918 (save-restriction |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
919 (narrow-to-region (point) (mh-mail-header-end)) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
920 (while (re-search-forward mh-letter-header-field-regexp nil t) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
921 (if (mh-letter-skipped-header-field-p (match-string 1)) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
922 (mh-letter-toggle-header-field-display -1) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
923 (mh-letter-toggle-header-field-display 'long)) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
924 (beginning-of-line 2))))) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
925 |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
926 ;;;###mh-autoload |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
927 (defun mh-letter-skipped-header-field-p (field) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
928 "Check if FIELD is to be skipped." |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
929 (let ((field (downcase field))) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
930 (loop for x in mh-compose-skipped-header-fields |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
931 when (equal (downcase x) field) return t |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
932 finally return nil))) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
933 |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
934 (defvar mh-hidden-header-keymap |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
935 (let ((map (make-sparse-keymap))) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
936 (mh-do-in-gnu-emacs |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
937 (define-key map [mouse-2] 'mh-letter-toggle-header-field-display-button)) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
938 (mh-do-in-xemacs |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
939 (define-key map '(button2) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
940 'mh-letter-toggle-header-field-display-button)) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
941 map)) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
942 |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
943 ;;;###mh-autoload |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
944 (defun mh-letter-toggle-header-field-display (arg) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
945 "Toggle display of header field at point. |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
946 |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
947 Use this command to display truncated header fields. This command |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
948 is a toggle so entering it again will hide the field. This |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
949 command takes a prefix argument ARG: if negative then the field |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
950 is hidden, if positive then the field is displayed." |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
951 (interactive (list nil)) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
952 (when (and (mh-in-header-p) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
953 (progn |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
954 (end-of-line) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
955 (re-search-backward mh-letter-header-field-regexp nil t))) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
956 (let ((buffer-read-only nil) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
957 (modified-flag (buffer-modified-p)) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
958 (begin (point)) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
959 end) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
960 (end-of-line) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
961 (setq end (1- (if (re-search-forward "^[^ \t]" nil t) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
962 (match-beginning 0) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
963 (point-max)))) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
964 (goto-char begin) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
965 ;; Make it clickable... |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
966 (add-text-properties begin end `(keymap ,mh-hidden-header-keymap |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
967 mouse-face highlight)) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
968 (unwind-protect |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
969 (cond ((or (and (not arg) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
970 (text-property-any begin end 'invisible 'vanish)) |
68529
7daec5f4a289
* mh-alias.el (mh-alias-gecos-name): Use mh-replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents:
68520
diff
changeset
|
971 (and (numberp arg) |
7daec5f4a289
* mh-alias.el (mh-alias-gecos-name): Use mh-replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents:
68520
diff
changeset
|
972 (>= arg 0)) |
7daec5f4a289
* mh-alias.el (mh-alias-gecos-name): Use mh-replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents:
68520
diff
changeset
|
973 (and (eq arg 'long) |
7daec5f4a289
* mh-alias.el (mh-alias-gecos-name): Use mh-replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents:
68520
diff
changeset
|
974 (> (mh-line-beginning-position 5) end))) |
68477
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
975 (remove-text-properties begin end '(invisible nil)) |
68529
7daec5f4a289
* mh-alias.el (mh-alias-gecos-name): Use mh-replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents:
68520
diff
changeset
|
976 (search-forward ":" (mh-line-end-position) t) |
68477
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
977 (mh-letter-skip-leading-whitespace-in-header-field)) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
978 ;; XXX Redesign to make usable by user. Perhaps use a positive |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
979 ;; numeric prefix to make that many lines visible. |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
980 ((eq arg 'long) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
981 (end-of-line 4) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
982 (mh-letter-truncate-header-field end) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
983 (beginning-of-line)) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
984 (t (end-of-line) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
985 (mh-letter-truncate-header-field end) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
986 (beginning-of-line))) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
987 (set-buffer-modified-p modified-flag))))) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
988 |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
989 ;;;###mh-autoload |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
990 (defun mh-letter-skip-leading-whitespace-in-header-field () |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
991 "Skip leading whitespace in a header field. |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
992 If the header field doesn't have at least one space after the |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
993 colon then a space character is added." |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
994 (let ((need-space t)) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
995 (while (memq (char-after) '(?\t ?\ )) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
996 (forward-char) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
997 (setq need-space nil)) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
998 (when need-space (insert " ")))) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
999 |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
1000 (defun mh-letter-truncate-header-field (end) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
1001 "Replace text from current line till END with an ellipsis. |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
1002 If the current line is too long truncate a part of it as well." |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
1003 (let ((max-len (min (window-width) 62))) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
1004 (when (> (+ (current-column) 4) max-len) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
1005 (backward-char (- (+ (current-column) 5) max-len))) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
1006 (when (> end (point)) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
1007 (add-text-properties (point) end '(invisible vanish))))) |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
1008 |
0f44616074ba
* mh-comp.el (mh-letter-hide-all-skipped-fields)
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
1009 ;;;###mh-autoload |
68465 | 1010 (defun mh-signature-separator-p () |
1011 "Return non-nil if buffer includes \"^-- $\"." | |
1012 (save-excursion | |
1013 (goto-char (point-min)) | |
1014 (re-search-forward mh-signature-separator-regexp nil t))) | |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
1015 |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1016 (provide 'mh-utils) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1017 |
67681 | 1018 ;; Local Variables: |
1019 ;; indent-tabs-mode: nil | |
1020 ;; sentence-end-double-space: nil | |
1021 ;; End: | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1022 |
67681 | 1023 ;; arch-tag: 1af39fdf-f66f-4b06-9b48-18a7656c8e36 |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1024 ;;; mh-utils.el ends here |