emacs-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-commit] emacs/lisp/mh-e ChangeLog mh-utils.el mh-compat.el


From: Peter Galbraith
Subject: [Emacs-commit] emacs/lisp/mh-e ChangeLog mh-utils.el mh-compat.el
Date: Thu, 16 Feb 2006 02:14:41 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Branch:         
Changes by:     Peter Galbraith <address@hidden>        06/02/16 02:14:40

Modified files:
        lisp/mh-e      : ChangeLog mh-utils.el mh-compat.el 

Log message:
        mh-compat.el (mh-image-search-load-path): Compatibility code.  Emacs 21 
and
        XEmacs don't have `image-search-load-path'.
        
        mh-utils.el (mh-image-load-path): Don't bail out on error if the images 
are
        already found.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/emacs/lisp/mh-e/ChangeLog.diff?tr1=1.149&tr2=1.150&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/emacs/emacs/lisp/mh-e/mh-utils.el.diff?tr1=1.49&tr2=1.50&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/emacs/emacs/lisp/mh-e/mh-compat.el.diff?tr1=1.6&tr2=1.7&r1=text&r2=text

Patches:
Index: emacs/lisp/mh-e/ChangeLog
diff -u emacs/lisp/mh-e/ChangeLog:1.149 emacs/lisp/mh-e/ChangeLog:1.150
--- emacs/lisp/mh-e/ChangeLog:1.149     Fri Feb 10 20:04:50 2006
+++ emacs/lisp/mh-e/ChangeLog   Thu Feb 16 02:14:40 2006
@@ -1,3 +1,11 @@
+2006-02-15  Peter S Galbraith  <address@hidden>
+
+       * mh-compat.el (mh-image-search-load-path): Compatibility code.
+       Emacs 21 and XEmacs don't have `image-search-load-path'.
+
+       * mh-utils.el (mh-image-load-path): Don't bail out on error if the
+       images are already found.
+
 2006-02-10  Bill Wohler  <address@hidden>
 
        * mh-search.el (mh-search): Wrap code in (block mh-search ...)
Index: emacs/lisp/mh-e/mh-compat.el
diff -u emacs/lisp/mh-e/mh-compat.el:1.6 emacs/lisp/mh-e/mh-compat.el:1.7
--- emacs/lisp/mh-e/mh-compat.el:1.6    Thu Feb  9 19:06:33 2006
+++ emacs/lisp/mh-e/mh-compat.el        Thu Feb 16 02:14:40 2006
@@ -115,6 +115,12 @@
       `(face-background ,face ,frame)
     `(face-background ,face ,frame ,inherit)))
 
+(mh-defun-compat mh-image-search-load-path
+  image-search-load-path (file &optional path)
+  "Emacs 21 and XEmacs don't have `image-search-load-path'.
+This function returns nil on those systems."
+  nil)
+
 ;; For XEmacs.
 (defalias 'mh-line-beginning-position
   (if (fboundp 'line-beginning-position)
@@ -131,7 +137,7 @@
 (mh-defun-compat mh-mail-abbrev-make-syntax-table
   mail-abbrev-make-syntax-table ()
   "Emacs 21 and XEmacs don't have `mail-abbrev-make-syntax-table'.
-This function does nothing on those systems."
+This function returns nil on those systems."
   nil)
 
 (mh-defun-compat mh-match-string-no-properties
Index: emacs/lisp/mh-e/mh-utils.el
diff -u emacs/lisp/mh-e/mh-utils.el:1.49 emacs/lisp/mh-e/mh-utils.el:1.50
--- emacs/lisp/mh-e/mh-utils.el:1.49    Thu Feb  9 19:53:44 2006
+++ emacs/lisp/mh-e/mh-utils.el Thu Feb 16 02:14:40 2006
@@ -109,21 +109,41 @@
 
 See also variable `mh-image-load-path-called-flag'."
   (unless mh-image-load-path-called-flag
-    (if (or (not mh-image-load-path)
-            (not (file-exists-p mh-image-load-path)))
-        (let (mh-library-name)
-          ;; First, find mh-e in the 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))
+    (cond
+     ((and mh-image-load-path
+           (file-exists-p (expand-file-name "mh-logo.xpm"
+                                            mh-image-load-path))))
+      ;; User setting exists. We're done.
+     ((and mh-image-load-path
+           (not (file-exists-p (expand-file-name "mh-logo.xpm"
+                                                 mh-image-load-path))))
+      ;; User setting does not exist.
+      (message "Variable mh-image-load-path %s does not contain MH-E images"
+               mh-image-load-path))
+     ((mh-image-search-load-path "mh-logo.xpm")
+      ;; Emacs 22 already knows where the images are.
+      (setq mh-image-load-path
+           (file-name-directory (mh-image-search-load-path "mh-logo.xpm"))))
+     ((locate-library "mh-logo.xpm")
+      ;; Other Emacs already knows where the images are...
+      (setq mh-image-load-path
+           (file-name-directory (locate-library "mh-logo.xpm"))))
+     (t      
+      ;; Guess `mh-image-load-path' if it wasn't provided by the user.
+      (let (mh-library-name)
+        ;; First, find mh-e in the 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)))
 
 ;;;###mh-autoload




reply via email to

[Prev in Thread] Current Thread [Next in Thread]