From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/62254 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general,gmane.mail.mh-e.devel Subject: Re: New GNOME icons Date: Wed, 15 Mar 2006 16:34:40 +0900 Organization: Emacsen advocacy group Message-ID: References: <20403.1141690692@olgas.newt.com> <3861.1142268982@olgas.newt.com> <22907.1142318606@olgas.newt.com> <1183.1142359136@olgas.newt.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1142408816 2965 80.91.229.2 (15 Mar 2006 07:46:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 15 Mar 2006 07:46:56 +0000 (UTC) Cc: mh-e-devel@lists.sourceforge.net Original-X-From: ding-owner+m10781@lists.math.uh.edu Wed Mar 15 08:46:53 2006 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FJQiU-0004rV-7j for ding-account@gmane.org; Wed, 15 Mar 2006 08:46:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1FJQiO-0001Ne-00; Wed, 15 Mar 2006 01:46:40 -0600 Original-Received: from nas01.math.uh.edu ([129.7.128.39]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1FJQX7-0001NA-00 for ding@lists.math.uh.edu; Wed, 15 Mar 2006 01:35:01 -0600 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas01.math.uh.edu with esmtp (Exim 4.52) id 1FJQX5-0005S2-Ie for ding@lists.math.uh.edu; Wed, 15 Mar 2006 01:35:01 -0600 Original-Received: from washington.hostforweb.net ([66.225.201.13]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1FJQX4-00018y-00 for ; Wed, 15 Mar 2006 08:34:58 +0100 Original-Received: from [205.234.185.198] (port=59266 helo=mail.jpl.org) by washington.hostforweb.net with esmtpa (Exim 4.52) id 1FJQX8-0004iW-DS; Wed, 15 Mar 2006 01:35:03 -0600 Original-To: ding@gnus.org X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:MS946W/MHPAsghBH8umHF+rY8lQ= X-Hashcash: 1:20:060315:ding@gnus.org::Dj9JM4ia2xwwRiHk:00004Det X-Hashcash: 1:20:060315:mh-e-devel@lists.sourceforge.net::1Sm+2WWuH3mhP8ea:00000000000000000000000000000A1Q5 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - washington.hostforweb.net X-AntiAbuse: Original Domain - gnus.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -2.5 (--) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:62254 gmane.mail.mh-e.devel:11985 Archived-At: --=-=-= >>>>> In Katsumi Yamaoka wrote: > It suggests there's no way that she uses her favorite images instead > of the ones Emacs provides. An alternative plan is here: * gmm-utils.el (gmm-image-load-path-for-library): Look for the most preferred directory which may be specified in image-load-path by a user. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment Content-Transfer-Encoding: quoted-printable (defun gmm-image-load-path-for-library (library image &optional path no-err= or) "Return a suitable search path for images relative to LIBRARY. First it searches for IMAGE in a path suitable for LIBRARY, which includes \"../../etc/images\" and \"../etc/images\" relative to the library file itself, followed by `image-load-path' and `load-path'. 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': ;; Avoid errors on Emacsen without `image-load-path'. (if (not (boundp 'image-load-path)) (defvar image-load-path nil)) (let* ((load-path (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\"= )) (image-load-path (cons (car load-path) image-load-path))) (mh-tool-bar-folder-buttons-init))" (unless library (error "No library specified")) (unless image (error "No image specified")) (let ((image-directory)) ;; Try relative setting. (let (library-name d1ei d2ei) ;; First, find library in the load-path. (setq library-name (locate-library library)) (if (not library-name) (error "Cannot find library %s in load-path" library)) ;; And then set image-directory relative to that. (setq ;; Go down 2 levels. d2ei (expand-file-name "../../etc/images" (file-name-directory library-name)) ;; Go down 1 level. d1ei (expand-file-name "../etc/images" (file-name-directory library-name))) (setq image-directory ;; Set it to nil if image is not found. (cond ((file-exists-p (expand-file-name image d2ei)) d2ei) ((file-exists-p (expand-file-name image d1ei)) d1ei)))) (let (dir) (cond ;; Check for another directory that is specified in ;; image-load-path and preferred than image-directory. ((and image-directory (boundp 'image-load-path)) (let ((image-load-path (butlast (symbol-value 'image-load-path) (length (member (file-name-as-directory image-directory) (mapcar (lambda (dir) (if (stringp dir) (file-name-as-directory dir) dir)) (symbol-value 'image-load-path))))))) (setq dir (image-search-load-path image)))) ;; Check for images in image-load-path or load-path. ((not image-directory) (setq dir (or ;; Images in image-load-path. (image-search-load-path image) ;; Images in load-path. (locate-library image))))) ;; Since the image might be in a nested directory (for ;; example, mail/attach.pbm), adjust `image-directory' ;; accordingly. (when dir (setq dir (file-name-directory dir)) (let (parent) (while (setq parent (file-name-directory image)) (setq image (directory-file-name parent) dir (expand-file-name "../" dir)))) (setq image-directory dir))) (cond (image-directory) (no-error (message "Could not find image %s for library %s" image library)) (t (error "Could not find image %s for library %s" image library))) ;; Return an augmented `path' or `load-path'. (nconc (list image-directory) (delete image-directory (copy-sequence (or path load-path)))))) --=-=-=--