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