Loading ...
Sorry, an error occurred while loading the content.

Vim6 with gnome

Expand Messages
  • Jiri Cerny
    Hello, the gnome version of Vim 6.0h refuses gvim options like -rv -reverse -geom etc. The problem is in the function gui_mch_init_check() in gui_gtk_x11.c.
    Message 1 of 3 , Oct 1, 2000
    • 0 Attachment
      Hello,

      the gnome version of Vim 6.0h refuses gvim options like -rv -reverse -geom
      etc. The problem is in the function gui_mch_init_check() in
      gui_gtk_x11.c. Acctually, there is the difference is between the behaviour
      of gtk_init_check() that removes all gtk arguments from argv and leaves
      the rest, and gnome_init(), that accepts only gnome-options. The solution
      is probably not to copy these options to gui_argv in gui_mch_prepare() if
      FEAT_GUI_GNOME enabled.

      The following patch works for me, but it is realy the simplest
      possibility. May be we don't need to copy these options in all cases ???

      *** ../../vim60h/src/gui_gtk_x11.c Sat Aug 12
      11:47:41 2000
      --- gui_gtk_x11.c Sun Oct 1 20:37:35 2000
      ***************
      *** 338,344 ****
      --- 338,346 ----
      }

      /* Found match in table, so move it into gui_argv */
      + #ifndef FEAT_GUI_GNOME
      gui_argv[gui_argc++] = argv[arg];
      + #endif
      if (--*argc > arg)
      {
      mch_memmove(&argv[arg], &argv[arg + 1],
      ***************
      *** 346,352 ****
      --- 348,356 ----
      if (cmdline_options[i].has_value)
      {
      /* Move the option argument as well. */
      + #ifndef FEAT_GUI_GNOME
      gui_argv[gui_argc++] = argv[arg];
      + #endif
      if (--*argc > arg)
      mch_memmove(&argv[arg], &argv[arg + 1],
      (*argc - arg) * sizeof(char *));




      --
      Jiri Cerny
      DMA, EPFL, 1015 Lausanne - Ecublens
      tel. +41-21-693 5507, fax +41-21-693 4303
    • Bram Moolenaar
      ... This is a bit confusing. It seems the problem is that Gnome refuses to start when it sees a command line option that it doesn t understand. So we need a
      Message 2 of 3 , Oct 2, 2000
      • 0 Attachment
        Jiri Cerny wrote:

        > the gnome version of Vim 6.0h refuses gvim options like -rv -reverse -geom
        > etc. The problem is in the function gui_mch_init_check() in
        > gui_gtk_x11.c. Acctually, there is the difference is between the behaviour
        > of gtk_init_check() that removes all gtk arguments from argv and leaves
        > the rest, and gnome_init(), that accepts only gnome-options. The solution
        > is probably not to copy these options to gui_argv in gui_mch_prepare() if
        > FEAT_GUI_GNOME enabled.

        This is a bit confusing. It seems the problem is that Gnome refuses to start
        when it sees a command line option that it doesn't understand. So we need a
        full list of Gnome arguments. Only those need to be passed to gnome_init().

        Annoying, if in the future Gnome accepts different arguments we need to adjust
        the table...

        Another problem is that gnome_init() simply exits when it finds an error.
        Very annoying when using the ":gui" command. This may leave unpreserved swap
        files behind. Is there a way around this?

        Perhaps gnome_init_with_popt_table() should be used, but it looks
        complicated...

        --
        hundred-and-one symptoms of being an internet addict:
        115. You are late picking up your kid from school and try to explain
        to the teacher you were stuck in Web traffic.

        /// Bram Moolenaar Bram@... http://www.moolenaar.net \\\
        \\\ Vim: http://www.vim.org ICCF Holland: http://iccf-holland.org ///
      • Jiri Cerny
        On Mon, 2 Oct 2000, Bram Moolenaar wrote: BM BM This is a bit confusing. It seems the problem is that Gnome BM refuses to start when it sees a command line
        Message 3 of 3 , Oct 2, 2000
        • 0 Attachment
          On Mon, 2 Oct 2000, Bram Moolenaar wrote:

          BM>
          BM> This is a bit confusing. It seems the problem is that Gnome
          BM> refuses to start when it sees a command line option that it
          BM> doesn't understand. So we need a full list of Gnome arguments.
          BM> Only those need to be passed to gnome_init().

          The following patch add some (may be all) gnome arguments. I am not sure
          with "--help" argument. It is gnome standard argument but then the
          behaviour is a little bit confusing.

          vim --help - start vim, no help message
          vim -g --help - print gnome standard help and exit

          BM>
          BM> Annoying, if in the future Gnome accepts different arguments we
          BM> need to adjust the table...

          It's like this. However, we do the same for gtk arguments.

          BM> Perhaps gnome_init_with_popt_table() should be used, but it looks
          BM> complicated...
          BM>

          Seems complicated to me too.

          In the patch I also commented out the copying of -rv, -geom, ... to
          gui_argv. It seems to me, that we don't need them there.

          Jiri

          --
          Jiri Cerny
          DMA, EPFL, 1015 Lausanne - Ecublens
          tel. +41-21-693 5507, fax +41-21-693 4303





          *** ../../vim60h/src/gui_gtk_x11.c Sat Aug 12 11:47:41 2000
          --- gui_gtk_x11.c Mon Oct 2 10:15:51 2000
          ***************
          *** 267,273 ****
          };

          /*
          ! * Arguments handled by GTK internally.
          */
          static char *gtk_cmdline_options[] =
          {
          --- 267,273 ----
          };

          /*
          ! * Arguments handled by GTK (and GNOME) internally.
          */
          static char *gtk_cmdline_options[] =
          {
          ***************
          *** 283,288 ****
          --- 283,301 ----
          "--gtk-module=",
          "-display",
          "--display",
          + #ifdef FEAT_GUI_GNOME
          + "--disable-sound",
          + "--enable-sound",
          + "--espeaker=",
          + "--version",
          + "-?",
          + "--help",
          + "--usage",
          + "--disable-crash-dialog",
          + "--sm-client-id=",
          + "--sm-config-prefix=",
          + "--sm-disable",
          + #endif
          NULL
          };

          ***************
          *** 338,344 ****
          --- 351,359 ----
          }

          /* Found match in table, so move it into gui_argv */
          + #if 0
          gui_argv[gui_argc++] = argv[arg];
          + #endif
          if (--*argc > arg)
          {
          mch_memmove(&argv[arg], &argv[arg + 1],
          ***************
          *** 346,352 ****
          --- 361,369 ----
          if (cmdline_options[i].has_value)
          {
          /* Move the option argument as well. */
          + #if 0
          gui_argv[gui_argc++] = argv[arg];
          + #endif
          if (--*argc > arg)
          mch_memmove(&argv[arg], &argv[arg + 1],
          (*argc - arg) * sizeof(char *));
        Your message has been successfully submitted and would be delivered to recipients shortly.