On 09/09/12 07:13, Benjamin R. Haskell wrote:
On Sun, 9 Sep 2012, Tony Mechelynck wrote:

On 08/09/12 23:02, Benjamin R. Haskell wrote:
On Sat, 8 Sep 2012, Marco wrote:

is it possible to set the WM_CLASS of gVim to a custom value?

If you're using a GTK version of gvim, you should be able to pass the
'--class' commandline argument.

[...]

Not sure this is documented anywhere.  [...]

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.")



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: look just before the #if 0: these are gui_gtk_x11.c lines 333-365:

    /* Arguments handled by GTK (and GNOME) internally. */
    {"--g-fatal-warnings",    ARG_FOR_GTK},
    {"--gdk-debug",           ARG_FOR_GTK|ARG_HAS_VALUE},
    {"--gdk-no-debug",                ARG_FOR_GTK|ARG_HAS_VALUE},
    {"--gtk-debug",           ARG_FOR_GTK|ARG_HAS_VALUE},
    {"--gtk-no-debug",                ARG_FOR_GTK|ARG_HAS_VALUE},
    {"--gtk-module",          ARG_FOR_GTK|ARG_HAS_VALUE},
    {"--sync",                        ARG_FOR_GTK},
    {"--display",             ARG_FOR_GTK|ARG_HAS_VALUE|ARG_COMPAT_LONG},
    {"--name",                        
ARG_FOR_GTK|ARG_HAS_VALUE|ARG_COMPAT_LONG},
    {"--class",                       
ARG_FOR_GTK|ARG_HAS_VALUE|ARG_COMPAT_LONG},
    {"--screen",              ARG_FOR_GTK|ARG_HAS_VALUE},
    {"--gxid-host",           ARG_FOR_GTK|ARG_HAS_VALUE},
    {"--gxid-port",           ARG_FOR_GTK|ARG_HAS_VALUE},
#ifdef FEAT_GUI_GNOME
    {"--load-modules",                ARG_FOR_GTK|ARG_HAS_VALUE},
    {"--sm-client-id",                ARG_FOR_GTK|ARG_HAS_VALUE},
    {"--sm-config-prefix",    ARG_FOR_GTK|ARG_HAS_VALUE},
    {"--sm-disable",          ARG_FOR_GTK},
    {"--oaf-ior-fd",          ARG_FOR_GTK|ARG_HAS_VALUE},
    {"--oaf-activate-iid",    ARG_FOR_GTK|ARG_HAS_VALUE},
    {"--oaf-private",         ARG_FOR_GTK},
    {"--enable-sound",                ARG_FOR_GTK},
    {"--disable-sound",               ARG_FOR_GTK},
    {"--espeaker",            ARG_FOR_GTK|ARG_HAS_VALUE},
    {"-?",                    ARG_FOR_GTK|ARG_NEEDS_GUI},
    {"--help",                        ARG_FOR_GTK|ARG_NEEDS_GUI|ARG_KEEP},
    {"--usage",                       ARG_FOR_GTK|ARG_NEEDS_GUI},
# if 0 /* conflicts with Vim's own --version argument */
    {"--version",             ARG_FOR_GTK|ARG_NEEDS_GUI},
# endif
    {"--disable-crash-dialog",        ARG_FOR_GTK},
#endif


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


linux:~ # vim -? -cq
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

Bonobo activation Support
--oaf-ior-fd=FD File descriptor to print IOR on
      --oaf-activate-iid=IID                 IID to activate
--oaf-private Prevent registering of server with OAF

GNOME Library
      --disable-sound                        Disable sound server usage
      --enable-sound                         Enable sound server usage
--espeaker=HOSTNAME:PORT Host:port on which the sound server to use is running
      --version                              2.32.1

Session management
      --sm-client-id=ID                      Specify session management ID
--sm-config-prefix=PREFIX Specify prefix of saved configuration --sm-disable Disable connection to session manager

GNOME GUI Library
      --disable-crash-dialog                 Disable Crash Dialog
E852: The child process failed to start the GUI
Press ENTER or type command to continue
linux:~ #


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:
   --                   Only file names after this
   -g                   Run using GUI (like "gvim")
   -f  or  --nofork     Foreground: Don't fork when starting GUI
   -v                   Vi mode (like "vi")
   -e                   Ex mode (like "ex")
   -E                   Improved Ex mode
   -s                   Silent (batch) mode (only for "ex")
   -d                   Diff mode (like "vimdiff")
   -y                   Easy mode (like "evim", modeless)
   -R                   Readonly mode (like "view")
   -Z                   Restricted mode (like "rvim")
   -m                   Modifications (writing files) not allowed
   -M                   Modifications in text not allowed
   -b                   Binary mode
   -l                   Lisp mode
   -C                   Compatible with Vi: 'compatible'
   -N                   Not fully Vi compatible: 'nocompatible'
   -V[N][fname]         Be verbose [level N] [log messages to fname]
   -D                   Debugging mode
   -n                   No swap file, use memory only
   -r                   List swap files and exit
   -r (with file name)  Recover crashed session
   -L                   Same as -r
   -A                   start in Arabic mode
   -H                   Start in Hebrew mode
   -F                   Start in Farsi mode
   -T <terminal>        Set terminal type to <terminal>
   -u <vimrc>           Use <vimrc> instead of any .vimrc
   -U <gvimrc>          Use <gvimrc> instead of any .gvimrc
   --noplugin           Don't load plugin scripts
   -p[N]                Open N tab pages (default: one for each file)
   -o[N]                Open N windows (default: one for each file)
   -O[N]                Like -o but split vertically
   +                    Start at end of file
   +<lnum>              Start at line <lnum>
   --cmd <command>      Execute <command> before loading any vimrc file
   -c <command>         Execute <command> after loading the first file
   -S <session>         Source file <session> after loading the first file
   -s <scriptin>        Read Normal mode commands from file <scriptin>
   -w <scriptout>       Append all typed commands to file <scriptout>
   -W <scriptout>       Write all typed commands to file <scriptout>
   -x                   Edit encrypted files
   -X                   Do not connect to X server
   --remote <files>     Edit <files> in a Vim server if possible
   --remote-silent <files>  Same, don't complain if there is no server
--remote-wait <files> As --remote but wait for files to have been edited
   --remote-wait-silent <files>  Same, don't complain if there is no server
--remote-tab[-wait][-silent] <files> As --remote but use tab page per file
   --remote-send <keys> Send <keys> to a Vim server and exit
   --remote-expr <expr> Evaluate <expr> in a Vim server and print result
   --serverlist         List available Vim server names and exit
   --servername <name>  Send to/become the Vim server <name>
   --startuptime <file> Write startup timing messages to <file>
   -i <viminfo>         Use <viminfo> instead of .viminfo
   -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

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

Bonobo activation Support
--oaf-ior-fd=FD File descriptor to print IOR on
      --oaf-activate-iid=IID                 IID to activate
--oaf-private Prevent registering of server with OAF

GNOME Library
      --disable-sound                        Disable sound server usage
      --enable-sound                         Enable sound server usage
--espeaker=HOSTNAME:PORT Host:port on which the sound server to use is running
      --version                              2.32.1

Session management
      --sm-client-id=ID                      Specify session management ID
--sm-config-prefix=PREFIX Specify prefix of saved configuration --sm-disable Disable connection to session manager

GNOME GUI Library
      --disable-crash-dialog                 Disable Crash Dialog
linux:~ #


Best regards,
Tony.
--
"I've seen, I SAY, I've seen better heads on a mug of beer"
                -- Senator Claghorn

--
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

Reply via email to