[Top][All Lists]

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

[AUCTeX-devel] Re: Toolbar icons from old directory

From: Reiner Steib
Subject: [AUCTeX-devel] Re: Toolbar icons from old directory
Date: Sat, 31 Mar 2007 13:19:27 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.96 (gnu/linux)

On Sat, Mar 31 2007, Ralf Angeli wrote:

> * Reiner Steib (2007-03-28) writes:
>> `image-load-path' may contain symbols (see above).  I doubt that
>> `toolbarx-find-image' can handle these correctly.
> Those could be evaluated when adding them to `toolbarx-image-path'.
> But that would mean toolbar-x would not see changes to those variables
> after their values got appended to `toolbarx-image-path'.  So we would
> really have to make toolbar-x aware of such variables. /c:

AFAICS, `toolbarx-image-path' is only used in `toolbarx-find-image'.

>> Additionally, Emacs 21 and XEmacs don't have `image-load-path' so
>> you'd have to add some additional checks.
> That would be trivial.


>> IIRC my "even more ugly hack" (rev. 1.9, Oct. 2005) handled a
>> non-default `image-load-path' correctly (because it used Emacs'
>> `find-image').  But David didn't like it.
> I fail to see him not liking it.  He just gave hints regarding
> possible culprits.

I still don't understand David's concerns about `load-path':

| Reiner wrote:
| > David wrote:
| [ code:
|   (let ((load-path toolbarx-image-path))
|     [...]
|     (find-image `((:type xpm :file ,(concat name ".xpm")) [...]))) ]
| >> And just _how_ is this autoloaded Lisp function going to be found when
| >> load-path gets pointed elsewhere?
| >
| > How did you manage _not_ to load `image' with a tool bar present?

Implementation details left aside, I think that it would be favorable
to use `find-image' (if available) instead of `locate-library'.

>> Maybe it's useful to look at `gnus/gmm-utils.el' [...]
> gmm-utils.el is fairly new.

Yes, it's not present in Emacs 21 or XEmacs without Gnus and MH-E (->

> We'd have to copy the code.  Not good.

_If_ it's suitable for AUCTeX (I'm not sure about this, see the doc
string[1]), we only need two functions ([gmm-]image-search-load-path,
[gmm-]image-load-path-for-library; see `image.el' in Emacs 22).  These
are only aliases in Emacs 22.  In other Emacsen (Emacs 21, XEmacs),
compatibility code is provided.  Using (a copy of) the standard Emacs
code doesn't sound too bad to me.

Bye, Reiner.

,----[ <f1> f image-load-path-for-library RET ]
| image-load-path-for-library is a compiled Lisp function in `image.el'.
| (image-load-path-for-library library image &optional path no-error)
| Return a suitable search path for images used by library.
| It searches for image in `image-load-path' (excluding
| "`data-directory'/images") and `load-path', followed by a path
| suitable for library, which includes "../../etc/images" and
| "../etc/images" relative to the library file itself, and then
| in "`data-directory'/images".
| Then this function returns a list of directories which contains
| first the directory in which image was found, followed by the
| value of `load-path'. If path is given, it is used instead of
| `load-path'.
| If no-error is non-nil and a suitable path can't be found, don't
| signal an error. Instead, return a list of directories as before,
| except that nil appears in place of the image directory.
| Here is an example that uses a common idiom to provide
| compatibility with versions of Emacs that lack the variable
| `image-load-path':
|     ;; Shush compiler.
|     (defvar image-load-path)
|     (let* ((load-path (image-load-path-for-library "mh-e" "mh-logo.xpm"))
|            (image-load-path (cons (car load-path)
|                                   (when (boundp 'image-load-path)
|                                     image-load-path))))
|       (mh-tool-bar-folder-buttons-init))
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |

reply via email to

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