emacs-commit
[Top][All Lists]
Advanced

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

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


From: Bill Wohler
Subject: [Emacs-commit] emacs/lisp/mh-e mh-compat.el ChangeLog
Date: Sat, 11 Mar 2006 01:59:13 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Branch:         
Changes by:     Bill Wohler <address@hidden>    06/03/11 01:59:13

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

Log message:
        (mh-image-load-path-for-library): Merged changes from Reiner. Add
        no-error argument. If path t, just return directory.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/emacs/lisp/mh-e/mh-compat.el.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/emacs/emacs/lisp/mh-e/ChangeLog.diff?tr1=1.178&tr2=1.179&r1=text&r2=text

Patches:
Index: emacs/lisp/mh-e/ChangeLog
diff -u emacs/lisp/mh-e/ChangeLog:1.178 emacs/lisp/mh-e/ChangeLog:1.179
--- emacs/lisp/mh-e/ChangeLog:1.178     Sat Mar 11 01:34:45 2006
+++ emacs/lisp/mh-e/ChangeLog   Sat Mar 11 01:59:13 2006
@@ -4,6 +4,8 @@
        flag to replace-in-string. This was badly needed by
        mh-quote-pick-expr in order to properly quote subjects when using
        / s on XEmacs (closes SF #1447598).
+       (mh-image-load-path-for-library): Merged changes from Reiner. Add
+       no-error argument. If path t, just return directory.
 
        * mh-e.el (mh-profile-component): Drop `s' from mhparam
        -components for Mailutils compatibility (closes SF #1446985).
Index: emacs/lisp/mh-e/mh-compat.el
diff -u emacs/lisp/mh-e/mh-compat.el:1.10 emacs/lisp/mh-e/mh-compat.el:1.11
--- emacs/lisp/mh-e/mh-compat.el:1.10   Sat Mar 11 01:34:45 2006
+++ emacs/lisp/mh-e/mh-compat.el        Sat Mar 11 01:59:13 2006
@@ -116,7 +116,7 @@
     `(face-background ,face ,frame ,inherit)))
 
 (mh-defun-compat mh-image-load-path-for-library
-  image-load-path-for-library (library image &optional path)
+  image-load-path-for-library (library image &optional path no-error)
   "Return a suitable search path for images relative to LIBRARY.
 
 Images for LIBRARY are searched for in \"../../etc/images\" and
@@ -124,8 +124,12 @@
 well as in `image-load-path' and `load-path'.
 
 This function returns the value of `load-path' augmented with the
-path to IMAGE. If PATH is given, it is used instead of
-`load-path'.
+directory containing IMAGE. If PATH is given, it is used instead
+of `load-path'. If PATH is t, just return the directory that
+contains IMAGE.
+
+If NO-ERROR is non-nil, return nil if a suitable path can't be
+found rather than signaling an error.
 
 Here is an example that uses a common idiom to provide
 compatibility with versions of Emacs that lack the variable
@@ -179,11 +183,19 @@
                  (setq img (directory-file-name parent)
                        dir (expand-file-name "../" dir)))
                (setq image-directory dir)))))
+     (no-error
+      ;; In this case we will return nil.
+      (message "Could not find image %s for library %s" image library))
      (t
       (error "Could not find image %s for library %s" image library)))
 
-    ;; Return augmented `image-load-path' or `load-path'.
-    (cond ((and path (symbolp path))
+    ;; Return the directory, nil if no-error was non-nil and a
+    ;; suitable path could not be found, or an augmented
+    ;; `image-load-path' or `load-path'.
+    (cond ((or (null image-directory)
+               (eq path t))
+           image-directory)
+          ((and path (symbolp path))
            (nconc (list image-directory)
                   (delete image-directory
                           (if (boundp path)




reply via email to

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