emacs-devel
[Top][All Lists]
Advanced

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

Re: Where to put images for lisp packages?


From: Reiner Steib
Subject: Re: Where to put images for lisp packages?
Date: Thu, 23 Sep 2004 18:22:55 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

On Fri, Sep 10 2004, Miles Bader wrote:

> Reiner Steib <address@hidden> writes:
>>> If they're to go in etc/, it would be nice if they went in to a
>>> sub-hierarchy that strictly mirrored the correspodning lisp dirs, to
>>> make them easier to find (for a hacker, not for the code :-).
>>
>> "strictly" would require minor changes in `smilies.el': Look in
>> etc/gnus instead of etc/smilies.
>
> What about moving the standalone Gnus to do the same thing?

Sure.

> I'd actually go farther and put _all_ images in something like
> `etc/images/' (with further subdirs like `etc/images/gnus/' etc).

I'm not familiar with the way images should be found in Emacs.  But at
least Gnus doesn't seems to use a uniform method for finding the image
directories.  See `mm-image-load-path' (for the tool bars),
`smiley.el', `gnus-picon.el', the function
`gnus-group-startup-message', the use of `gnus-pointer.xpm', ...

After...

$ mkdir -p etc/images/gnus
$ mv lisp/gnus/*.[px][pb]? etc/images/gnus
$ mv etc/gnus*.[px][pb]?   etc/images/gnus

... and the following patch, all Gnus images (splash, mode-line,
smilies, tool bar) are found.

--8<---------------cut here---------------start------------->8---
Index: gnus.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/gnus/gnus.el,v
retrieving revision 1.30
diff -u -r1.30 gnus.el
--- gnus.el     20 Sep 2004 12:03:04 -0000      1.30
+++ gnus.el     23 Sep 2004 16:05:06 -0000
@@ -325,7 +325,8 @@
   (defvar gnus-mode-line-image-cache t)
   (if (fboundp 'find-image)
       (defun gnus-mode-line-buffer-identification (line)
-       (let ((str (car-safe line)))
+       (let ((str (car-safe line))
+             (load-path (mm-image-load-path)))
          (if (and (stringp str)
                   (string-match "^Gnus:" str))
              (progn (add-text-properties
@@ -874,7 +875,7 @@
    ((and
      (fboundp 'find-image)
      (display-graphic-p)
-     (let* ((data-directory (nnheader-find-etc-directory "gnus"))
+     (let* ((data-directory (nnheader-find-etc-directory "images/gnus"))
            (image (find-image
                    `((:type xpm :file "gnus.xpm"
                             :color-symbols
Index: mm-util.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/gnus/mm-util.el,v
retrieving revision 1.31
diff -u -r1.31 mm-util.el
--- mm-util.el  20 Sep 2004 12:03:04 -0000      1.31
+++ mm-util.el  23 Sep 2004 16:05:06 -0000
@@ -788,7 +788,7 @@
       (if (file-directory-p
           (setq dir (concat (file-name-directory
                              (directory-file-name path))
-                            "etc/" (or package "gnus/"))))
+                            "etc/images/" (or package "gnus/"))))
          (push dir result))
       (push path result))))
 
Index: smiley.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/gnus/smiley.el,v
retrieving revision 1.3
diff -u -r1.3 smiley.el
--- smiley.el   20 Sep 2004 12:03:05 -0000      1.3
+++ smiley.el   23 Sep 2004 16:05:06 -0000
@@ -44,7 +44,7 @@
   :group 'gnus-visual)
 
 ;; Maybe this should go.
-(defcustom smiley-data-directory (nnheader-find-etc-directory "smilies")
+(defcustom smiley-data-directory (nnheader-find-etc-directory "images/gnus")
   "*Location of the smiley faces files."
   :type 'directory
   :group 'smiley)
--8<---------------cut here---------------end--------------->8---

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/





reply via email to

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