Subject: FVWM: function definition?

From: John Palmieri <[email-masked]>
Date: Tue, 8 Oct 1996 17:32:53 -0400 (EDT)

Hi,

I am new to using fvwm.  I'm quite pleased with it, except I find that
I want a function that does the following:

  if an xdvi window is visible, then switch to an emacs window (via
     'Next [Emacs] Focus', for instance)
  if an emacs window is visible, then switch to an xdvi window
  if neither is visible, switch to an emacs window

How can I write a function (or use an appropriate module) so I can
have a single key bound to this sort of thing?

-------------------------------------------------------------
		o
		|\
		o )		John H. Palmieri
	       / /		[email-masked]
	      /	o		http://www-math.mit.edu/~palmieri/
	     / /|		
	    o / o		Department of Mathematics         
	    |/ /		M.I.T., Room 2-388                
	    o /			Cambridge, MA 02139               
	   / /			617-253-4064                  
	  ( o			
	   \|
	    o
--
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: H}vard Fosseng <[email-masked]>
Date: Wed, 9 Oct 1996 00:28:09 +0200

>   if neither is visible, switch to an emacs window

You might give the emacs and the xdvi (if it exists) the same title,
and make sure they are the only ones with that particular title. Then,
if both exist, some key like

	Next [ <title> ] Focus

should give focus to whichever one of them doesn't currently have it.
If only the emacs exists, the key should always give that focus.

Håvard Fosseng

---

From: John Palmieri <[email-masked]>
Date: 09 Oct 1996 13:06:20 -0400

> should give focus to whichever one of them doesn't currently have it.

I like this idea, but I can't figure out how to give xdvi a title.
"xdvi -title blah" doesn't work, there doesn't seem to be a "Title"
resource that I can attach to XDvi, etc.  I could call my emacs window
"Xdvi", but that violates my sense of aesthetics.  Do I have to make
this sacrifice, or is there an alternative?

John Palmieri
[email-masked]

---

From: John Palmieri <[email-masked]>
Date: 16 Oct 1996 10:15:19 -0400

>   if neither is visible, switch to an emacs window

A friend made the following suggestion: 

  Key F12  A  A  Function EmacsXdvi

  AddToFunc EmacsXdvi
  +  "I"  Function GoToEmacs
  +  "I"  Key F12 A A XdviEmacs

  AddToFunc XdviEmacs
  +  "I"  Function GoToXdvi
  +  "I"  Key F12 A A EmacsXdvi

This works, but it has the following disadvantages: I don't know how
to bind a button (as in FvwmButtons) to behave similarly, and this
business is annoying if I want to bind several different keys to this
same thing (I'm not using F11-F20 for anything, so rather than bind
one of them and try to remember which one, I thought I might bind a
lot of them to do this).

Any suggestions for improvements?

		John Palmieri
		[email-masked]