Subject: FVWM: Changing Icons for Xemacs

From: Andrew Jaffe <[email-masked]>
Date: Mon, 22 Apr 1996 11:51:10 -0400

Hi, folks,

I would think this is a FAQ, but I couldn't find it anywhere...

I want to change the Icon of a window based on its name and/or icon
name. Simple, right? Well, it *almost* works for XEmacs.

In XEmacs, I have 
	(setq frame-title-format "%S: %b")
	(setq frame-icon-title-format "%b")
which sets the name and icon name to "emacs: buffername" and
"buffername" respectively. In my .fvwm2rc, I have

Style "emacs"		Icon gnu-animal.xpm
Style "emacs*INBOX*"	Icon xmail.xpm, StickyIcon
Style "emacs* Summary$"	Icon xmail.xpm, StickyIcon
Style "emacs*mail*"	Icon xmail.xpm, StickyIcon
Style "emacs: *Group*"	Icon news212.xpm
Style "emacs*Summary *"	Icon news212.xpm

The idea is for a normal xemacs icon to be gnu-animal, a mail window to
be xmail, and a news window to be news212. It doesn't quite work: it
seems that the icon is determined by the name of the frame that
"created" the frame in question (since, I think, the new frame-name
isn't assigned until later in the process, after fvwm determines the
icon).

Does this make sense? Is there a fix? I can fix it now by creating new
frames (C-x 5 b) and destroying old ones (C-x 5 0), but that's
considerably less than automatic.

Thanks,

Andrew

----------------------------------------------------------------------
Andrew Jaffe					[email-masked]
CITA, U. Toronto				(416) 978-8497, 6879
60 Saint George St.				         -3921 (Fax)
Toronto, ON M5S 1A1 CANADA			
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dave Goldberg <[email-masked]>
Date: Mon, 22 Apr 1996 12:08:08 -0400

A long time ago, for GNU Emacs 19.2(something < 9) I created
dsg-frames.el which is available from the ohio-state archive.  Frame
creation was changed in 19.29 and later and although parts of
dsg-frames.el are stil useful, the stuff that generated the window
name ahead of time, which fvwm needs to do icons "right" no longer
works.  I've given up looking for a fix and have settled on xbm icons
that emacs allows me to set in the frame-parameters.  I don't use
xemacs, and I have no idea if the concepts I used in dsg-frames.el can
be made to work there (I do know it won't run on it directly) but it
might be worth looking into.  If you can't get it from the elisp
archive, let me know and I'll email a copy.  While it's not huge, it
doesn't seem proper to burden the fvwm list with it.

Dave Goldberg
Post: The Mitre Corporation\MS B305\202 Burlington Rd.\Bedford, MA 01730
Phone: 617-271-3887
Email: [email-masked]

---

From: Dan Espen <[email-masked]>
Date: Mon, 22 Apr 1996 12:37:39 -0400

----------
> considerably less than automatic.

Yes,  I have been fighting  this for a while.    I have to run 2
XEmacs's and I want them to get different icons and be able to warp to them
through different keystrokes.   The only way I have
been able to deal with it is I start the XEmacs like this:

xemacs -unmapped -f name-me

In my .emacs:

(defun name-me ()
  "Come up with different name when invoked on another system"
  (interactive)
  (setq frame-icon-title-format "altname") ;sets icon-name
  (setq frame-title-format "altname")	;sets name
  (setq default-frame-alist '((name . "altname")))
  (select-frame (make-frame '((name . "altname")))) ;resource name
)

It's a bit of a mess, but it works for me.

--
Dan Espen                                    Phone: (908) 699-5570
[email-masked]
444 Hoes Lane  Room RRC 1C-214
Piscataway, NJ 08854
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Mark Borges <[email-masked]>
Date: 22 Apr 1996 11:55:44 -0600

>> On Mon, 22 Apr 1996 11:51:10 -0400,
>> Andrew Jaffe(AJ) wrote:
AJ> Style "emacs"		Icon gnu-animal.xpm
AJ> Style "emacs*INBOX*"	Icon xmail.xpm, StickyIcon
AJ> Style "emacs* Summary$"	Icon xmail.xpm, StickyIcon
AJ> Style "emacs*mail*"	Icon xmail.xpm, StickyIcon
AJ> Style "emacs: *Group*"	Icon news212.xpm
AJ> Style "emacs*Summary *"	Icon news212.xpm

For emacsen, the same effect can be achieved using the elisp package

;;; FRAME-ICON.EL - set up mode-specific icons for each frame in XEmacs
;;; Copyright (C) 1993, 1994, 1995 Michael J Lamoureux
;;
;; To set up frame-icon, do something like this:
;;   (setq frame-icon-directory "~/emacs/icons/")
;; or:
;;   (setq frame-icon-directory '("~/emacs/icons/" "/usr/local/icons"))
;;
;; then:
;;   (require 'frame-icon)
;;
;; You can add/change mode icons like this:
;;   (frame-icon-add-mode '(bogus-mode . "bogosity.xbm"))

-- 
  -mb-