When I run ‘xterm -name junk’, I get an xterm whose class name according to xprop, is ‘junk’. This is the way it’s supposed to work, I think. When I run ‘sxemacs -name junk’ the class name is not set to ‘junk’. It’s still ‘emacs’. What does ‘sxemacs -name’ really do? The reason I ask is that my window manager (fvwm) will make a window sticky and I use SXEmacs to read my mail. I want that SXEmacs window to be sticky, without having to use the window manager’s function to set the window sticky. What gives?
‘sxemacs -name’ sets the application name for the program (that is,
the thing which normally comes from ‘argv’). Using ‘-name’
is the same as making a copy of the executable with that new name. The
WM_CLASS property on each frame is set to the frame-name, and the
application-class. So, if you did ‘sxemacs -name FOO’ and then
created a frame named BAR, you’d get an X window with WM_CLASS =
( "BAR", "Emacs"). However, the resource hierarchy for this
widget would be:
Name: FOO .shell .container .BAR Class: Emacs .TopLevelEmacsShell.EmacsManager.EmacsFrame
instead of the default
Name: sxemacs.shell .container .emacs Class: Emacs .TopLevelEmacsShell.EmacsManager.EmacsFrame
It is arguable that the first element of WM_CLASS should be set to the application-name instead of the frame-name, but I think that’s less flexible, since it does not give you the ability to have multiple frames with different WM_CLASS properties. Another possibility would be for the default frame name to come from the application name instead of simply being ‘emacs’. However, at this point, making that change would be troublesome: it would mean that many users would have to make yet another change to their resource files (since the default frame name would suddenly change from ‘emacs’ to ‘sxemacs’, or whatever the executable happened to be named), so we’d rather avoid it.
To make a frame with a particular name use:
(make-frame '((name . "the-name")))