diff options
| author | Bill Wohler | 2006-02-03 23:02:51 +0000 |
|---|---|---|
| committer | Bill Wohler | 2006-02-03 23:02:51 +0000 |
| commit | 664ca6b28af4ca6db5ee0329f558492bdb9a8fb9 (patch) | |
| tree | 5fd7f4f7378986d60fbdddfbb2b82c34bd327d4f | |
| parent | 36685bffc76ff8a9469a4bbfb3720b4dbe4fe875 (diff) | |
| download | emacs-664ca6b28af4ca6db5ee0329f558492bdb9a8fb9.tar.gz emacs-664ca6b28af4ca6db5ee0329f558492bdb9a8fb9.zip | |
(mh-image-load-path, mh-image-load-path-called-flag)
(mh-image-load-path): Checkdoc fix. Docstring edits. Reduce scope of
local variable mh-library-name.
| -rw-r--r-- | lisp/mh-e/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/mh-e/mh-utils.el | 58 |
2 files changed, 39 insertions, 23 deletions
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index 9cb939b7c71..35998a24eac 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2006-02-03 Bill Wohler <wohler@newt.com> | 1 | 2006-02-03 Bill Wohler <wohler@newt.com> |
| 2 | 2 | ||
| 3 | * mh-utils.el (mh-image-load-path, mh-image-load-path-called-flag) | ||
| 4 | (mh-image-load-path): Checkdoc fix. Docstring edits. Reduce scope | ||
| 5 | of local variable mh-library-name. | ||
| 6 | |||
| 3 | * mh-e.el (mh-folder-msg-number, mh-folder-refiled, mh-folder-to) | 7 | * mh-e.el (mh-folder-msg-number, mh-folder-refiled, mh-folder-to) |
| 4 | (mh-show-cc, mh-show-date, mh-show-header): Replace (min-colors | 8 | (mh-show-cc, mh-show-date, mh-show-header): Replace (min-colors |
| 5 | 88) with (min-colors 64) in face specifications so that MH-E still | 9 | 88) with (min-colors 64) in face specifications so that MH-E still |
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el index 54e293cc950..42f11376262 100644 --- a/lisp/mh-e/mh-utils.el +++ b/lisp/mh-e/mh-utils.el | |||
| @@ -83,35 +83,47 @@ used in lieu of `search' in the CL package." | |||
| 83 | 83 | ||
| 84 | (defvar mh-image-load-path nil | 84 | (defvar mh-image-load-path nil |
| 85 | "Directory where images for MH-E are found. | 85 | "Directory where images for MH-E are found. |
| 86 | If nil, then the function mh-image-load-path will search in | 86 | If nil, then the function `mh-image-load-path' will search for |
| 87 | ../../etc/images relative to the files in \"lisp/mh-e\".") | 87 | the images in \"../../etc/images\" relative to the files in |
| 88 | \"lisp/mh-e\".") | ||
| 88 | 89 | ||
| 89 | (defvar mh-image-load-path-called-flag nil) | 90 | (defvar mh-image-load-path-called-flag nil |
| 91 | "Non-nil means that the function `mh-image-load-path' has been called. | ||
| 92 | This variable is used by that function to avoid doing the work repeatedly.") | ||
| 90 | 93 | ||
| 91 | ;;;###mh-autoload | 94 | ;;;###mh-autoload |
| 92 | (defun mh-image-load-path () | 95 | (defun mh-image-load-path () |
| 93 | "Ensure that the MH-E images are accessible by `find-image'. | 96 | "Ensure that the MH-E images are accessible by `find-image'. |
| 94 | Images for MH-E are found in ../../etc/images relative to the | 97 | |
| 95 | files in \"lisp/mh-e\". If `image-load-path' exists (since Emacs | 98 | Images for MH-E are found in \"../../etc/images\" relative to the |
| 96 | 22), then the images directory is added to it if isn't already | 99 | files in \"lisp/mh-e\". This function saves the actual location |
| 97 | there. Otherwise, the images directory is added to the | 100 | found in the variable `mh-image-load-path'. If the images on your |
| 98 | `load-path' if it isn't already there." | 101 | system are actually located elsewhere, then set the variable |
| 102 | `mh-image-load-path' before starting MH-E. | ||
| 103 | |||
| 104 | If `image-load-path' exists (since Emacs 22), then the contents | ||
| 105 | of the variable `mh-image-load-path' is added to it if isn't | ||
| 106 | already there. Otherwise, the contents of the variable | ||
| 107 | `mh-image-load-path' is added to the `load-path' if it isn't | ||
| 108 | already there. | ||
| 109 | |||
| 110 | See also variable `mh-image-load-path-called-flag'." | ||
| 99 | (unless mh-image-load-path-called-flag | 111 | (unless mh-image-load-path-called-flag |
| 100 | (let (mh-library-name) | 112 | (if (or (not mh-image-load-path) |
| 101 | (when (or (not mh-image-load-path) | 113 | (not (file-exists-p mh-image-load-path))) |
| 102 | (not (file-exists-p mh-image-load-path))) | 114 | (let (mh-library-name) |
| 103 | ;; First, find mh-e in the load-path. | 115 | ;; First, find mh-e in the load-path. |
| 104 | (setq mh-library-name (locate-library "mh-e")) | 116 | (setq mh-library-name (locate-library "mh-e")) |
| 105 | (if (not mh-library-name) | 117 | (if (not mh-library-name) |
| 106 | (error "Can not find MH-E in load-path")) | 118 | (error "Can not find MH-E in load-path")) |
| 107 | (setq mh-image-load-path | 119 | (setq mh-image-load-path |
| 108 | (expand-file-name (concat (file-name-directory mh-library-name) | 120 | (expand-file-name (concat (file-name-directory mh-library-name) |
| 109 | "../../etc/images")))) | 121 | "../../etc/images"))))) |
| 110 | (if (not (file-exists-p mh-image-load-path)) | 122 | (if (not (file-exists-p mh-image-load-path)) |
| 111 | (error "Can not find image directory %s" mh-image-load-path)) | 123 | (error "Can not find image directory %s" mh-image-load-path)) |
| 112 | (if (boundp 'image-load-path) | 124 | (if (boundp 'image-load-path) |
| 113 | (add-to-list 'image-load-path mh-image-load-path) | 125 | (add-to-list 'image-load-path mh-image-load-path) |
| 114 | (add-to-list 'load-path mh-image-load-path))) | 126 | (add-to-list 'load-path mh-image-load-path)) |
| 115 | (setq mh-image-load-path-called-flag t))) | 127 | (setq mh-image-load-path-called-flag t))) |
| 116 | 128 | ||
| 117 | ;;;###mh-autoload | 129 | ;;;###mh-autoload |