annotate lisp/mh-e/mh-init.el @ 68135:03bac2d0a4aa

* Makefile (MH_E_SRC): Add mh-buffers.el. * emacs/lisp/Makefile.in (MH_E_SRC): Rename from MH-E-SRC since the dashes can give some systems gas. Add new file mh-buffers.el. * emacs/lisp/mh-e/mh-buffers.el: New file. Contains constants and code from mh-index.el and mh-utils.el. * emacs/lisp/mh-e/mh-alias.el: * emacs/lisp/mh-e/mh-comp.el: * emacs/lisp/mh-e/mh-e.el: * emacs/lisp/mh-e/mh-funcs.el: * emacs/lisp/mh-e/mh-init.el: * emacs/lisp/mh-e/mh-junk.el: * emacs/lisp/mh-e/mh-mime.el: * emacs/lisp/mh-e/mh-print.el: * emacs/lisp/mh-e/mh-seq.el: Require new file mh-buffers.el. * emacs/lisp/mh-e/mh-index.el: Require new file mh-buffers.el. (mh-index-temp-buffer, mh-checksum-buffer): Move to new file mh-buffers.el. * emacs/lisp/mh-e/mh-utils.el: Require new file mh-buffers.el. (mh-temp-buffer, mh-temp-fetch-buffer) (mh-aliases-buffer, mh-folders-buffer, mh-help-buffer) (mh-info-buffer, mh-log-buffer, mh-mail-delivery-buffer) (mh-recipients-buffer, mh-sequences-buffer, mh-log-buffer-lines) (mh-truncate-log-buffer): Move to new file mh-buffers.el.
author Bill Wohler <wohler@newt.com>
date Wed, 11 Jan 2006 19:50:07 +0000
parents 40429cab94e1
children 5012e59a73c7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
67681
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 67449
diff changeset
1 ;;; mh-init.el --- MH-E initialization
56676
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
2
67969
3ca8b2234237 * mh-customize.el: Sync docstrings with manual for faces and sort them
Bill Wohler <wohler@newt.com>
parents: 67760
diff changeset
3 ;; Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
56676
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
4
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
5 ;; Author: Peter S. Galbraith <psg@debian.org>
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
6 ;; Maintainer: Bill Wohler <wohler@newt.com>
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
7 ;; Keywords: mail
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
8 ;; See: mh-e.el
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
9
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
10 ;; This file is part of GNU Emacs.
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
11
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
15 ;; any later version.
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
16
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
20 ;; GNU General Public License for more details.
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
21
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
64085
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 62847
diff changeset
24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 62847
diff changeset
25 ;; Boston, MA 02110-1301, USA.
56676
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
26
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
27 ;;; Commentary:
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
28
66716
25ad3e63f2a1 * mh-customize.el (mh-min-colors-defined-flag, mh-defface-compat):
Bill Wohler <wohler@newt.com>
parents: 66136
diff changeset
29 ;; Sets up the MH variant (currently nmh, MH, or GNU mailutils).
56676
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
30 ;;
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
31 ;; Users may customize `mh-variant' to switch between available variants.
68127
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
32 ;; Available MH variants are returned by the function `mh-variants'.
56676
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
33 ;; Developers may check which variant is currently in use with the
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
34 ;; variable `mh-variant-in-use' or the function `mh-variant-p'.
66716
25ad3e63f2a1 * mh-customize.el (mh-min-colors-defined-flag, mh-defface-compat):
Bill Wohler <wohler@newt.com>
parents: 66136
diff changeset
35 ;;
25ad3e63f2a1 * mh-customize.el (mh-min-colors-defined-flag, mh-defface-compat):
Bill Wohler <wohler@newt.com>
parents: 66136
diff changeset
36 ;; Also contains code that is used at load or initialization time only.
56676
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
37
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
38 ;;; Change Log:
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
39
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
40 ;;; Code:
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
41
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
42 (eval-when-compile (require 'mh-acros))
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
43 (mh-require-cl)
68135
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents: 68127
diff changeset
44 (require 'mh-buffers)
56676
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
45 (require 'mh-utils)
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
46
68127
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
47 (defvar mh-sys-path
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
48 '("/usr/local/nmh/bin" ; nmh default
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
49 "/usr/local/bin/mh/"
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
50 "/usr/local/mh/"
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
51 "/usr/bin/mh/" ; Ultrix 4.2, Linux
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
52 "/usr/new/mh/" ; Ultrix < 4.2
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
53 "/usr/contrib/mh/bin/" ; BSDI
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
54 "/usr/pkg/bin/" ; NetBSD
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
55 "/usr/local/bin/"
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
56 "/usr/local/bin/mu-mh/" ; GNU mailutils - default
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
57 "/usr/bin/mu-mh/") ; GNU mailutils - packaged
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
58 "List of directories to search for variants of the MH variant.
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
59 The list `exec-path' is searched in addition to this list.
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
60 There's no need for users to modify this list. Instead add extra
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
61 directories to the customizable variable `mh-path'.")
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
62
67681
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 67449
diff changeset
63 ;; Set for local environment:
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 67449
diff changeset
64 ;; mh-progs and mh-lib used to be set in paths.el, which tried to
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 67449
diff changeset
65 ;; figure out at build time which of several possible directories MH
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 67449
diff changeset
66 ;; was installed into. But if you installed MH after building Emacs,
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 67449
diff changeset
67 ;; this would almost certainly be wrong, so now we do it at run time.
56676
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
68
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
69 (defvar mh-progs nil
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
70 "Directory containing MH commands, such as inc, repl, and rmm.")
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
71
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
72 (defvar mh-lib nil
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
73 "Directory containing the MH library.
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
74 This directory contains, among other things, the components file.")
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
75
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
76 (defvar mh-lib-progs nil
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
77 "Directory containing MH helper programs.
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
78 This directory contains, among other things, the mhl program.")
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
79
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
80 (defvar mh-flists-present-flag nil
67760
9c3504ae6060 Follow MH-E Developers Guide conventions. Use `' quotes for Help
Bill Wohler <wohler@newt.com>
parents: 67758
diff changeset
81 "Non-nil means that we have \"flists\".")
56676
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
82
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
83 ;;;###autoload
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
84 (put 'mh-progs 'risky-local-variable t)
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
85 ;;;###autoload
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
86 (put 'mh-lib 'risky-local-variable t)
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
87 ;;;###autoload
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
88 (put 'mh-lib-progs 'risky-local-variable t)
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
89
67449
315e71e95246 * mh-customize.el (mh-path): Move here from mh-init.el.
Bill Wohler <wohler@newt.com>
parents: 67245
diff changeset
90 (defvar mh-variants nil
315e71e95246 * mh-customize.el (mh-path): Move here from mh-init.el.
Bill Wohler <wohler@newt.com>
parents: 67245
diff changeset
91 "List describing known MH variants.
68127
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
92 Do not access this variable directly as it may not have yet been initialized.
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
93 Use the function `mh-variants' instead.")
67449
315e71e95246 * mh-customize.el (mh-path): Move here from mh-init.el.
Bill Wohler <wohler@newt.com>
parents: 67245
diff changeset
94
315e71e95246 * mh-customize.el (mh-path): Move here from mh-init.el.
Bill Wohler <wohler@newt.com>
parents: 67245
diff changeset
95 ;;;###mh-autoload
315e71e95246 * mh-customize.el (mh-path): Move here from mh-init.el.
Bill Wohler <wohler@newt.com>
parents: 67245
diff changeset
96 (defun mh-variants ()
315e71e95246 * mh-customize.el (mh-path): Move here from mh-init.el.
Bill Wohler <wohler@newt.com>
parents: 67245
diff changeset
97 "Return a list of installed variants of MH on the system.
315e71e95246 * mh-customize.el (mh-path): Move here from mh-init.el.
Bill Wohler <wohler@newt.com>
parents: 67245
diff changeset
98 This function looks for MH in `mh-sys-path', `mh-path' and
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67681
diff changeset
99 `exec-path'. The format of the list of variants that is returned
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67681
diff changeset
100 is described by the variable `mh-variants'."
67449
315e71e95246 * mh-customize.el (mh-path): Move here from mh-init.el.
Bill Wohler <wohler@newt.com>
parents: 67245
diff changeset
101 (if mh-variants
315e71e95246 * mh-customize.el (mh-path): Move here from mh-init.el.
Bill Wohler <wohler@newt.com>
parents: 67245
diff changeset
102 mh-variants
315e71e95246 * mh-customize.el (mh-path): Move here from mh-init.el.
Bill Wohler <wohler@newt.com>
parents: 67245
diff changeset
103 (let ((list-unique))
315e71e95246 * mh-customize.el (mh-path): Move here from mh-init.el.
Bill Wohler <wohler@newt.com>
parents: 67245
diff changeset
104 ;; Make a unique list of directories, keeping the given order.
315e71e95246 * mh-customize.el (mh-path): Move here from mh-init.el.
Bill Wohler <wohler@newt.com>
parents: 67245
diff changeset
105 ;; We don't want the same MH variant to be listed multiple times.
315e71e95246 * mh-customize.el (mh-path): Move here from mh-init.el.
Bill Wohler <wohler@newt.com>
parents: 67245
diff changeset
106 (loop for dir in (append mh-path mh-sys-path exec-path) do
315e71e95246 * mh-customize.el (mh-path): Move here from mh-init.el.
Bill Wohler <wohler@newt.com>
parents: 67245
diff changeset
107 (setq dir (file-chase-links (directory-file-name dir)))
315e71e95246 * mh-customize.el (mh-path): Move here from mh-init.el.
Bill Wohler <wohler@newt.com>
parents: 67245
diff changeset
108 (add-to-list 'list-unique dir))
315e71e95246 * mh-customize.el (mh-path): Move here from mh-init.el.
Bill Wohler <wohler@newt.com>
parents: 67245
diff changeset
109 (loop for dir in (nreverse list-unique) do
315e71e95246 * mh-customize.el (mh-path): Move here from mh-init.el.
Bill Wohler <wohler@newt.com>
parents: 67245
diff changeset
110 (when (and dir (file-directory-p dir) (file-readable-p dir))
315e71e95246 * mh-customize.el (mh-path): Move here from mh-init.el.
Bill Wohler <wohler@newt.com>
parents: 67245
diff changeset
111 (let ((variant (mh-variant-info dir)))
315e71e95246 * mh-customize.el (mh-path): Move here from mh-init.el.
Bill Wohler <wohler@newt.com>
parents: 67245
diff changeset
112 (if variant
315e71e95246 * mh-customize.el (mh-path): Move here from mh-init.el.
Bill Wohler <wohler@newt.com>
parents: 67245
diff changeset
113 (add-to-list 'mh-variants variant)))))
315e71e95246 * mh-customize.el (mh-path): Move here from mh-init.el.
Bill Wohler <wohler@newt.com>
parents: 67245
diff changeset
114 mh-variants)))
315e71e95246 * mh-customize.el (mh-path): Move here from mh-init.el.
Bill Wohler <wohler@newt.com>
parents: 67245
diff changeset
115
68127
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
116 (defun mh-variant-info (dir)
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
117 "Return MH variant found in DIR, or nil if none present."
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
118 (save-excursion
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
119 (let ((tmp-buffer (get-buffer-create mh-temp-buffer)))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
120 (set-buffer tmp-buffer)
56676
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
121 (cond
68127
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
122 ((mh-variant-mh-info dir))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
123 ((mh-variant-nmh-info dir))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
124 ((mh-variant-mu-mh-info dir))))))
56676
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
125
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
126 (defun mh-variant-mh-info (dir)
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
127 "Return info for MH variant in DIR assuming a temporary buffer is setup."
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
128 ;; MH does not have the -version option.
67760
9c3504ae6060 Follow MH-E Developers Guide conventions. Use `' quotes for Help
Bill Wohler <wohler@newt.com>
parents: 67758
diff changeset
129 ;; Its version number is included in the output of "-help" as:
56676
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
130 ;;
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
131 ;; version: MH 6.8.4 #2[UCI] (burrito) of Fri Jan 15 20:01:39 EST 1999
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
132 ;; options: [ATHENA] [BIND] [DUMB] [LIBLOCKFILE] [LOCALE] [MAILGROUP] [MHE]
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
133 ;; [MHRC] [MIME] [MORE='"/usr/bin/sensible-pager"'] [NLINK_HACK]
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
134 ;; [NORUSERPASS] [OVERHEAD] [POP] [POPSERVICE='"pop-3"'] [RENAME]
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
135 ;; [RFC1342] [RPATHS] [RPOP] [SENDMTS] [SMTP] [SOCKETS]
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
136 ;; [SPRINTFTYPE=int] [SVR4] [SYS5] [SYS5DIR] [TERMINFO]
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
137 ;; [TYPESIG=void] [UNISTD] [UTK] [VSPRINTF]
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
138 (let ((mhparam (expand-file-name "mhparam" dir)))
68127
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
139 (when (mh-file-command-p mhparam)
56676
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
140 (erase-buffer)
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
141 (call-process mhparam nil '(t nil) nil "-help")
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
142 (goto-char (point-min))
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
143 (when (search-forward-regexp "version: MH \\(\\S +\\)" nil t)
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
144 (let ((version (format "MH %s" (match-string 1))))
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
145 (erase-buffer)
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
146 (call-process mhparam nil '(t nil) nil "libdir")
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
147 (goto-char (point-min))
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
148 (when (search-forward-regexp "^.*$" nil t)
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
149 (let ((libdir (match-string 0)))
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
150 `(,version
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
151 (variant mh)
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
152 (mh-lib-progs ,libdir)
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
153 (mh-lib ,libdir)
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
154 (mh-progs ,dir)
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
155 (flists nil)))))))))
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
156
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
157 (defun mh-variant-mu-mh-info (dir)
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
158 "Return info for GNU mailutils variant in DIR.
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
159 This assumes that a temporary buffer is setup."
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
160 ;; 'mhparam -version' output:
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
161 ;; mhparam (GNU mailutils 0.3.2)
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
162 (let ((mhparam (expand-file-name "mhparam" dir)))
68127
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
163 (when (mh-file-command-p mhparam)
56676
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
164 (erase-buffer)
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
165 (call-process mhparam nil '(t nil) nil "-version")
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
166 (goto-char (point-min))
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
167 (when (search-forward-regexp "mhparam (\\(GNU [Mm]ailutils \\S +\\))"
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
168 nil t)
68114
86ac787740e6 (mh-variant-mu-mh-info, mh-variant-nmh-info): Applied patch from
Bill Wohler <wohler@newt.com>
parents: 68105
diff changeset
169 (let ((version (match-string 1))
86ac787740e6 (mh-variant-mu-mh-info, mh-variant-nmh-info): Applied patch from
Bill Wohler <wohler@newt.com>
parents: 68105
diff changeset
170 (mh-progs dir))
86ac787740e6 (mh-variant-mu-mh-info, mh-variant-nmh-info): Applied patch from
Bill Wohler <wohler@newt.com>
parents: 68105
diff changeset
171 `(,version
86ac787740e6 (mh-variant-mu-mh-info, mh-variant-nmh-info): Applied patch from
Bill Wohler <wohler@newt.com>
parents: 68105
diff changeset
172 (variant mu-mh)
86ac787740e6 (mh-variant-mu-mh-info, mh-variant-nmh-info): Applied patch from
Bill Wohler <wohler@newt.com>
parents: 68105
diff changeset
173 (mh-lib-progs ,(mh-profile-component "libdir"))
86ac787740e6 (mh-variant-mu-mh-info, mh-variant-nmh-info): Applied patch from
Bill Wohler <wohler@newt.com>
parents: 68105
diff changeset
174 (mh-lib ,(mh-profile-component "etcdir"))
86ac787740e6 (mh-variant-mu-mh-info, mh-variant-nmh-info): Applied patch from
Bill Wohler <wohler@newt.com>
parents: 68105
diff changeset
175 (mh-progs ,dir)
86ac787740e6 (mh-variant-mu-mh-info, mh-variant-nmh-info): Applied patch from
Bill Wohler <wohler@newt.com>
parents: 68105
diff changeset
176 (flists ,(file-exists-p
86ac787740e6 (mh-variant-mu-mh-info, mh-variant-nmh-info): Applied patch from
Bill Wohler <wohler@newt.com>
parents: 68105
diff changeset
177 (expand-file-name "flists" dir)))))))))
56676
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
178
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
179 (defun mh-variant-nmh-info (dir)
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
180 "Return info for nmh variant in DIR assuming a temporary buffer is setup."
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
181 ;; `mhparam -version' outputs:
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
182 ;; mhparam -- nmh-1.1-RC1 [compiled on chaak at Fri Jun 20 11:03:28 PDT 2003]
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
183 (let ((mhparam (expand-file-name "mhparam" dir)))
68127
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
184 (when (mh-file-command-p mhparam)
56676
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
185 (erase-buffer)
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
186 (call-process mhparam nil '(t nil) nil "-version")
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
187 (goto-char (point-min))
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
188 (when (search-forward-regexp "mhparam -- nmh-\\(\\S +\\)" nil t)
68114
86ac787740e6 (mh-variant-mu-mh-info, mh-variant-nmh-info): Applied patch from
Bill Wohler <wohler@newt.com>
parents: 68105
diff changeset
189 (let ((version (format "nmh %s" (match-string 1)))
86ac787740e6 (mh-variant-mu-mh-info, mh-variant-nmh-info): Applied patch from
Bill Wohler <wohler@newt.com>
parents: 68105
diff changeset
190 (mh-progs dir))
86ac787740e6 (mh-variant-mu-mh-info, mh-variant-nmh-info): Applied patch from
Bill Wohler <wohler@newt.com>
parents: 68105
diff changeset
191 `(,version
86ac787740e6 (mh-variant-mu-mh-info, mh-variant-nmh-info): Applied patch from
Bill Wohler <wohler@newt.com>
parents: 68105
diff changeset
192 (variant nmh)
86ac787740e6 (mh-variant-mu-mh-info, mh-variant-nmh-info): Applied patch from
Bill Wohler <wohler@newt.com>
parents: 68105
diff changeset
193 (mh-lib-progs ,(mh-profile-component "libdir"))
86ac787740e6 (mh-variant-mu-mh-info, mh-variant-nmh-info): Applied patch from
Bill Wohler <wohler@newt.com>
parents: 68105
diff changeset
194 (mh-lib ,(mh-profile-component "etcdir"))
86ac787740e6 (mh-variant-mu-mh-info, mh-variant-nmh-info): Applied patch from
Bill Wohler <wohler@newt.com>
parents: 68105
diff changeset
195 (mh-progs ,dir)
86ac787740e6 (mh-variant-mu-mh-info, mh-variant-nmh-info): Applied patch from
Bill Wohler <wohler@newt.com>
parents: 68105
diff changeset
196 (flists ,(file-exists-p
86ac787740e6 (mh-variant-mu-mh-info, mh-variant-nmh-info): Applied patch from
Bill Wohler <wohler@newt.com>
parents: 68105
diff changeset
197 (expand-file-name "flists" dir)))))))))
56676
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
198
68127
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
199 (defun mh-file-command-p (file)
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
200 "Return t if file FILE is the name of a executable regular file."
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
201 (and (file-regular-p file) (file-executable-p file)))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
202
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
203 (defvar mh-variant-in-use nil
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
204 "The MH variant currently in use; a string with variant and version number.
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
205 This differs from `mh-variant' when the latter is set to
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
206 \"autodetect\".")
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
207
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
208 ;;;###mh-autoload
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
209 (defun mh-variant-set (variant)
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
210 "Set the MH variant to VARIANT.
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
211 Sets `mh-progs', `mh-lib', `mh-lib-progs' and
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
212 `mh-flists-present-flag'.
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
213 If the VARIANT is \"autodetect\", then first try nmh, then MH and
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
214 finally GNU mailutils."
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
215 (interactive
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
216 (list (completing-read
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
217 "MH variant: "
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
218 (mapcar (lambda (x) (list (car x))) (mh-variants))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
219 nil t)))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
220 (let ((valid-list (mapcar (lambda (x) (car x)) (mh-variants))))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
221 (cond
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
222 ((eq variant 'none))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
223 ((eq variant 'autodetect)
56676
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
224 (cond
68127
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
225 ((mh-variant-set-variant 'nmh)
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
226 (message "%s installed as MH variant" mh-variant-in-use))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
227 ((mh-variant-set-variant 'mh)
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
228 (message "%s installed as MH variant" mh-variant-in-use))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
229 ((mh-variant-set-variant 'mu-mh)
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
230 (message "%s installed as MH variant" mh-variant-in-use))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
231 (t
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
232 (message "No MH variant found on the system"))))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
233 ((member variant valid-list)
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
234 (when (not (mh-variant-set-variant variant))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
235 (message "Warning: %s variant not found. Autodetecting..." variant)
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
236 (mh-variant-set 'autodetect)))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
237 (t
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
238 (message "Unknown variant; use %s"
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
239 (mapconcat '(lambda (x) (format "%s" (car x)))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
240 (mh-variants) " or "))))))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
241
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
242 (defun mh-variant-set-variant (variant)
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
243 "Setup the system variables for the MH variant named VARIANT.
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
244 If VARIANT is a string, use that key in the alist returned by the
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
245 function `mh-variants'.
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
246 If VARIANT is a symbol, select the first entry that matches that
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
247 variant."
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
248 (cond
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
249 ((stringp variant) ;e.g. "nmh 1.1-RC1"
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
250 (when (assoc variant (mh-variants))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
251 (let* ((alist (cdr (assoc variant (mh-variants))))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
252 (lib-progs (cadr (assoc 'mh-lib-progs alist)))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
253 (lib (cadr (assoc 'mh-lib alist)))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
254 (progs (cadr (assoc 'mh-progs alist)))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
255 (flists (cadr (assoc 'flists alist))))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
256 ;;(set-default mh-variant variant)
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
257 (setq mh-x-mailer-string nil
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
258 mh-flists-present-flag flists
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
259 mh-lib-progs lib-progs
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
260 mh-lib lib
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
261 mh-progs progs
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
262 mh-variant-in-use variant))))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
263 ((symbolp variant) ;e.g. 'nmh (pick the first match)
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
264 (loop for variant-list in (mh-variants)
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
265 when (eq variant (cadr (assoc 'variant (cdr variant-list))))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
266 return (let* ((version (car variant-list))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
267 (alist (cdr variant-list))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
268 (lib-progs (cadr (assoc 'mh-lib-progs alist)))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
269 (lib (cadr (assoc 'mh-lib alist)))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
270 (progs (cadr (assoc 'mh-progs alist)))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
271 (flists (cadr (assoc 'flists alist))))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
272 ;;(set-default mh-variant flavor)
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
273 (setq mh-x-mailer-string nil
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
274 mh-flists-present-flag flists
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
275 mh-lib-progs lib-progs
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
276 mh-lib lib
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
277 mh-progs progs
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
278 mh-variant-in-use version)
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
279 t)))))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
280
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
281 ;;;###mh-autoload
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
282 (defun mh-variant-p (&rest variants)
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
283 "Return t if variant is any of VARIANTS.
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
284 Currently known variants are 'MH, 'nmh, and 'mu-mh."
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
285 (let ((variant-in-use
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
286 (cadr (assoc 'variant (assoc mh-variant-in-use (mh-variants))))))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
287 (not (null (member variant-in-use variants)))))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
288
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
289
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
290
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
291 ;;; Read MH Profile
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
292
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
293 (defvar mh-find-path-run nil
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
294 "Non-nil if `mh-find-path' has been run already.
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
295 Do not access this variable; `mh-find-path' already uses it to
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
296 avoid running more than once.")
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
297
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
298 (defun mh-find-path ()
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
299 "Set variables from user's MH profile.
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
300
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
301 This function sets `mh-user-path' from your \"Path:\" MH profile
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
302 component (but defaults to \"Mail\" if one isn't present),
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
303 `mh-draft-folder' from \"Draft-Folder:\", `mh-unseen-seq' from
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
304 \"Unseen-Sequence:\", `mh-previous-seq' from
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
305 \"Previous-Sequence:\", and `mh-inbox' from \"Inbox:\" (defaults
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
306 to \"+inbox\").
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
307
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
308 The hook `mh-find-path-hook' is run after these variables have
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
309 been set. This hook can be used the change the value of these
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
310 variables if you need to run with different values between MH and
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
311 MH-E."
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
312 (unless mh-find-path-run
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
313 ;; Sanity checks.
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
314 (if (and (getenv "MH")
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
315 (not (file-readable-p (getenv "MH"))))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
316 (error "MH environment variable contains unreadable file %s"
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
317 (getenv "MH")))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
318 (if (null (mh-variants))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
319 (error "Install MH and run install-mh before running MH-E"))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
320 (let ((profile "~/.mh_profile"))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
321 (if (not (file-readable-p profile))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
322 (error "Run install-mh before running MH-E")))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
323 ;; Read MH profile.
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
324 (setq mh-user-path (mh-profile-component "Path"))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
325 (if (not mh-user-path)
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
326 (setq mh-user-path "Mail"))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
327 (setq mh-user-path
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
328 (file-name-as-directory
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
329 (expand-file-name mh-user-path (expand-file-name "~"))))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
330 (unless mh-x-image-cache-directory
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
331 (setq mh-x-image-cache-directory
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
332 (expand-file-name ".mhe-x-image-cache" mh-user-path)))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
333 (setq mh-draft-folder (mh-profile-component "Draft-Folder"))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
334 (if mh-draft-folder
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
335 (progn
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
336 (if (not (mh-folder-name-p mh-draft-folder))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
337 (setq mh-draft-folder (format "+%s" mh-draft-folder)))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
338 (if (not (file-exists-p (mh-expand-file-name mh-draft-folder)))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
339 (error
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
340 "Draft folder \"%s\" not found; create it and try again"
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
341 (mh-expand-file-name mh-draft-folder)))))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
342 (setq mh-inbox (mh-profile-component "Inbox"))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
343 (cond ((not mh-inbox)
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
344 (setq mh-inbox "+inbox"))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
345 ((not (mh-folder-name-p mh-inbox))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
346 (setq mh-inbox (format "+%s" mh-inbox))))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
347 (setq mh-unseen-seq (mh-profile-component "Unseen-Sequence"))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
348 (if mh-unseen-seq
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
349 (setq mh-unseen-seq (intern mh-unseen-seq))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
350 (setq mh-unseen-seq 'unseen)) ;old MH default?
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
351 (setq mh-previous-seq (mh-profile-component "Previous-Sequence"))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
352 (if mh-previous-seq
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
353 (setq mh-previous-seq (intern mh-previous-seq)))
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
354 (run-hooks 'mh-find-path-hook)
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
355 (mh-collect-folder-names)
40429cab94e1 * mh-index.el (mh-index-search): Checking mh-find-path-run is
Bill Wohler <wohler@newt.com>
parents: 68114
diff changeset
356 (setq mh-find-path-run t)))
56676
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
357
66716
25ad3e63f2a1 * mh-customize.el (mh-min-colors-defined-flag, mh-defface-compat):
Bill Wohler <wohler@newt.com>
parents: 66136
diff changeset
358
25ad3e63f2a1 * mh-customize.el (mh-min-colors-defined-flag, mh-defface-compat):
Bill Wohler <wohler@newt.com>
parents: 66136
diff changeset
359
68105
5772368fe15e * mh-funcs.el:
Bill Wohler <wohler@newt.com>
parents: 68096
diff changeset
360 ;; Shush compiler.
5772368fe15e * mh-funcs.el:
Bill Wohler <wohler@newt.com>
parents: 68096
diff changeset
361 (eval-when-compile (defvar image-load-path))
68096
57c4e7929f99 * mh-alias.el (mh-alias-gecos-name): Use replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents: 68013
diff changeset
362
66113
bfb1c3364c23 * mh-init.el (mh-image-load-path-called-flag): New variable which
Satyaki Das <satyaki@theforce.stanford.edu>
parents: 66087
diff changeset
363 (defvar mh-image-load-path-called-flag nil)
bfb1c3364c23 * mh-init.el (mh-image-load-path-called-flag): New variable which
Satyaki Das <satyaki@theforce.stanford.edu>
parents: 66087
diff changeset
364
65980
4520ae2624f2 * mh-init.el (mh-image-load-path): New function that adds the path to
Bill Wohler <wohler@newt.com>
parents: 64085
diff changeset
365 ;;;###mh-autoload
4520ae2624f2 * mh-init.el (mh-image-load-path): New function that adds the path to
Bill Wohler <wohler@newt.com>
parents: 64085
diff changeset
366 (defun mh-image-load-path ()
4520ae2624f2 * mh-init.el (mh-image-load-path): New function that adds the path to
Bill Wohler <wohler@newt.com>
parents: 64085
diff changeset
367 "Ensure that the MH-E images are accessible by `find-image'.
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67681
diff changeset
368 Images for MH-E are found in ../../etc/images relative to the
67760
9c3504ae6060 Follow MH-E Developers Guide conventions. Use `' quotes for Help
Bill Wohler <wohler@newt.com>
parents: 67758
diff changeset
369 files in \"lisp/mh-e\". If `image-load-path' exists (since Emacs
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67681
diff changeset
370 22), then the images directory is added to it if isn't already
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67681
diff changeset
371 there. Otherwise, the images directory is added to the
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67681
diff changeset
372 `load-path' if it isn't already there."
66113
bfb1c3364c23 * mh-init.el (mh-image-load-path-called-flag): New variable which
Satyaki Das <satyaki@theforce.stanford.edu>
parents: 66087
diff changeset
373 (unless mh-image-load-path-called-flag
66136
aacff8293f4b (mh-image-load-path): Use locate-library to find MH-E. This simplified
Bill Wohler <wohler@newt.com>
parents: 66128
diff changeset
374 (let (mh-library-name mh-image-load-path)
66113
bfb1c3364c23 * mh-init.el (mh-image-load-path-called-flag): New variable which
Satyaki Das <satyaki@theforce.stanford.edu>
parents: 66087
diff changeset
375 ;; First, find mh-e in the load-path.
66136
aacff8293f4b (mh-image-load-path): Use locate-library to find MH-E. This simplified
Bill Wohler <wohler@newt.com>
parents: 66128
diff changeset
376 (setq mh-library-name (locate-library "mh-e"))
aacff8293f4b (mh-image-load-path): Use locate-library to find MH-E. This simplified
Bill Wohler <wohler@newt.com>
parents: 66128
diff changeset
377 (if (not mh-library-name)
aacff8293f4b (mh-image-load-path): Use locate-library to find MH-E. This simplified
Bill Wohler <wohler@newt.com>
parents: 66128
diff changeset
378 (error "Can not find MH-E in load-path"))
aacff8293f4b (mh-image-load-path): Use locate-library to find MH-E. This simplified
Bill Wohler <wohler@newt.com>
parents: 66128
diff changeset
379 (setq mh-image-load-path
aacff8293f4b (mh-image-load-path): Use locate-library to find MH-E. This simplified
Bill Wohler <wohler@newt.com>
parents: 66128
diff changeset
380 (expand-file-name (concat (file-name-directory mh-library-name)
aacff8293f4b (mh-image-load-path): Use locate-library to find MH-E. This simplified
Bill Wohler <wohler@newt.com>
parents: 66128
diff changeset
381 "../../etc/images")))
aacff8293f4b (mh-image-load-path): Use locate-library to find MH-E. This simplified
Bill Wohler <wohler@newt.com>
parents: 66128
diff changeset
382 (if (not (file-exists-p mh-image-load-path))
aacff8293f4b (mh-image-load-path): Use locate-library to find MH-E. This simplified
Bill Wohler <wohler@newt.com>
parents: 66128
diff changeset
383 (error "Can not find image directory %s" mh-image-load-path))
aacff8293f4b (mh-image-load-path): Use locate-library to find MH-E. This simplified
Bill Wohler <wohler@newt.com>
parents: 66128
diff changeset
384 (if (boundp 'image-load-path)
aacff8293f4b (mh-image-load-path): Use locate-library to find MH-E. This simplified
Bill Wohler <wohler@newt.com>
parents: 66128
diff changeset
385 (add-to-list 'image-load-path mh-image-load-path)
aacff8293f4b (mh-image-load-path): Use locate-library to find MH-E. This simplified
Bill Wohler <wohler@newt.com>
parents: 66128
diff changeset
386 (add-to-list 'load-path mh-image-load-path)))
66113
bfb1c3364c23 * mh-init.el (mh-image-load-path-called-flag): New variable which
Satyaki Das <satyaki@theforce.stanford.edu>
parents: 66087
diff changeset
387 (setq mh-image-load-path-called-flag t)))
65980
4520ae2624f2 * mh-init.el (mh-image-load-path): New function that adds the path to
Bill Wohler <wohler@newt.com>
parents: 64085
diff changeset
388
66716
25ad3e63f2a1 * mh-customize.el (mh-min-colors-defined-flag, mh-defface-compat):
Bill Wohler <wohler@newt.com>
parents: 66136
diff changeset
389
25ad3e63f2a1 * mh-customize.el (mh-min-colors-defined-flag, mh-defface-compat):
Bill Wohler <wohler@newt.com>
parents: 66136
diff changeset
390
68096
57c4e7929f99 * mh-alias.el (mh-alias-gecos-name): Use replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents: 68013
diff changeset
391 ;;; Support routines for mh-customize.el
57c4e7929f99 * mh-alias.el (mh-alias-gecos-name): Use replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents: 68013
diff changeset
392
66716
25ad3e63f2a1 * mh-customize.el (mh-min-colors-defined-flag, mh-defface-compat):
Bill Wohler <wohler@newt.com>
parents: 66136
diff changeset
393 (defvar mh-min-colors-defined-flag (and (not mh-xemacs-flag)
25ad3e63f2a1 * mh-customize.el (mh-min-colors-defined-flag, mh-defface-compat):
Bill Wohler <wohler@newt.com>
parents: 66136
diff changeset
394 (>= emacs-major-version 22))
25ad3e63f2a1 * mh-customize.el (mh-min-colors-defined-flag, mh-defface-compat):
Bill Wohler <wohler@newt.com>
parents: 66136
diff changeset
395 "Non-nil means defface supports min-colors display requirement.")
25ad3e63f2a1 * mh-customize.el (mh-min-colors-defined-flag, mh-defface-compat):
Bill Wohler <wohler@newt.com>
parents: 66136
diff changeset
396
25ad3e63f2a1 * mh-customize.el (mh-min-colors-defined-flag, mh-defface-compat):
Bill Wohler <wohler@newt.com>
parents: 66136
diff changeset
397 (defun mh-defface-compat (spec)
67245
4b8cea82e2d9 (mh-defface-compat): Checkdoc fix.
Bill Wohler <wohler@newt.com>
parents: 66716
diff changeset
398 "Convert SPEC for defface if necessary to run on older platforms.
67988
7882fc7df359 * mh-alias.el (mh-alias-grab-from-field): Remove leading * from
Bill Wohler <wohler@newt.com>
parents: 67969
diff changeset
399 Modifies SPEC in place and returns it. See `defface' for the spec definition.
66716
25ad3e63f2a1 * mh-customize.el (mh-min-colors-defined-flag, mh-defface-compat):
Bill Wohler <wohler@newt.com>
parents: 66136
diff changeset
400
68000
830e95c83d49 * mh-customize.el (mh-folder-msg-number): Snow is actually off-white
Bill Wohler <wohler@newt.com>
parents: 67988
diff changeset
401 When `mh-min-colors-defined-flag' is nil, this function finds
830e95c83d49 * mh-customize.el (mh-folder-msg-number): Snow is actually off-white
Bill Wohler <wohler@newt.com>
parents: 67988
diff changeset
402 display entries with \"min-colors\" requirements and either
830e95c83d49 * mh-customize.el (mh-folder-msg-number): Snow is actually off-white
Bill Wohler <wohler@newt.com>
parents: 67988
diff changeset
403 removes the \"min-colors\" requirement or strips the display
830e95c83d49 * mh-customize.el (mh-folder-msg-number): Snow is actually off-white
Bill Wohler <wohler@newt.com>
parents: 67988
diff changeset
404 entirely if the display does not support the number of specified
830e95c83d49 * mh-customize.el (mh-folder-msg-number): Snow is actually off-white
Bill Wohler <wohler@newt.com>
parents: 67988
diff changeset
405 colors."
830e95c83d49 * mh-customize.el (mh-folder-msg-number): Snow is actually off-white
Bill Wohler <wohler@newt.com>
parents: 67988
diff changeset
406 (if mh-min-colors-defined-flag
830e95c83d49 * mh-customize.el (mh-folder-msg-number): Snow is actually off-white
Bill Wohler <wohler@newt.com>
parents: 67988
diff changeset
407 spec
830e95c83d49 * mh-customize.el (mh-folder-msg-number): Snow is actually off-white
Bill Wohler <wohler@newt.com>
parents: 67988
diff changeset
408 (let ((cells (display-color-cells))
830e95c83d49 * mh-customize.el (mh-folder-msg-number): Snow is actually off-white
Bill Wohler <wohler@newt.com>
parents: 67988
diff changeset
409 new-spec)
830e95c83d49 * mh-customize.el (mh-folder-msg-number): Snow is actually off-white
Bill Wohler <wohler@newt.com>
parents: 67988
diff changeset
410 ;; Remove entries with min-colors, or delete them if we have fewer colors
830e95c83d49 * mh-customize.el (mh-folder-msg-number): Snow is actually off-white
Bill Wohler <wohler@newt.com>
parents: 67988
diff changeset
411 ;; than they specify.
830e95c83d49 * mh-customize.el (mh-folder-msg-number): Snow is actually off-white
Bill Wohler <wohler@newt.com>
parents: 67988
diff changeset
412 (loop for entry in (reverse spec) do
830e95c83d49 * mh-customize.el (mh-folder-msg-number): Snow is actually off-white
Bill Wohler <wohler@newt.com>
parents: 67988
diff changeset
413 (let ((requirement (if (eq (car entry) t)
830e95c83d49 * mh-customize.el (mh-folder-msg-number): Snow is actually off-white
Bill Wohler <wohler@newt.com>
parents: 67988
diff changeset
414 nil
830e95c83d49 * mh-customize.el (mh-folder-msg-number): Snow is actually off-white
Bill Wohler <wohler@newt.com>
parents: 67988
diff changeset
415 (assoc 'min-colors (car entry)))))
830e95c83d49 * mh-customize.el (mh-folder-msg-number): Snow is actually off-white
Bill Wohler <wohler@newt.com>
parents: 67988
diff changeset
416 (if requirement
830e95c83d49 * mh-customize.el (mh-folder-msg-number): Snow is actually off-white
Bill Wohler <wohler@newt.com>
parents: 67988
diff changeset
417 (when (>= cells (nth 1 requirement))
830e95c83d49 * mh-customize.el (mh-folder-msg-number): Snow is actually off-white
Bill Wohler <wohler@newt.com>
parents: 67988
diff changeset
418 (setq new-spec (cons (cons (delq requirement (car entry))
830e95c83d49 * mh-customize.el (mh-folder-msg-number): Snow is actually off-white
Bill Wohler <wohler@newt.com>
parents: 67988
diff changeset
419 (cdr entry))
830e95c83d49 * mh-customize.el (mh-folder-msg-number): Snow is actually off-white
Bill Wohler <wohler@newt.com>
parents: 67988
diff changeset
420 new-spec)))
830e95c83d49 * mh-customize.el (mh-folder-msg-number): Snow is actually off-white
Bill Wohler <wohler@newt.com>
parents: 67988
diff changeset
421 (setq new-spec (cons entry new-spec)))))
830e95c83d49 * mh-customize.el (mh-folder-msg-number): Snow is actually off-white
Bill Wohler <wohler@newt.com>
parents: 67988
diff changeset
422 new-spec)))
67245
4b8cea82e2d9 (mh-defface-compat): Checkdoc fix.
Bill Wohler <wohler@newt.com>
parents: 66716
diff changeset
423
56676
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
424 (provide 'mh-init)
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
425
67681
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 67449
diff changeset
426 ;; Local Variables:
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 67449
diff changeset
427 ;; indent-tabs-mode: nil
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 67449
diff changeset
428 ;; sentence-end-double-space: nil
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 67449
diff changeset
429 ;; End:
56676
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
430
56677
5aafbbdd005f Add arch taglines
Miles Bader <miles@gnu.org>
parents: 56676
diff changeset
431 ;; arch-tag: e8372aeb-d803-42b1-9c95-3c93ad22f63c
56676
db6d7638a259 Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
432 ;;; mh-init.el ends here