From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/62204 Path: news.gmane.org!not-for-mail From: Bill Wohler Newsgroups: gmane.mail.mh-e.devel,gmane.emacs.gnus.general Subject: *image-load-path-for-library update Date: Fri, 10 Mar 2006 18:12:32 -0800 Organization: Newt Software Message-ID: <13961.1142043152@olgas.newt.com> References: <20403.1141690692@olgas.newt.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1142047870 8728 80.91.229.2 (11 Mar 2006 03:31:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 11 Mar 2006 03:31:10 +0000 (UTC) Cc: mh-e-devel@lists.sourceforge.net Original-X-From: mh-e-devel-admin@lists.sourceforge.net Sat Mar 11 04:31:07 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 1FHuoo-0000Jf-BZ for gmmd-mh-e-devel@m.gmane.org; Sat, 11 Mar 2006 04:31:02 +0100 Original-Received: from sc8-sf-list1-b.sourceforge.net (sc8-sf-list1-b.sourceforge.net [10.3.1.7]) by sc8-sf-spam2.sourceforge.net (Postfix) with ESMTP id 3B340120E1; Fri, 10 Mar 2006 19:31:01 -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 1FHuo9-0002zS-03 for mh-e-devel@lists.sourceforge.net; Fri, 10 Mar 2006 19:30:21 -0800 Original-Received: from pop-tawny.atl.sa.earthlink.net ([207.69.195.67]) by mail.sourceforge.net with esmtp (Exim 4.44) id 1FHuo7-0005P8-OA for mh-e-devel@lists.sourceforge.net; Fri, 10 Mar 2006 19:30:21 -0800 Original-Received: from h-68-165-5-58.snvacaid.dynamic.covad.net ([68.165.5.58] helo=olgas.newt.com) by pop-tawny.atl.sa.earthlink.net with esmtp (Exim 3.36 #10) id 1FHuo6-0004ig-00; Fri, 10 Mar 2006 22:30:18 -0500 Original-Received: by olgas.newt.com (Postfix, from userid 1000) id 314C91707F; Fri, 10 Mar 2006 18:12:32 -0800 (PST) Original-Received: from olgas.newt.com (localhost [127.0.0.1]) by olgas.newt.com (Postfix) with ESMTP id 261B516FA8; Fri, 10 Mar 2006 18:12:32 -0800 (PST) Original-To: ding@gnus.org In-reply-to: Comments: In-reply-to Reiner Steib message dated "Sat, 11 Mar 2006 00:56:46 +0100." X-Mailer: MH-E 7.93+cvs; nmh 1.1; GNU Emacs 22.0.50.14 X-Image-URL: http://www.newt.com/wohler/images/bill-diving.png Mail-Followup-To: mh-e-devel@lists.sourceforge.net, ding@gnus.org X-Spam-Score: 1.0 (+) X-Spam-Report: Spam Filtering performed by sourceforge.net. See http://spamassassin.org/tag/ for more details. Report problems to http://sf.net/tracker/?func=add&group_id=1&atid=200001 1.0 FORGED_RCVD_HELO Received: contains a forged HELO Original-Sender: mh-e-devel-admin@lists.sourceforge.net Errors-To: mh-e-devel-admin@lists.sourceforge.net X-BeenThere: mh-e-devel@lists.sourceforge.net X-Mailman-Version: 2.0.9-sf.net Precedence: bulk List-Unsubscribe: , List-Id: Forum for the MH-E developers List-Post: List-Help: List-Subscribe: , List-Archive: X-Original-Date: Fri, 10 Mar 2006 18:12:32 -0800 Xref: news.gmane.org gmane.mail.mh-e.devel:11931 gmane.emacs.gnus.general:62204 Archived-At: --=-=-= Reiner Steib 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. --=-=-= Content-Disposition: inline; filename=diff Content-Description: image-load-path-for-library patch --- 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)) --=-=-= -- Bill Wohler 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. --=-=-=-- ------------------------------------------------------- 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