From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/62152 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.mail.mh-e.devel,gmane.emacs.gnus.general Subject: Re: image-load-path/load-path function Date: Sat, 04 Mar 2006 17:27:17 +0100 Message-ID: References: <17903.1141256030@olgas.newt.com> <19737.1141261645@olgas.newt.com> <4021.1141273863@mixed> <12647.1141331413@olgas.newt.com> <18269.1141346992@olgas.newt.com> <9984.1141426021@olgas.newt.com> Reply-To: Reiner Steib NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1141490058 994 80.91.229.2 (4 Mar 2006 16:34:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 4 Mar 2006 16:34:18 +0000 (UTC) Cc: ding@gnus.org Original-X-From: mh-e-devel-admin@lists.sourceforge.net Sat Mar 04 17:34:14 2006 Return-path: Envelope-to: gmmd-mh-e-devel@m.gmane.org Original-Received: from lists-outbound.sourceforge.net ([66.35.250.225]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FFZhn-0006yx-Tn for gmmd-mh-e-devel@m.gmane.org; Sat, 04 Mar 2006 17:34:08 +0100 Original-Received: from sc8-sf-list1-b.sourceforge.net (sc8-sf-list1-b.sourceforge.net [10.3.1.7]) by sc8-sf-spam1.sourceforge.net (Postfix) with ESMTP id 0885E888D5; Sat, 4 Mar 2006 08:34:07 -0800 (PST) Original-Received: from sc8-sf-mx1-b.sourceforge.net ([10.3.1.91] helo=mail.sourceforge.net) by sc8-sf-list1.sourceforge.net with esmtp (Exim 4.30) id 1FFZgj-0004vW-FV for mh-e-devel@lists.sourceforge.net; Sat, 04 Mar 2006 08:33:01 -0800 Original-Received: from mail.uni-ulm.de ([134.60.1.1]) by mail.sourceforge.net with esmtps (TLSv1:AES256-SHA:256) (Exim 4.44) id 1FFZgh-0006nJ-OU for mh-e-devel@lists.sourceforge.net; Sat, 04 Mar 2006 08:33:01 -0800 Original-Received: from bridgekeeper.physik.uni-ulm.de (bridgekeeper.physik.uni-ulm.de [134.60.10.123]) by mail.uni-ulm.de (8.13.4/8.13.4) with ESMTP id k24GWo43028281; Sat, 4 Mar 2006 17:32:53 +0100 (MET) Original-Received: from viandante.physik.uni-ulm.de (bridgekeeper.physik.uni-ulm.de [134.60.10.123]) by bridgekeeper.physik.uni-ulm.de (Postfix) with SMTP id 2861311057; Sat, 4 Mar 2006 17:32:46 +0100 (CET) Original-Received: (nullmailer pid 8080 invoked by uid 170); Sat, 04 Mar 2006 16:27:18 -0000 Original-To: mh-e-devel@lists.sourceforge.net Mail-Followup-To: mh-e-devel@lists.sourceforge.net, ding@gnus.org X-Face: P05mdcZT&lL[-s2=mw~RsllZ0zZAb?vdE}.s, List-Id: Forum for the MH-E developers List-Post: List-Help: List-Subscribe: , List-Archive: X-Original-Date: Sat, 04 Mar 2006 17:27:17 +0100 Xref: news.gmane.org gmane.mail.mh-e.devel:11850 gmane.emacs.gnus.general:62152 Archived-At: On Fri, Mar 03 2006, Bill Wohler wrote: > Here is the same thing as my last patch, [...] (BTW, if it's already in Emacs CVS, you don't need to include it here.) > I'm definitely now heavily leaning towards the name > image-load-path-for-library. Does it work for you too? The "relative" > variants didn't work for me since you could also pull the directories > off of load-path or image-load-path. Okay with me. Although I'd slightly prefer to emphasize "relative" a little bit. But maybe adding it to the doc string is sufficient: "Return a suitable search path for images relative to LIBRARY. [...]" > In an Emacs 22 environment, given the name, you'd expect a modified > image-load-path, but you get a modified load-path. If the optional > argument path isn't present, I'd suggest returning a modified > image-load-path if it exists; else a modified load-path. What do you > think? What if a user shares configuration files between Emacs 21 and 22 and sets `image-load-path' unconditionally (without a boundp test; I sometimes don't add test such if I assume that it will be just ignored in older Emacsen)? The you'll get a bogus `load-path' like... '("/path/to/etc/images" data-directory load-path) (See also below...) > We could then potentially change the example (#1) to the following > > #2 > (let ((image-load-path (image-load-path-for-library "mh-e" "mh-logo.xpm")) > (load-path (image-load-path-for-library "mh-e" "mh-logo.xpm"))) > (mh-tool-bar-folder-buttons-init)) [...] > #3 > (let* ((image-load-path (image-load-path-for-library "mh-e" "mh-logo.xpm")) > (load-path image-load-path)) > (mh-tool-bar-folder-buttons-init)) `image-load-path' may contain symbols, `load-path' can't. If Emacs needs to load some library within the let statement for some reason, it will fail. > The latter would be more efficient, but would it be too opaque? I think > my preference would be #3, #1, #2. Thoughts? I think #2 and #3 both are a little problematic. But maybe we can suggest an example which avoids calling `image-load-path-for-library' twice: (let* ((load-path (image-load-path-for-library "mh-e" "mh-logo.xpm")) (image-load-path (cons (car load-path) image-load-path))) ;; do something. Test: image-load-path) [...] > Here is an example that uses a common idiom to provide > compatibility with versions of Emacs that lack the variable > `image-load-path': > > (let ((load-path > (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\" 'load-path)) I'd omit 'load-path as it is optional. Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/ ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642