annotate lisp/ezimage.el @ 109699:f640b1894b9f

* dabbrev.el (dabbrev-completion): Fix typo in docstring.
author Juanma Barranquero <lekktu@gmail.com>
date Sun, 01 Aug 2010 05:19:23 +0200
parents 1d1d5d9bd884
children 376148b31b5e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1 ;;; ezimage --- Generalized Image management
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
2
95072
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
3 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 105994
diff changeset
4 ;; 2008, 2009, 2010 Free Software Foundation, Inc.
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
5
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
6 ;; Author: Eric M. Ludlam <zappo@gnu.org>
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
7 ;; Keywords: file, tags, tools
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
8
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
9 ;; This file is part of GNU Emacs.
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
10
94678
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 79721
diff changeset
11 ;; GNU Emacs is free software: you can redistribute it and/or modify
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
12 ;; it under the terms of the GNU General Public License as published by
94678
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 79721
diff changeset
13 ;; the Free Software Foundation, either version 3 of the License, or
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 79721
diff changeset
14 ;; (at your option) any later version.
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
15
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
16 ;; GNU Emacs is distributed in the hope that it will be useful,
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
19 ;; GNU General Public License for more details.
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
20
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
94678
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 79721
diff changeset
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
23
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
24 ;;; Commentary:
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
25 ;;
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
26 ;; A few routines for placing an image over text that will work for any
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
27 ;; Emacs implementation without error. When images are not supported, then
72966
8d6338f8a7dd Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 68651
diff changeset
28 ;; they are just not displayed.
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
29 ;;
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
30 ;; The idea is that gui buffers (trees, buttons, etc) will have text
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
31 ;; representations of the GUI elements. These routines will replace the text
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
32 ;; with an image when images are available.
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
33 ;;
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
34 ;; This file requires the `image' package if it is available.
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
35
95072
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
36 (condition-case nil ; for older XEmacs
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
37 (require 'image)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
38 (error nil))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
39
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
40 ;;; Code:
95072
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
41 (defcustom ezimage-use-images (if (featurep 'xemacs)
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
42 (and (fboundp 'make-image-specifier)
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
43 window-system)
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
44 (and (display-images-p)
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
45 (image-type-available-p 'xpm)))
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
46 "Non-nil means ezimage should display icons."
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
47 :group 'ezimage
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
48 :version "21.1"
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
49 :type 'boolean)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
50
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
51 ;;; Create our own version of defimage
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
52 (eval-and-compile
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
53
95072
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
54 (if (featurep 'emacs)
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
55 (progn
95072
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
56 (defmacro defezimage (variable imagespec docstring)
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
57 "Define VARIABLE as an image if `defimage' is not available.
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
58 IMAGESPEC is the image data, and DOCSTRING is documentation for the image."
95072
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
59 `(progn
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
60 (defimage ,variable ,imagespec ,docstring)
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
61 (put (quote ,variable) 'ezimage t)))
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
62
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
63 ;; This hack is for the ezimage install which has an icons direcory for
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
64 ;; the default icons to be used.
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
65 ;; (add-to-list 'load-path
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
66 ;; (concat (file-name-directory
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
67 ;; (locate-library "ezimage.el"))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
68 ;; "icons"))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
69
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
70 )
95072
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
71
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
72 ;; XEmacs.
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
73 (if (not (fboundp 'make-glyph))
68562
26cf94e56f83 (ezimage-mail, ezimage-object-out-of-date, ezimage-insert-image-button-maybe,
Juanma Barranquero <lekktu@gmail.com>
parents: 66608
diff changeset
74
95072
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
75 (defmacro defezimage (variable imagespec docstring)
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
76 "Don't bother loading up an image...
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
77 Argument VARIABLE is the variable to define.
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
78 Argument IMAGESPEC is the list defining the image to create.
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
79 Argument DOCSTRING is the documentation for VARIABLE."
95072
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
80 `(defvar ,variable nil ,docstring))
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
81
95072
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
82 (defun ezimage-find-image-on-load-path (image)
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
83 "Find the image file IMAGE on the load path."
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
84 (let ((l (cons
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
85 ;; In XEmacs, try the data directory first (for an
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
86 ;; install in XEmacs proper.) Search the load
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
87 ;; path next (for user installs)
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
88 (locate-data-directory "ezimage")
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
89 load-path))
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
90 (r nil))
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
91 (while (and l (not r))
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
92 (if (file-exists-p (concat (car l) "/" image))
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
93 (setq r (concat (car l) "/" image))
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
94 (if (file-exists-p (concat (car l) "/icons/" image))
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
95 (setq r (concat (car l) "/icons/" image))
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
96 ))
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
97 (setq l (cdr l)))
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
98 r))
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
99
95072
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
100 (defun ezimage-convert-emacs21-imagespec-to-xemacs (spec)
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
101 "Convert the Emacs21 image SPEC into an XEmacs image spec.
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
102 The Emacs 21 spec is what I first learned, and is easy to convert."
95072
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
103 (let* ((sl (car spec))
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
104 (itype (nth 1 sl))
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
105 (ifile (nth 3 sl)))
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
106 (vector itype ':file (ezimage-find-image-on-load-path ifile))))
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
107
95072
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
108 (defmacro defezimage (variable imagespec docstring)
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
109 "Define VARIABLE as an image if `defimage' is not available.
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
110 IMAGESPEC is the image data, and DOCSTRING is documentation for the image."
95072
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
111 `(progn
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
112 (defvar ,variable
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
113 ;; The Emacs21 version of defimage looks just like the XEmacs image
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
114 ;; specifier, except that it needs a :type keyword. If we line
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
115 ;; stuff up right, we can use this cheat to support XEmacs specifiers.
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
116 (condition-case nil
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
117 (make-glyph
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
118 (make-image-specifier
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
119 (ezimage-convert-emacs21-imagespec-to-xemacs (quote ,imagespec)))
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
120 'buffer)
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
121 (error nil))
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
122 ,docstring)
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
123 (put ',variable 'ezimage t)))
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
124
95072
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
125 )))
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
126
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
127 (defezimage ezimage-directory
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
128 ((:type xpm :file "ezimage/dir.xpm" :ascent center))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
129 "Image used for empty directories.")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
130
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
131 (defezimage ezimage-directory-plus
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
132 ((:type xpm :file "ezimage/dir-plus.xpm" :ascent center))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
133 "Image used for closed directories with stuff in them.")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
134
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
135 (defezimage ezimage-directory-minus
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
136 ((:type xpm :file "ezimage/dir-minus.xpm" :ascent center))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
137 "Image used for open directories with stuff in them.")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
138
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
139 (defezimage ezimage-page-plus
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
140 ((:type xpm :file "ezimage/page-plus.xpm" :ascent center))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
141 "Image used for closed files with stuff in them.")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
142
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
143 (defezimage ezimage-page-minus
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
144 ((:type xpm :file "ezimage/page-minus.xpm" :ascent center))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
145 "Image used for open files with stuff in them.")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
146
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
147 (defezimage ezimage-page
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
148 ((:type xpm :file "ezimage/page.xpm" :ascent center))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
149 "Image used for files with nothing interesting in it.")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
150
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
151 (defezimage ezimage-tag
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
152 ((:type xpm :file "ezimage/tag.xpm" :ascent center))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
153 "Image used for tags.")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
154
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
155 (defezimage ezimage-tag-plus
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
156 ((:type xpm :file "ezimage/tag-plus.xpm" :ascent center))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
157 "Image used for closed tag groups.")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
158
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
159 (defezimage ezimage-tag-minus
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
160 ((:type xpm :file "ezimage/tag-minus.xpm" :ascent center))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
161 "Image used for open tags.")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
162
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
163 (defezimage ezimage-tag-gt
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
164 ((:type xpm :file "ezimage/tag-gt.xpm" :ascent center))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
165 "Image used for closed tags (with twist arrow).")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
166
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
167 (defezimage ezimage-tag-v
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
168 ((:type xpm :file "ezimage/tag-v.xpm" :ascent center))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
169 "Image used for open tags (with twist arrow).")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
170
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
171 (defezimage ezimage-tag-type
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
172 ((:type xpm :file "ezimage/tag-type.xpm" :ascent center))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
173 "Image used for tags that represent a data type.")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
174
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
175 (defezimage ezimage-box-plus
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
176 ((:type xpm :file "ezimage/box-plus.xpm" :ascent center))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
177 "Image of a closed box.")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
178
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
179 (defezimage ezimage-box-minus
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
180 ((:type xpm :file "ezimage/box-minus.xpm" :ascent center))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
181 "Image of an open box.")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
182
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
183 (defezimage ezimage-mail
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
184 ((:type xpm :file "ezimage/mail.xpm" :ascent center))
68562
26cf94e56f83 (ezimage-mail, ezimage-object-out-of-date, ezimage-insert-image-button-maybe,
Juanma Barranquero <lekktu@gmail.com>
parents: 66608
diff changeset
185 "Image of an envelope.")
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
186
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
187 (defezimage ezimage-checkout
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
188 ((:type xpm :file "ezimage/checkmark.xpm" :ascent center))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
189 "Image representing a checkmark. For files checked out of a VC.")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
190
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
191 (defezimage ezimage-object
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
192 ((:type xpm :file "ezimage/bits.xpm" :ascent center))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
193 "Image representing bits (an object file.)")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
194
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
195 (defezimage ezimage-object-out-of-date
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
196 ((:type xpm :file "ezimage/bitsbang.xpm" :ascent center))
68562
26cf94e56f83 (ezimage-mail, ezimage-object-out-of-date, ezimage-insert-image-button-maybe,
Juanma Barranquero <lekktu@gmail.com>
parents: 66608
diff changeset
197 "Image representing bits with a ! in it. (An out of data object file.)")
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
198
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
199 (defezimage ezimage-label
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
200 ((:type xpm :file "ezimage/label.xpm" :ascent center))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
201 "Image used for label prefix.")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
202
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
203 (defezimage ezimage-lock
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
204 ((:type xpm :file "ezimage/lock.xpm" :ascent center))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
205 "Image of a lock. Used for Read Only, or private.")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
206
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
207 (defezimage ezimage-unlock
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
208 ((:type xpm :file "ezimage/unlock.xpm" :ascent center))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
209 "Image of an unlocked lock.")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
210
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
211 (defezimage ezimage-key
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
212 ((:type xpm :file "ezimage/key.xpm" :ascent center))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
213 "Image of a key.")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
214
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
215 (defezimage ezimage-document-tag
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
216 ((:type xpm :file "ezimage/doc.xpm" :ascent center))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
217 "Image used to indicate documentation available.")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
218
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
219 (defezimage ezimage-document-plus
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
220 ((:type xpm :file "ezimage/doc-plus.xpm" :ascent center))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
221 "Image used to indicate closed documentation.")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
222
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
223 (defezimage ezimage-document-minus
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
224 ((:type xpm :file "ezimage/doc-minus.xpm" :ascent center))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
225 "Image used to indicate open documentation.")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
226
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
227 (defezimage ezimage-info-tag
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
228 ((:type xpm :file "ezimage/info.xpm" :ascent center))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
229 "Image used to indicate more information available.")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
230
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
231 (defvar ezimage-expand-image-button-alist
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
232 '(
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
233 ;; here are some standard representations
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
234 ("<+>" . ezimage-directory-plus)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
235 ("<->" . ezimage-directory-minus)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
236 ("< >" . ezimage-directory)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
237 ("[+]" . ezimage-page-plus)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
238 ("[-]" . ezimage-page-minus)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
239 ("[?]" . ezimage-page)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
240 ("[ ]" . ezimage-page)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
241 ("{+}" . ezimage-box-plus)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
242 ("{-}" . ezimage-box-minus)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
243 ;; Some vaguely representitive entries
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
244 ("*" . ezimage-checkout)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
245 ("#" . ezimage-object)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
246 ("!" . ezimage-object-out-of-date)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
247 ("%" . ezimage-lock)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
248 )
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
249 "List of text and image associations.")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
250
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
251 (defun ezimage-insert-image-button-maybe (start length &optional string)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
252 "Insert an image button based on text starting at START for LENGTH chars.
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
253 If buttontext is unknown, just insert that text.
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
254 If we have an image associated with it, use that image.
68562
26cf94e56f83 (ezimage-mail, ezimage-object-out-of-date, ezimage-insert-image-button-maybe,
Juanma Barranquero <lekktu@gmail.com>
parents: 66608
diff changeset
255 Optional argument STRING is a string upon which to add text properties."
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
256 (when ezimage-use-images
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
257 (let* ((bt (buffer-substring start (+ length start)))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
258 (a (assoc bt ezimage-expand-image-button-alist)))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
259 ;; Regular images (created with `insert-image' are intangible
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
260 ;; which (I suppose) make them more compatible with XEmacs 21.
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
261 ;; Unfortunatly, there is a giant pile o code dependent on the
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
262 ;; underlying text. This means if we leave it tangible, then I
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
263 ;; don't have to change said giant piles o code.
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
264 (if (and a (symbol-value (cdr a)))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
265 (ezimage-insert-over-text (symbol-value (cdr a))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
266 start
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
267 (+ start (length bt))))))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
268 string)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
269
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
270 (defun ezimage-image-over-string (string &optional alist)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
271 "Insert over the text in STRING an image found in ALIST.
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
272 Return STRING with properties applied."
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
273 (if ezimage-use-images
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
274 (let ((a (assoc string alist)))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
275 (if (and a (symbol-value (cdr a)))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
276 (ezimage-insert-over-text (symbol-value (cdr a))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
277 0 (length string)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
278 string)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
279 string))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
280 string))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
281
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
282 (defun ezimage-insert-over-text (image start end &optional string)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
283 "Place IMAGE over the text between START and END.
68562
26cf94e56f83 (ezimage-mail, ezimage-object-out-of-date, ezimage-insert-image-button-maybe,
Juanma Barranquero <lekktu@gmail.com>
parents: 66608
diff changeset
284 Assumes the image is part of a GUI and can be clicked on.
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
285 Optional argument STRING is a string upon which to add text properties."
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
286 (when ezimage-use-images
95072
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
287 (add-text-properties start end
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
288 (if (featurep 'xemacs)
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
289 (list 'end-glyph image
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
290 'rear-nonsticky (list 'display)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
291 'invisible t
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
292 'detachable t)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
293 (list 'display image
95072
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
294 'rear-nonsticky (list 'display)))
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
295 string))
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
296 string)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
297
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
298 (defun ezimage-image-association-dump ()
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
299 "Dump out the current state of the Ezimage image alist.
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
300 See `ezimage-expand-image-button-alist' for details."
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
301 (interactive)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
302 (with-output-to-temp-buffer "*Ezimage Images*"
105994
009383a57ce8 * x-dnd.el (x-dnd-maybe-call-test-function):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 100908
diff changeset
303 (with-current-buffer "*Ezimage Images*"
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
304 (goto-char (point-max))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
305 (insert "Ezimage image cache.\n\n")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
306 (let ((start (point)) (end nil))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
307 (insert "Image\tText\tImage Name")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
308 (setq end (point))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
309 (insert "\n")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
310 (put-text-property start end 'face 'underline))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
311 (let ((ia ezimage-expand-image-button-alist))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
312 (while ia
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
313 (let ((start (point)))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
314 (insert (car (car ia)))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
315 (insert "\t")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
316 (ezimage-insert-image-button-maybe start
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
317 (length (car (car ia))))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
318 (insert (car (car ia)) "\t" (format "%s" (cdr (car ia))) "\n"))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
319 (setq ia (cdr ia)))))))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
320
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
321 (defun ezimage-image-dump ()
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
322 "Dump out the current state of the Ezimage image alist.
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
323 See `ezimage-expand-image-button-alist' for details."
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
324 (interactive)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
325 (with-output-to-temp-buffer "*Ezimage Images*"
105994
009383a57ce8 * x-dnd.el (x-dnd-maybe-call-test-function):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 100908
diff changeset
326 (with-current-buffer "*Ezimage Images*"
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
327 (goto-char (point-max))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
328 (insert "Ezimage image cache.\n\n")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
329 (let ((start (point)) (end nil))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
330 (insert "Image\tImage Name")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
331 (setq end (point))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
332 (insert "\n")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
333 (put-text-property start end 'face 'underline))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
334 (let ((ia (ezimage-all-images)))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
335 (while ia
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
336 (let ((start (point)))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
337 (insert "cm")
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
338 (ezimage-insert-over-text (symbol-value (car ia)) start (point))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
339 (insert "\t" (format "%s" (car ia)) "\n"))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
340 (setq ia (cdr ia)))))))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
341
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
342 (defun ezimage-all-images ()
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
343 "Return a list of all variables containing ez images."
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
344 (let ((ans nil))
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
345 (mapatoms (lambda (sym)
95072
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
346 (if (get sym 'ezimage) (setq ans (cons sym ans)))))
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
347 (setq ans (sort ans (lambda (a b)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
348 (string< (symbol-name a) (symbol-name b)))))
95072
a2ec715aefb4 (ezimage-use-images): Drop support for Emacs < 21 and simplify initial value.
Glenn Morris <rgm@gnu.org>
parents: 94678
diff changeset
349 ans))
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
350
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
351 (provide 'ezimage)
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
352
65779
103ed0b7e567 Add arch tagline
Miles Bader <miles@gnu.org>
parents: 65752
diff changeset
353 ;; arch-tag: d4ea2d93-3c7a-4cb3-b5a6-c1b9178183aa
65752
12e5c2513853 * speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
354 ;;; sb-image.el ends here