annotate lisp/utils/frame-icon.el @ 30:ec9a17fef872 r19-15b98

Import from CVS: tag r19-15b98
author cvs
date Mon, 13 Aug 2007 08:52:29 +0200
parents 441bb1e64a06
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
1 ;; frame-icon.el - set up mode-specific icons for each frame under XEmacs
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
2
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
3 ;; Author: Michael Lamoureux <lamour@engin.umich.edu>
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
4 ;; Keywords: lisp, extensions
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
5 ;; date created: 8/3/93
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
6
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
7 ;; This file is part of XEmacs.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
8
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
9 ;; XEmacs is free software; you can redistribute it and/or modify it
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
10 ;; under the terms of the GNU General Public License as published by
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
11 ;; the Free Software Foundation; either version 2, or (at your option)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
12 ;; any later version.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
13
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
14 ;; XEmacs is distributed in the hope that it will be useful, but
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
15 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
17 ;; General Public License for more details.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
18
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
20 ;; along with XEmacs; see the file COPYING. If not, write to the Free
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
21 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
22 ;; 02111-1307, USA.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
23
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
24 ;;; Synched up with: Not in FSF.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
25
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
26 ;;; Commentary:
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
27
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
28 ;; Modified by Bob Weiner <weiner@infodock.com>, 1/13/94
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
29 ;; Handle XEmacs 19.8 pixmaps properly.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
30 ;; Also added in more mode settings and added many new bitmaps.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
31 ;; Renamed from icon.el to frame-icon.el.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
32 ;; Made all definitions start with the same prefix, 'icon-'.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
33 ;; Added a provide clause.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
34 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
35 ;; Modified by Bob Weiner, 2/24/95, to handle XEmacs 19.12.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
36 ;; Added set of unmap-frame-hook.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
37 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
38 ;; Modified by Bob Weiner, 7/17/95, to handle XEmacs 19.12.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
39 ;; Changed to use new image-handling protocols and added backwards
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
40 ;; compatibility functions for new image functions.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
41 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
42 ;; Modified by Bob Weiner, 7/18/95.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
43 ;; Added icon-suffix variable so can use .xbm or .xpm icons.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
44 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
45 ;; Most Icons were extracted from: /export.lcs.mit.edu:/contrib/AIcons
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
46 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
47
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
48 ;;; Code:
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
49
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
50 (defvar icon-directory (concat data-directory "frame-icon/")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
51 "Directory of icons used by frame-icon.el.")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
52
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
53 (defvar icon-suffix ".xbm"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
54 "Must be .xbm or .xpm, depending on the format of the icons in icon-directory.")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
55
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
56 (defconst icon-mode-alist
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
57 '(
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
58 (default . "question")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
59 ;; For testing
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
60 (fundamental-mode . "match")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
61 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
62 (archie-mode . "archie")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
63 (asm-mode . "nuke")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
64 (bbdb-mode . "eye")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
65 (bookmark-menu-mode . "finder")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
66 (Buffer-menu-mode . "help")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
67 (c++-mode . "c++")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
68 (c++-c-mode . "escherknot")
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
69 (c-mode . "c")
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
70 (awk-mode . "escherknot")
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
71 (cvs-mode . "tree")
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
72 (f90-mode . "wizard")
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
73 (xrdb-mode . "RIP")
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
74 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
75 (calc-edit-mode . "cray")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
76 (calc-keypad . "cray")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
77 (calc-mode . "cray")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
78 (calc-trail-mode . "cray")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
79 (MacEdit-mode . "cray")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
80 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
81 (calendar-mode . "calendar")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
82 (comint-mode . "terminal")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
83 (perl-mode . "perl")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
84 (csh-mode . "manpage2")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
85 (db-edit-mode . "filing")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
86 (db-view-mode . "filing")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
87 (dired-mode . "filing")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
88 (doctor-mode . "ying-yang-48")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
89 (edit-faces-mode . "eye")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
90 (Edit-options-mode . "swissknife")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
91 (emacs-lisp-mode . "elisp")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
92 (fortran-mode . "RIP")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
93 (gdb-mode . "bug-48")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
94 (gud-mode . "bug-48")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
95 (gnus-article-mode . "news")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
96 (gnus-group-mode . "news")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
97 (gnus-summary-mode . "news")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
98 (gopher-mode . "gopher")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
99 (html-mode . "xmosaic")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
100 (indented-text-mode . "page")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
101 (Info-mode . "help")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
102 (java-mode . "coffee")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
103 (kotl-mode . "kotl")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
104 (lisp-interaction-mode . "swissknife")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
105 (lisp-mode . "lisp")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
106 (lock-mode . "termlock")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
107 (mail-mode . "scroll2")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
108 (Manual-mode . "manpage")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
109 (man-mode . "manpage")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
110 (news-reply-mode . "match")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
111 (outline-mode . "outline")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
112 (perl-mode . "perl")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
113 (edit-picture . "splat")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
114 (pm-fdr-mode . "mail")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
115 (pm-group-mode . "news")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
116 (pm-msg-edit-mode . "mail")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
117 (pm-msgsumm-mode . "mail")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
118 (pm-mode . "mail")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
119 (rdb-mode . "question")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
120 (rmail-mode . "mail")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
121 (rmail-edit-mode . "mail")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
122 (rmail-summary-mode . "mail")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
123 (scheme-interaction-mode . "swissknife")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
124 (scheme-mode . "lisp")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
125 (shell-mode . "terminal")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
126 (sm-manual-mode . "manpage")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
127 (sql-mode . "sql")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
128 (tcl-mode . "radioactive")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
129 (telnet-mode . "rlogin")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
130 (texinfo-mode . "texinfo")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
131 (text-mode . "page")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
132 (unix-apropos-mode . "manpage")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
133 (ups-mode . "hourglass") ; process listing mode
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
134 (vi-mode . "stopsign")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
135 (vip-mode . "stopsign")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
136 (vkill-mode . "load")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
137 (vrml-mode . "drawing")
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
138 (vm-mode . "scroll2")
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
139 (vm-summary-mode . "scroll2")
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
140 (w3-mode . "world")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
141 (waisq-mode . "library")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
142 (wordstar-mode . "words")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
143 (wrolo-mode . "phone")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
144 ;;
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
145 (ams-tex-mode . "tex-48")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
146 (foiltex-mode . "tex-48")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
147 (latex-mode . "tex-48")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
148 (LaTeX-mode . "tex-48")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
149 (plain-tex-mode . "tex-48")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
150 (plain-TeX-mode . "tex-48")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
151 (slitex-mode . "tex-48")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
152 (tex-mode . "tex-48")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
153 )
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
154 "Alist of (major-mode . non-suffixed-icon-file-name) elements.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
155 Used to set frame icons based upon the current major mode.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
156 For use with icon-set-frame. See also the variable, 'icon-suffix'.")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
157
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
158 (or (fboundp 'image-instance-p) (fset 'image-instance-p 'pixmapp))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
159 (or (fboundp 'image-instance-file-name)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
160 (fset 'image-instance-file-name 'pixmap-file-name))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
161 (or (fboundp 'make-glyph) (fset 'make-glyph 'make-pixmap))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
162
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
163 (defun icon-set-frame (iconified-frame)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
164 "Set icon for selected frame according to the values in icon-mode-alist."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
165 (save-excursion
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
166 (if (framep iconified-frame)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
167 (select-frame iconified-frame))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
168 (let* ((icon-sym (intern (concat "icon-" (symbol-name major-mode))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
169 (pix (and (boundp icon-sym) (symbol-value icon-sym)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
170 (image (or (cdr (assq major-mode icon-mode-alist))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
171 (cdr (assq 'default icon-mode-alist))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
172 (image-file (expand-file-name (concat image icon-suffix)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
173 icon-directory)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
174 (cond ((and (image-instance-p pix)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
175 (equal image-file (image-instance-file-name pix)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
176 nil)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
177 (t
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
178 ;; Ensure we don't create a copy of a pixmap already in
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
179 ;; icon-list due to use in a different major-mode.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
180 (setq pix (set icon-sym
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
181 (car (delq
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
182 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
183 (mapcar
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
184 (function
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
185 (lambda (pixmap)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
186 (if (equal (image-instance-file-name
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
187 pixmap)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
188 image-file)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
189 pixmap)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
190 icon-list)))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
191 ;; If pix is nil, there was no entry in icon-list, so create a
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
192 ;; new one.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
193 (or (image-instance-p pix)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
194 (setq pix
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
195 (glyph-image-instance
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
196 (set icon-sym (make-glyph image-file)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
197 icon-list (cons pix icon-list)))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
198 (x-set-frame-icon-pixmap
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
199 (if (framep iconified-frame)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
200 iconified-frame
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
201 ;; unpatched XEmacs 19.6
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
202 (selected-frame))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
203 pix))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
204
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
205 (defvar icon-list nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
206 "List of existing pixmap objects used as frame icons by frame-icon.el.")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
207
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
208 ;; Hook in so icons will be selected at iconify time
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
209 (if (string-match "XEmacs" emacs-version)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
210 (add-hook 'unmap-frame-hook 'icon-set-frame) ;; XEmacs 19.12
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
211 (add-hook 'unmap-screen-hook 'icon-set-frame)) ;; Lemacs 19.10
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
212
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
213
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
214 (provide 'frame-icon)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
215
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents:
diff changeset
216 ;;; frame-icon.el ends here