Article View: gnu.epoch.misc
Article #1174Re: changing icons
From: Frank Caico
Date: Thu, 22 Oct 1992 15:12
Date: Thu, 22 Oct 1992 15:12
86 lines
4899 bytes
4899 bytes
I didn't get much in the way of replies regarding my question about having
different icon PIXMAPS for different epoch windows.
I came up with something on my own. It works well most of the time but when
you switch buffers within a screen without re-selecting the screen the icon
will not change until that screen is reselected.
---cut here------cut here------cut here------cut here------cut here------
;;;===========================================================================
;;; Copyright (C) 1992 Frank Caico
;;;
;;; This file is for use with Epoch, a modified version of GNU Emacs.
;;; Requires Epoch 4.0 or later.
;;;
;;; This code is distributed in the hope that it will be useful,
;;; bute WITHOUT ANY WARRANTY. No author or distributor accepts
;;; responsibility to anyone for the consequences of using this code
;;; or for whether it serves any particular purpose or works at all,
;;; unless explicitly stated in a written agreement.
;;;
;;; Everyone is granted permission to copy, modify and redistribute
;;; this code, but only under the conditions described in the
;;; GNU Emacs General Public License, except the original author nor his
;;; agents are bound by the License in their use of this code.
;;; (These special rights for the author in no way restrict the rights of
;;; others given in the License or this prologue)
;;; A copy of this license is supposed to have been given to you along
;;; with Epoch so you can know your rights and responsibilities.
;;; It should be in a file named COPYING. Among other things, the
;;; copyright notice and this notice must be preserved on all copies.
;;;
;;; Revision: 1.0
;;; Date: 10/22/92
;;;
;;; FUNCTION: mode based setting of each epoch icon's pixmap.
;;; the variable epoch-icons-pixmap-directory is a pointer to the
;;; directory containing all these icons.
;;;
;;; RELATED PACKAGES: builds on epoch.el hook *create-screen-hook*
;;;
;;; HISTORY:
;;; Oct 21 11:10 1992 : created.
;;;===========================================================================
;;; To change what icon is used for a particular mode, or to add a mode
;;; merely append them to the front of the alist
(setq icon-mode-alist
'((dired-mode . "dired.icon")
(gnus-Group-mode . "news.icon")
(Info-mode . "emacs.icon")
(fundamental-mode . "emacs.icon")
(modula-2-mode . "emacs.icon")
(c-mode . "c.icon")
(c++-mode . "c++.icon")
(ada-mode . "emacs.icon")
(lisp-mode . "emacs.icon")
(indented-text-mode . "doc.icon")))
(defvar epoch-icons-pixmap-directory (format "%s/bitmaps/" (getenv "HOME"))
"This variable points to the directory where your icon pixmaps are located. by default it points to the bitmaps directory located in your HOME directory.")
(defun set-mode-based-icon ()
"Set the icon for the current mode"
(let ((icon (cdr (assoc major-mode icon-mode-alist))))
(epoch::icon-pixmap (format "%s%s" epoch-icons-pixmap-directory icon))))
(defun initialy-set-mode-based-icon (alist)
"Set the icon for the current mode when called with the mode alist"
(let ((icon (cdr (assoc major-mode icon-mode-alist))))
(epoch::icon-pixmap (format "%s%s" epoch-icons-pixmap-directory icon)))
alist)
; This makes the code above work.
(push 'set-mode-based-icon *select-screen-hook* )
(push 'initialy-set-mode-based-icon *create-screen-alist-hook* )
--
+-----------------------------+-------------------------------------------+
| Frank Caico | fcaic@wbst845e.xerox.com |
+-----------------------------+-------------------------------------------+
| Xerox KBS Competency Ctr. | |
| Bldg. 845-20C | "I am pink, therefore I am Spam." |
| Webster, NY 14580 | |
+-----------------------------+-------------------------------------------+
Technical Details
Message-ID:
<FCAIC.92Oct22101211@woody.wbst845e.xerox.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!sdd.hp.com!caen!uwm.edu!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!rutgers!rochester!rocksanne!spectrum!fcaicReferences:
<FCAIC.92Oct20115018@woody.wbst845e.xerox.com> <BLK.92Oct21143051@vanity.mitre.org>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fc7ee,8cd90657a4db292e X-Google-Attributes: gidfc7ee,public X-Google-ArrivalTime: 1992-10-22 09:17:06 PST Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!sdd.hp.com!caen!uwm.edu!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!rutgers!rochester!rocksanne!spectrum!fcaic From: fcaic@wbst845e.xerox.com (Frank Caico) Newsgroups: gnu.epoch.misc Subject: Re: changing icons Message-ID: <FCAIC.92Oct22101211@woody.wbst845e.xerox.com> Date: 22 Oct 92 15:12:11 GMT References: <FCAIC.92Oct20115018@woody.wbst845e.xerox.com> <BLK.92Oct21143051@vanity.mitre.org> Sender: news@spectrum.xerox.com Distribution: gnu.epoch.misc Organization: Xerox, Webster, NY Lines: 86 In-Reply-To: blk@mitre.org's message of 21 Oct 92 19:30:51 GMT