home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.2.242 < prev    next >
Encoding:
Internet Message Format  |  2004-02-05  |  5.0 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.2.242
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.2.242
  11. Problem:    Gnome: "vim --help" only shows the Gnome arguments, not the Vim
  12.         arguments.
  13. Solution:   Don't let the Gnome code remove the "--help" argument and don't
  14.         exit at the end of usage().
  15. Files:        src/gui_gtk_x11.c, src/main.c
  16.  
  17.  
  18. *** ../vim-6.2.241/src/gui_gtk_x11.c    Thu Feb  5 15:28:32 2004
  19. --- src/gui_gtk_x11.c    Fri Feb  6 16:42:40 2004
  20. ***************
  21. *** 298,303 ****
  22. --- 298,305 ----
  23.   #define ARG_NEEDS_GUI    0x0200    /* need to initialize the GUI for this      */
  24.   #define ARG_FOR_GTK    0x0400    /* argument is handled by GTK+ or GNOME   */
  25.   #define ARG_COMPAT_LONG    0x0800    /* accept -foo but substitute with --foo  */
  26. + #define ARG_KEEP    0x1000    /* don't remove argument from argv[] */
  27.   /*
  28.    * This table holds all the X GUI command line options allowed.  This includes
  29.    * the standard ones so that we can skip them when Vim is started without the
  30. ***************
  31. *** 379,385 ****
  32.       {"--disable-sound",        ARG_FOR_GTK},
  33.       {"--espeaker",        ARG_FOR_GTK|ARG_HAS_VALUE},
  34.       {"-?",            ARG_FOR_GTK|ARG_NEEDS_GUI},
  35. !     {"--help",            ARG_FOR_GTK|ARG_NEEDS_GUI},
  36.       {"--usage",            ARG_FOR_GTK|ARG_NEEDS_GUI},
  37.   # if 0 /* conflicts with Vim's own --version argument */
  38.       {"--version",        ARG_FOR_GTK|ARG_NEEDS_GUI},
  39. --- 381,387 ----
  40.       {"--disable-sound",        ARG_FOR_GTK},
  41.       {"--espeaker",        ARG_FOR_GTK|ARG_HAS_VALUE},
  42.       {"-?",            ARG_FOR_GTK|ARG_NEEDS_GUI},
  43. !     {"--help",            ARG_FOR_GTK|ARG_NEEDS_GUI|ARG_KEEP},
  44.       {"--usage",            ARG_FOR_GTK|ARG_NEEDS_GUI},
  45.   # if 0 /* conflicts with Vim's own --version argument */
  46.       {"--version",        ARG_FOR_GTK|ARG_NEEDS_GUI},
  47. ***************
  48. *** 560,586 ****
  49.       if (option->flags & ARG_NEEDS_GUI)
  50.           gui.starting = TRUE;
  51.   
  52. !     /* Now remove the flag from the argument vector. */
  53. !     if (--*argc > i)
  54.       {
  55. !         int n_strip = 1;
  56. !         /* Move the argument's value as well, if there is one. */
  57. !         if ((option->flags & ARG_HAS_VALUE)
  58. !             && argv[i][len] != '='
  59. !             && strcmp(argv[i + 1], "--") != 0)
  60.           {
  61. !         ++n_strip;
  62. !         --*argc;
  63. !         if (option->flags & ARG_FOR_GTK)
  64. !             gui_argv[gui_argc++] = argv[i + 1];
  65. !         }
  66.   
  67. !         if (*argc > i)
  68. !         mch_memmove(&argv[i], &argv[i + n_strip],
  69. !                 (*argc - i) * sizeof(char *));
  70.       }
  71. -     argv[*argc] = NULL;
  72.       }
  73.   
  74.       gui_argv[gui_argc] = NULL;
  75. --- 562,593 ----
  76.       if (option->flags & ARG_NEEDS_GUI)
  77.           gui.starting = TRUE;
  78.   
  79. !     if (option->flags & ARG_KEEP)
  80. !         ++i;
  81. !     else
  82.       {
  83. !         /* Remove the flag from the argument vector. */
  84. !         if (--*argc > i)
  85.           {
  86. !         int n_strip = 1;
  87.   
  88. !         /* Move the argument's value as well, if there is one. */
  89. !         if ((option->flags & ARG_HAS_VALUE)
  90. !             && argv[i][len] != '='
  91. !             && strcmp(argv[i + 1], "--") != 0)
  92. !         {
  93. !             ++n_strip;
  94. !             --*argc;
  95. !             if (option->flags & ARG_FOR_GTK)
  96. !             gui_argv[gui_argc++] = argv[i + 1];
  97. !         }
  98. !         if (*argc > i)
  99. !             mch_memmove(&argv[i], &argv[i + n_strip],
  100. !                         (*argc - i) * sizeof(char *));
  101. !         }
  102. !         argv[*argc] = NULL;
  103.       }
  104.       }
  105.   
  106.       gui_argv[gui_argc] = NULL;
  107. *** ../vim-6.2.241/src/main.c    Mon Feb  2 10:03:01 2004
  108. --- src/main.c    Fri Feb  6 16:57:13 2004
  109. ***************
  110. *** 662,667 ****
  111. --- 662,671 ----
  112.           break;
  113.   
  114.           case 'h':        /* "-h" give help message */
  115. + #ifdef FEAT_GUI_GNOME
  116. +         /* Tell usage() to exit for "gvim". */
  117. +         gui.starting = FALSE;
  118. + #endif
  119.           usage();
  120.           break;
  121.   
  122. ***************
  123. *** 2558,2568 ****
  124.       main_msg(_("--role <role>\tSet a unique role to identify the main window"));
  125.   # endif
  126.       main_msg(_("--socketid <xid>\tOpen Vim inside another GTK widget"));
  127. - # ifdef FEAT_GUI_GNOME
  128. -     main_msg(_("--help\t\tShow Gnome arguments"));
  129. - # endif
  130.   #endif
  131. !     mch_exit(0);
  132.   }
  133.   
  134.   #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
  135. --- 2572,2586 ----
  136.       main_msg(_("--role <role>\tSet a unique role to identify the main window"));
  137.   # endif
  138.       main_msg(_("--socketid <xid>\tOpen Vim inside another GTK widget"));
  139.   #endif
  140. ! #ifdef FEAT_GUI_GNOME
  141. !     /* Gnome gives extra messages for --help if we continue, but not for -h. */
  142. !     if (gui.starting)
  143. !     mch_msg("\n");
  144. !     else
  145. ! #endif
  146. !     mch_exit(0);
  147.   }
  148.   
  149.   #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
  150. *** ../vim-6.2.241/src/version.c    Fri Feb  6 19:31:57 2004
  151. --- src/version.c    Fri Feb  6 19:33:27 2004
  152. ***************
  153. *** 639,640 ****
  154. --- 639,642 ----
  155.   {   /* Add new patch number below this line */
  156. + /**/
  157. +     242,
  158.   /**/
  159.  
  160. -- 
  161. hundred-and-one symptoms of being an internet addict:
  162. 66. You create a homepage with the impression to cure the afflicted...but
  163.     your hidden agenda is to receive more e-mail.
  164.  
  165.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  166. ///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  167. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  168.  \\\  Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html  ///
  169.