Saturday, September 8, 2012

Re: Setting WM_CLASS

On Sun, 9 Sep 2012, Tony Mechelynck wrote:

> On 09/09/12 07:13, Benjamin R. Haskell wrote:
>> On Sun, 9 Sep 2012, Tony Mechelynck wrote:
>>
>>> It is not documented in the Vim help AFAICT. But looking down that
>>> list suggests (and experiment shows) that typing
>>>
>>> vim -?
>>>
>>> at a Unix-like shell prompt will give the help for GTK and GNOME
>>> command-line arguments if your "vim" binary was compiled with GNOME
>>> GUI support. However Vim still starts the editor in that case, so
>>>
>>> vim -? -cq
>>>
>>> is better. You will still get an E852 error and a hit-Enter prompt
>>> after the help; just hit Enter to go back to the shell prompt.
>>
>> `vim -?` gets me:
>>
>> VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Sep 9 2012 00:49:50)
>> Unknown option argument: "-?"
>> More info with: "vim -h"
>>
>> So, "-?" must be handled by something guarded by FEAT_GNOME.
>
> Yes, as I said ("[...] if your "vim" binary was compiled with GNOME
> GUI support.")

Ah. Overlooked that. It's quite counterintuitive that the explanation
of the GTK-specific options requires GNOME support (despite not being
GNOME-specific).


>>> Or else,
>>>
>>> vim --help
>>> or
>>> vim --help |less
>>>
>>> will give _both_ the Vim command-line help and the GTK/GNOME
>>> command-line help (if compiled-in). That's quite a lot of console
>>> output, hence the |less redirection.
>>
>> `gvim --help` doesn't explain the "--name" or "--class" options, despite
>> having a section with the heading:
>>
>> Arguments recognized by gvim (GTK+ version):
>>
>> Were the options just overlooked?
>>
>
> In this case too, it's part of the same #ifdef FEAT_GUI_GNOME section:

Right. It's conditioned on FEAT_GUI_GNOME. But, the options work with
GTK2 (sans GNOME). If I add an #error preprocessor directive before
this line:

> {"--class", ARG_FOR_GTK|ARG_HAS_VALUE|ARG_COMPAT_LONG},

Compilation hits it. But, I don't have any of these ARG_FOR_GTK-labeled
arguments in my help output the way you do.


> This is what I get from "vim -? -cq" in a Gnome-enabled Vim:

[skipping... I didn't realize "-?" was GNOME-not-GTK-specific.]


> and this is what I get from "vim --help" in the same build:
>
>
> linux:~ # vim --help
> VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Sep 5 2012 22:31:57)
>
> usage: vim [arguments] [file ..] edit specified file(s)
> or: vim [arguments] - read text from stdin
> or: vim [arguments] -t tag edit file where tag is defined
> or: vim [arguments] -q [errorfile] edit file with first error
>
> Arguments:
> [Ed. trimming]
> -h or --help Print Help (this message) and exit
> --version Print version information and exit
>
> Arguments recognised by gvim (GTK+ version):
> -font <font> Use <font> for normal text (also: -fn)
> -geometry <geom> Use <geom> for initial geometry (also: -geom)
> -reverse Use reverse video (also: -rv)
> -display <display> Run vim on <display> (also: --display)
> --role <role> Set a unique role to identify the main window
> --socketid <xid> Open Vim inside another GTK widget
> --echo-wid Make gvim echo the Window ID on stdout

Here is where non-GNOME output stops. So, the GTK+ section you list
below is not present (despite the options being present).

Probably the correct solution is to condition something on FEAT_GUI_GTK
rather than FEAT_GUI_GNOME.


> Usage: vim [OPTION...]
> --load-modules=MODULE1,MODULE2,... Dynamic modules to load
>
> Help options
> -?, --help Show this help message
> --usage Display brief usage message
>
> GTK+
> --gdk-debug=FLAGS Gdk debugging flags to set
> --gdk-no-debug=FLAGS Gdk debugging flags to unset
> --display=DISPLAY X display to use
> --screen=SCREEN X screen to use
> --sync Make X calls synchronous
> --name=NAME Program name as used by the window manager
> --class=CLASS Program class as used by the window manager
> --gtk-debug=FLAGS Gtk+ debugging flags to set
> --gtk-no-debug=FLAGS Gtk+ debugging flags to unset
> --g-fatal-warnings Make all warnings fatal
> --gtk-module=MODULE Load an additional Gtk module

[This is the GTK+ section that is absent.]

The rest of your output is also not present in my build, but that makes
sense as (AFAIK) it's all GNOME-specific.

So, these headings are not there:

> Bonobo activation Support
> GNOME Library
> Session management
> GNOME GUI Library

--
Best,
Ben

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: