aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/mh-e/ChangeLog8
-rw-r--r--lisp/mh-e/mh-compat.el8
-rw-r--r--lisp/mh-e/mh-utils.el50
3 files changed, 50 insertions, 16 deletions
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index 349bae9f072..3dcf689767a 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,11 @@
12006-02-15 Peter S Galbraith <psg@debian.org>
2
3 * mh-compat.el (mh-image-search-load-path): Compatibility code.
4 Emacs 21 and XEmacs don't have `image-search-load-path'.
5
6 * mh-utils.el (mh-image-load-path): Don't bail out on error if the
7 images are already found.
8
12006-02-10 Bill Wohler <wohler@newt.com> 92006-02-10 Bill Wohler <wohler@newt.com>
2 10
3 * mh-search.el (mh-search): Wrap code in (block mh-search ...) 11 * mh-search.el (mh-search): Wrap code in (block mh-search ...)
diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el
index 090ee51c5fc..4bc5fdf36f7 100644
--- a/lisp/mh-e/mh-compat.el
+++ b/lisp/mh-e/mh-compat.el
@@ -115,6 +115,12 @@ introduced in Emacs 22."
115 `(face-background ,face ,frame) 115 `(face-background ,face ,frame)
116 `(face-background ,face ,frame ,inherit))) 116 `(face-background ,face ,frame ,inherit)))
117 117
118(mh-defun-compat mh-image-search-load-path
119 image-search-load-path (file &optional path)
120 "Emacs 21 and XEmacs don't have `image-search-load-path'.
121This function returns nil on those systems."
122 nil)
123
118;; For XEmacs. 124;; For XEmacs.
119(defalias 'mh-line-beginning-position 125(defalias 'mh-line-beginning-position
120 (if (fboundp 'line-beginning-position) 126 (if (fboundp 'line-beginning-position)
@@ -131,7 +137,7 @@ introduced in Emacs 22."
131(mh-defun-compat mh-mail-abbrev-make-syntax-table 137(mh-defun-compat mh-mail-abbrev-make-syntax-table
132 mail-abbrev-make-syntax-table () 138 mail-abbrev-make-syntax-table ()
133 "Emacs 21 and XEmacs don't have `mail-abbrev-make-syntax-table'. 139 "Emacs 21 and XEmacs don't have `mail-abbrev-make-syntax-table'.
134This function does nothing on those systems." 140This function returns nil on those systems."
135 nil) 141 nil)
136 142
137(mh-defun-compat mh-match-string-no-properties 143(mh-defun-compat mh-match-string-no-properties
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el
index dc86d19ae77..bf0d29fd2a7 100644
--- a/lisp/mh-e/mh-utils.el
+++ b/lisp/mh-e/mh-utils.el
@@ -109,21 +109,41 @@ already there.
109 109
110See also variable `mh-image-load-path-called-flag'." 110See also variable `mh-image-load-path-called-flag'."
111 (unless mh-image-load-path-called-flag 111 (unless mh-image-load-path-called-flag
112 (if (or (not mh-image-load-path) 112 (cond
113 (not (file-exists-p mh-image-load-path))) 113 ((and mh-image-load-path
114 (let (mh-library-name) 114 (file-exists-p (expand-file-name "mh-logo.xpm"
115 ;; First, find mh-e in the load-path. 115 mh-image-load-path))))
116 (setq mh-library-name (locate-library "mh-e")) 116 ;; User setting exists. We're done.
117 (if (not mh-library-name) 117 ((and mh-image-load-path
118 (error "Can not find MH-E in load-path")) 118 (not (file-exists-p (expand-file-name "mh-logo.xpm"
119 (setq mh-image-load-path 119 mh-image-load-path))))
120 (expand-file-name (concat (file-name-directory mh-library-name) 120 ;; User setting does not exist.
121 "../../etc/images"))))) 121 (message "Variable mh-image-load-path %s does not contain MH-E images"
122 (if (not (file-exists-p mh-image-load-path)) 122 mh-image-load-path))
123 (error "Can not find image directory %s" mh-image-load-path)) 123 ((mh-image-search-load-path "mh-logo.xpm")
124 (if (boundp 'image-load-path) 124 ;; Emacs 22 already knows where the images are.
125 (add-to-list 'image-load-path mh-image-load-path) 125 (setq mh-image-load-path
126 (add-to-list 'load-path mh-image-load-path)) 126 (file-name-directory (mh-image-search-load-path "mh-logo.xpm"))))
127 ((locate-library "mh-logo.xpm")
128 ;; Other Emacs already knows where the images are...
129 (setq mh-image-load-path
130 (file-name-directory (locate-library "mh-logo.xpm"))))
131 (t
132 ;; Guess `mh-image-load-path' if it wasn't provided by the user.
133 (let (mh-library-name)
134 ;; First, find mh-e in the load-path.
135 (setq mh-library-name (locate-library "mh-e"))
136 (if (not mh-library-name)
137 (error "Can not find MH-E in load-path"))
138 (setq mh-image-load-path
139 (expand-file-name (concat
140 (file-name-directory mh-library-name)
141 "../../etc/images"))))
142 (if (not (file-exists-p mh-image-load-path))
143 (error "Can not find image directory %s" mh-image-load-path))
144 (if (boundp 'image-load-path)
145 (add-to-list 'image-load-path mh-image-load-path)
146 (add-to-list 'load-path mh-image-load-path))))
127 (setq mh-image-load-path-called-flag t))) 147 (setq mh-image-load-path-called-flag t)))
128 148
129;;;###mh-autoload 149;;;###mh-autoload