aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wohler2006-02-28 21:47:19 +0000
committerBill Wohler2006-02-28 21:47:19 +0000
commita9e22173e4c6e696f394465db7c7bbb8058d2cfa (patch)
tree1fea4c1ca103a02a5c1771c9d439dda04f3a06d7
parente9cee67e3e1ab331f8b1b940b4ea3f057db2840e (diff)
downloademacs-a9e22173e4c6e696f394465db7c7bbb8058d2cfa.tar.gz
emacs-a9e22173e4c6e696f394465db7c7bbb8058d2cfa.zip
(mh-image-load-path): Rename variable to mh-image-directory.
(mh-image-load-path): Access mh-image-directory instead of mh-image-load-path.
-rw-r--r--lisp/mh-e/ChangeLog7
-rw-r--r--lisp/mh-e/mh-utils.el38
2 files changed, 26 insertions, 19 deletions
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index bf45042ecf2..84d9c0ada57 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,10 @@
12006-02-28 Bill Wohler <wohler@newt.com>
2
3 * mh-utils.el (mh-image-load-path): Rename variable to
4 mh-image-directory.
5 (mh-image-load-path): Access mh-image-directory instead of
6 mh-image-load-path.
7
12006-02-27 Bill Wohler <wohler@newt.com> 82006-02-27 Bill Wohler <wohler@newt.com>
2 9
3 * mh-e.el (mh-default-folder-for-message-function): Sync docstring 10 * mh-e.el (mh-default-folder-for-message-function): Sync docstring
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el
index c00558860d1..f09763ba9f5 100644
--- a/lisp/mh-e/mh-utils.el
+++ b/lisp/mh-e/mh-utils.el
@@ -81,7 +81,7 @@ used in lieu of `search' in the CL package."
81 "Delete the next LINES lines." 81 "Delete the next LINES lines."
82 (delete-region (point) (progn (forward-line lines) (point)))) 82 (delete-region (point) (progn (forward-line lines) (point))))
83 83
84(defvar mh-image-load-path nil 84(defvar mh-image-directory nil
85 "Directory where images for MH-E are found. 85 "Directory where images for MH-E are found.
86If nil, then the function `mh-image-load-path' will search for 86If nil, then the function `mh-image-load-path' will search for
87the images in \"../../etc/images\" relative to the files in 87the images in \"../../etc/images\" relative to the files in
@@ -98,50 +98,50 @@ This variable is used by that function to avoid doing the work repeatedly.")
98Images for MH-E are found in \"../../etc/images\" relative to the 98Images for MH-E are found in \"../../etc/images\" relative to the
99files in \"lisp/mh-e\", in `image-load-path', or in `load-path'. 99files in \"lisp/mh-e\", in `image-load-path', or in `load-path'.
100This function saves the actual location found in the variable 100This function saves the actual location found in the variable
101`mh-image-load-path'. If the images on your system are actually 101`mh-image-directory'. If the images on your system are actually
102located elsewhere, then set the variable `mh-image-load-path' 102located elsewhere, then set the variable `mh-image-directory'
103before starting MH-E. 103before starting MH-E.
104 104
105If `image-load-path' exists (since Emacs 22), then the contents 105If `image-load-path' exists (since Emacs 22), then the contents
106of the variable `mh-image-load-path' is added to it if isn't 106of the variable `mh-image-directory' is added to it if isn't
107already there. Otherwise, the contents of the variable 107already there. Otherwise, the contents of the variable
108`mh-image-load-path' is added to the `load-path' if it isn't 108`mh-image-directory' is added to the `load-path' if it isn't
109already there. 109already there.
110 110
111See also variable `mh-image-load-path-called-flag'." 111See also variable `mh-image-load-path-called-flag'."
112 (unless mh-image-load-path-called-flag 112 (unless mh-image-load-path-called-flag
113 (cond 113 (cond
114 (mh-image-load-path) ; user setting exists 114 (mh-image-directory) ; user setting exists
115 ((let (mh-library-name) ; try relative setting 115 ((let (mh-library-name) ; try relative setting
116 ;; First, find mh-e in the load-path. 116 ;; First, find mh-e in the load-path.
117 (setq mh-library-name (locate-library "mh-e")) 117 (setq mh-library-name (locate-library "mh-e"))
118 (if (not mh-library-name) 118 (if (not mh-library-name)
119 (error "Can not find MH-E in load-path")) 119 (error "Can not find MH-E in load-path"))
120 ;; And then set mh-image-load-path relative to that. 120 ;; And then set mh-image-directory relative to that.
121 (setq mh-image-load-path 121 (setq mh-image-directory
122 (expand-file-name (concat 122 (expand-file-name (concat
123 (file-name-directory mh-library-name) 123 (file-name-directory mh-library-name)
124 "../../etc/images"))) 124 "../../etc/images")))
125 (file-exists-p (expand-file-name "mh-logo.xpm" mh-image-load-path)))) 125 (file-exists-p (expand-file-name "mh-logo.xpm" mh-image-directory))))
126 ((mh-image-search-load-path "mh-logo.xpm") 126 ((mh-image-search-load-path "mh-logo.xpm")
127 ;; Images in image-load-path. 127 ;; Images in image-load-path.
128 (setq mh-image-load-path 128 (setq mh-image-directory
129 (file-name-directory (mh-image-search-load-path "mh-logo.xpm")))) 129 (file-name-directory (mh-image-search-load-path "mh-logo.xpm"))))
130 ((locate-library "mh-logo.xpm") 130 ((locate-library "mh-logo.xpm")
131 ;; Images in load-path. 131 ;; Images in load-path.
132 (setq mh-image-load-path 132 (setq mh-image-directory
133 (file-name-directory (locate-library "mh-logo.xpm"))))) 133 (file-name-directory (locate-library "mh-logo.xpm")))))
134 134
135 (if (not (file-exists-p mh-image-load-path)) 135 (if (not (file-exists-p mh-image-directory))
136 (error "Directory %s in mh-image-load-path does not exist" 136 (error "Directory %s in mh-image-directory does not exist"
137 mh-image-load-path)) 137 mh-image-directory))
138 (if (not (file-exists-p 138 (if (not (file-exists-p
139 (expand-file-name "mh-logo.xpm" mh-image-load-path))) 139 (expand-file-name "mh-logo.xpm" mh-image-directory)))
140 (error "Directory %s in mh-image-load-path does not contain MH-E images" 140 (error "Directory %s in mh-image-directory does not contain MH-E images"
141 mh-image-load-path)) 141 mh-image-directory))
142 (if (boundp 'image-load-path) 142 (if (boundp 'image-load-path)
143 (add-to-list 'image-load-path mh-image-load-path) 143 (add-to-list 'image-load-path mh-image-directory)
144 (add-to-list 'load-path mh-image-load-path)) 144 (add-to-list 'load-path mh-image-directory))
145 145
146 (setq mh-image-load-path-called-flag t))) 146 (setq mh-image-load-path-called-flag t)))
147 147