Thread View: gnu.epoch.misc
5 messages
5 total messages
Started by Frank Caico
Tue, 20 Oct 1992 16:50
changing icons
Author: Frank Caico
Date: Tue, 20 Oct 1992 16:50
Date: Tue, 20 Oct 1992 16:50
30 lines
2002 bytes
2002 bytes
I am trying to write an elisp package for epoch that would change the icon of the current screen based upon what mode is active in that screen. Heres why: As I use epoch I end up with alot of screens open - many of them iconized. It would be much easier to find the screen I want if for instance dired windows have a file cabinet as the icon, and so on. Here are the problems: If I change the icon in the mode-hook then I have to change every mode-hook that I want to have a non-default icon in. Also, if I execute a switch-to-buffer which changes the screens mode, it does not re-execute the mode-hook. I dont want to mess with the after or before-change hooks as this would probably slow down epoch needlessly. So how can I write this in such a way as to keep my icons consistent with the screens? Please help! -- +-----------------------------+-------------------------------------------+ | Frank Caico | fcaic@wbst845e.xerox.com | +-----------------------------+-------------------------------------------+ | Xerox KBS Competency Ctr. | | | Bldg. 845-20C | "I am pink, therefore I am Spam." | | Webster, NY 14580 | | +-----------------------------+-------------------------------------------+
Re: changing icons
Author: Brian L. Kahn
Date: Wed, 21 Oct 1992 19:30
Date: Wed, 21 Oct 1992 19:30
25 lines
1414 bytes
1414 bytes
Try working with the window-select-hook and set-window-buffer-hook.
An example of using these two:
(defun ep:do-titles (win)
"Do screen title, WIN currently selected."
;; change screen title if new name, not minibuf
(let ((scr (buffer-name (window-buffer win))))
(if (not (string-equal (title) scr))
(if (not (string-match "Minibuf" scr))
(title scr (screen-of-window win))
(icon-name scr (screen-of-window win))
))))
(setq set-window-buffer-hook
(func (win) (ep:do-titles win)))
(setq window-select-hook
(func (win) (ep:do-titles win)))
--
B< Brian Kahn blk@mitre.org "may the farce be with you"
Re: changing icons
Author: 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 | |
+-----------------------------+-------------------------------------------+
Re: changing icons
Author: Carl-Oscar Montelius
Date: Mon, 26 Oct 1992 15:35
Date: Mon, 26 Oct 1992 15:35
21 lines
1390 bytes
1390 bytes
fcaic@wbst845e.xerox.com (Frank Caico) writes: >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. . . . I tried the elisp icon code but it didn't work at all. It seems that the variable "epoch::icon-pixmap" is not known by epoch. Is there something more I have to load to make it work? I'm running version 4.2. /Carl-Oscar
Re: changing icons
Author: Frank Caico
Date: Mon, 26 Oct 1992 18:11
Date: Mon, 26 Oct 1992 18:11
43 lines
2656 bytes
2656 bytes
euacom@eua.ericsson.se (Carl-Oscar Montelius) writes:
> I tried the elisp icon code but it didn't work at all.
> It seems that the variable "epoch::icon-pixmap" is not known by epoch.
> Is there something more I have to load to make it work?
> I'm running version 4.2.
I too am using Epoch 4.2.
I got this from the info file on epoch:
-----------------------------------------------------------------------------
NOTE: Behavior when iconifying screens is largely dependent on the
window manager. This dependence includes the window manager's
treatment of window groups (in which the minibuffer screen is group
leader of all Epoch screens), as well as whether to respect hints for
icon name, placement, icon-pixmap, etc.
.
.
.
* Function: epoch::icon-pixmap PIXMAP-NAME &optional SCREEN
Sets SCREEN to use PIXMAP-NAME as a bitmap image when screen is
iconified. PIXMAP-NAME may be a string (absolute path to a
bitmap file), or an X Resource of type Bitmap.
-----------------------------------------------------------------------------
Perhaps you don't have epoch compiled properly? Anyways, if you find out
why you do not have epoch::icon-pixmap please let me know.
Frank
--
+-----------------------------+-------------------------------------------+
| Frank Caico | fcaic@wbst845e.xerox.com |
+-----------------------------+-------------------------------------------+
| Xerox KBS Competency Ctr. | |
| Bldg. 845-20C | "I am pink, therefore I am Spam." |
| Webster, NY 14580 | |
+-----------------------------+-------------------------------------------+
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads