(add-to-list 'mh-variants variant)))))
mh-variants)))
-;;; XXX The two calls to message in this function should really be calls to
-;;; error. However, when this function is compiled via the top-level call in
-;;; mh-customize.el, it is actually called, and in a compile environment, the
-;;; errors are triggered which botches the compile. As a workaround, the calls
-;;; to error have been changed to calls to message, and code following was
-;;; inserted as an else clause. This is not robust, so if you can fix this,
-;;; please do!
-
(defvar mh-image-load-path-called-flag nil)
;;;###mh-autoload
`lisp/mh-e'. If `image-load-path' exists (since Emacs 22), then the images
directory is added to it if isn't already there. Otherwise, the images
directory is added to the `load-path' if it isn't already there."
- (message "mh-image-load-path called") ;XXX: for debugging
(unless mh-image-load-path-called-flag
- (let (mh-load-path mh-image-load-path)
+ (let (mh-library-name mh-image-load-path)
;; First, find mh-e in the load-path.
- (setq mh-load-path
- (loop for dir in load-path
- for dir-name = (directory-file-name dir)
- when (and (equal (file-name-nondirectory dir-name) "mh-e")
- (file-exists-p dir-name))
- return dir-name))
- (if mh-load-path
- (setq mh-image-load-path
- (expand-file-name (concat (file-name-directory mh-load-path)
- "../etc/images")))
- (error "Can not find mh-e in load-path"))
- (cond ((or (not mh-image-load-path)
- (not (file-exists-p mh-image-load-path)))
- (error "Can not find image directory %s"
- mh-image-load-path))
- ((boundp 'image-load-path)
- (unless (member mh-image-load-path image-load-path)
- (push mh-image-load-path image-load-path)))
- ((not (member mh-image-load-path load-path))
- (push mh-image-load-path load-path))))
+ (setq mh-library-name (locate-library "mh-e"))
+ (if (not mh-library-name)
+ (error "Can not find MH-E in load-path"))
+ (setq mh-image-load-path
+ (expand-file-name (concat (file-name-directory mh-library-name)
+ "../../etc/images")))
+ (if (not (file-exists-p mh-image-load-path))
+ (error "Can not find image directory %s" mh-image-load-path))
+ (if (boundp 'image-load-path)
+ (add-to-list 'image-load-path mh-image-load-path)
+ (add-to-list 'load-path mh-image-load-path)))
(setq mh-image-load-path-called-flag t)))
(provide 'mh-init)