From: Bill Wohler <wohler@newt.com>
Cc: mh-e-devel@lists.sourceforge.net
Subject: *image-load-path-for-library update
Date: Fri, 10 Mar 2006 18:12:32 -0800 [thread overview]
Message-ID: <13961.1142043152@olgas.newt.com> (raw)
In-Reply-To: <v9fylp4zwh.fsf@marauder.physik.uni-ulm.de>
[-- Attachment #1: Type: text/plain, Size: 566 bytes --]
Reiner Steib <reinersteib+gmane@imap.cc> wrote:
> Bill, I'd suggest that you merge the latest changes[1] in
> *image-load-path-for-library from lisp/gmm-utils.el into your version
> and add it to `image.el'.
Reiner,
I liked these changes. Thanks!
I edited the docstrings a bit, replaced the gmm-message with just
message for both MH-E and Emacs, and made the return code more explicit
in the case when no-error is t and there is an error. Hope those look
good to you. I've checked in these changes to CVS Emacs.
Here's a patch for your review and convenience.
[-- Attachment #2: image-load-path-for-library patch --]
[-- Type: text/plain, Size: 1983 bytes --]
--- mh-compat.el.orig 2006-03-10 17:36:49.000000000 -0800
+++ mh-compat.el 2006-03-10 17:54:48.000000000 -0800
@@ -124,12 +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'. If PATH is t, return a single image directory
-instead of a 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, don't signal an error if no suitable path
-for can be found.
+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
@@ -184,16 +184,19 @@
dir (expand-file-name "../" dir)))
(setq image-directory dir)))))
(no-error
- ;; In this case we will return a nil element
- (gmm-message 1 "Could not find image %s for library %s" image library))
+ ;; 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 ((eq path t)
- image-directory)
- ((and path (symbolp path))
- (nconc (list image-directory)
+ ;; 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)
(copy-sequence (symbol-value path))
[-- Attachment #3: Type: text/plain, Size: 199 bytes --]
--
Bill Wohler <wohler@newt.com> http://www.newt.com/wohler/ GnuPG ID:610BD9AD
Maintainer of comp.mail.mh FAQ and MH-E. Vote Libertarian!
If you're passed on the right, you're in the wrong lane.
next prev parent reply other threads:[~2006-03-11 2:12 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-07 0:18 New GNOME icons Bill Wohler
2006-03-10 23:15 ` Bill Wohler
2006-03-10 23:56 ` Reiner Steib
2006-03-11 1:23 ` Bill Wohler
2006-03-11 1:29 ` Miles Bader
2006-03-11 12:48 ` Reiner Steib
2006-03-11 2:12 ` Bill Wohler [this message]
2006-03-11 11:33 ` *image-load-path-for-library update Reiner Steib
2006-03-11 22:53 ` Bill Wohler
2006-03-12 1:43 ` Bill Wohler
2006-03-12 2:00 ` Bill Wohler
2006-03-13 11:52 ` New GNOME icons Katsumi Yamaoka
2006-03-13 16:56 ` Bill Wohler
2006-03-14 5:32 ` Katsumi Yamaoka
2006-03-14 6:43 ` Bill Wohler
2006-03-14 11:57 ` Katsumi Yamaoka
2006-03-14 17:58 ` Bill Wohler
2006-03-15 1:49 ` Katsumi Yamaoka
2006-03-15 7:34 ` Katsumi Yamaoka
2006-03-15 7:58 ` Katsumi Yamaoka
2006-03-16 1:41 ` gmm-image-load-path-for-library redux (was: New GNOME icons) Bill Wohler
2006-03-16 2:04 ` gmm-image-load-path-for-library redux Katsumi Yamaoka
2006-03-16 7:24 ` Katsumi Yamaoka
2006-03-16 8:05 ` Bill Wohler
2006-03-16 17:41 ` Bill Wohler
2006-03-16 1:39 ` New GNOME icons Katsumi Yamaoka
2006-03-14 15:16 ` Reiner Steib
2006-03-14 19:29 ` Bill Wohler
2006-03-14 21:00 ` Reiner Steib
2006-03-14 21:35 ` Bill Wohler
2006-03-15 8:58 ` Reiner Steib
2006-03-15 12:10 ` Reiner Steib
2006-03-15 15:42 ` Bill Wohler
2006-03-15 16:40 ` defvars at compile time (was: New GNOME icons) Reiner Steib
2006-03-15 16:49 ` defvars at compile time Bill Wohler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=13961.1142043152@olgas.newt.com \
--to=wohler@newt.com \
--cc=mh-e-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).