aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog15
-rw-r--r--lib-src/emacsclient.c24
-rw-r--r--lib-src/etags.c36
3 files changed, 49 insertions, 26 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 1eb67eb6c71..e989473219c 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,16 @@
12011-12-25 Andreas Schwab <schwab@linux-m68k.org>
2
3 * etags.c (C_entries): Properly skip over string and character
4 constants and comments inside brackets. (Bug#10357)
5
62011-12-04 Juanma Barranquero <lekktu@gmail.com>
7
8 * emacsclient.c (decode_options) [WINDOWSNT]: Don't force tty = 0;
9 instead, treat both -c and -t as always requesting a new "tty" frame,
10 and let server.el decide which kind is actually required.
11 Reported by Uwe Siart <usenet@siart.de> in this thread:
12 http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00303.html
13
12011-11-30 Chong Yidong <cyd@gnu.org> 142011-11-30 Chong Yidong <cyd@gnu.org>
2 15
3 * emacsclient.c (main): Condition last change on WINDOWSNT 16 * emacsclient.c (main): Condition last change on WINDOWSNT
@@ -3129,7 +3142,7 @@
3129 (main): Call put_entries here even in CTAGS mode. 3142 (main): Call put_entries here even in CTAGS mode.
3130 (main, process_file): Check the return values of fclose and pclose. 3143 (main, process_file): Check the return values of fclose and pclose.
3131 (process_file): Do not call put_entries after parsing each file. 3144 (process_file): Do not call put_entries after parsing each file.
3132 (process_file): Canonicalise file names even for ctags. 3145 (process_file): Canonicalize file names even for ctags.
3133 (process_file): Set curfile here... 3146 (process_file): Set curfile here...
3134 (find_entries): ... not here any more. 3147 (find_entries): ... not here any more.
3135 (add_node): In etags mode, build a linked list of entries (on 3148 (add_node): In etags mode, build a linked list of entries (on
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 0ae1f0bddea..5e1c2d61b89 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -638,6 +638,22 @@ decode_options (int argc, char **argv)
638 if (display && strlen (display) == 0) 638 if (display && strlen (display) == 0)
639 display = NULL; 639 display = NULL;
640 640
641#ifdef WINDOWSNT
642 /* Emacs on Windows does not support GUI and console frames in the same
643 instance. So, it makes sense to treat the -t and -c options as
644 equivalent, and open a new frame regardless of whether the running
645 instance is GUI or console. Ideally, we would only set tty = 1 when
646 the instance is running in a console, but alas we don't know that.
647 The simplest workaround is to always ask for a tty frame, and let
648 server.el check whether it makes sense. */
649 if (tty || !current_frame)
650 {
651 display = (const char *) ttyname;
652 current_frame = 0;
653 tty = 1;
654 }
655#endif
656
641 /* If no display is available, new frames are tty frames. */ 657 /* If no display is available, new frames are tty frames. */
642 if (!current_frame && !display) 658 if (!current_frame && !display)
643 tty = 1; 659 tty = 1;
@@ -654,14 +670,6 @@ decode_options (int argc, char **argv)
654an empty string"); 670an empty string");
655 exit (EXIT_FAILURE); 671 exit (EXIT_FAILURE);
656 } 672 }
657
658 /* TTY frames not supported on Windows. Continue using GUI rather than
659 forcing the user to change their command-line. This is required since
660 tty is set above if certain options are given and $DISPLAY is not set,
661 which is not obvious to users. */
662 if (tty)
663 tty = 0;
664
665#endif /* WINDOWSNT */ 673#endif /* WINDOWSNT */
666} 674}
667 675
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 30d90e9d911..8852c9faea4 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -3189,24 +3189,12 @@ C_entries (int c_ext, FILE *inf)
3189 } 3189 }
3190 continue; 3190 continue;
3191 } 3191 }
3192 else if (bracketlev > 0)
3193 {
3194 switch (c)
3195 {
3196 case ']':
3197 if (--bracketlev > 0)
3198 continue;
3199 break;
3200 case '\0':
3201 CNL_SAVE_DEFINEDEF ();
3202 break;
3203 }
3204 continue;
3205 }
3206 else switch (c) 3192 else switch (c)
3207 { 3193 {
3208 case '"': 3194 case '"':
3209 inquote = TRUE; 3195 inquote = TRUE;
3196 if (bracketlev > 0)
3197 continue;
3210 if (inattribute) 3198 if (inattribute)
3211 break; 3199 break;
3212 switch (fvdef) 3200 switch (fvdef)
@@ -3224,9 +3212,11 @@ C_entries (int c_ext, FILE *inf)
3224 continue; 3212 continue;
3225 case '\'': 3213 case '\'':
3226 inchar = TRUE; 3214 inchar = TRUE;
3215 if (bracketlev > 0)
3216 continue;
3227 if (inattribute) 3217 if (inattribute)
3228 break; 3218 break;
3229 if (fvdef != finlist && fvdef != fignore && fvdef !=vignore) 3219 if (fvdef != finlist && fvdef != fignore && fvdef != vignore)
3230 { 3220 {
3231 fvextern = FALSE; 3221 fvextern = FALSE;
3232 fvdef = fvnone; 3222 fvdef = fvnone;
@@ -3238,6 +3228,8 @@ C_entries (int c_ext, FILE *inf)
3238 incomm = TRUE; 3228 incomm = TRUE;
3239 lp++; 3229 lp++;
3240 c = ' '; 3230 c = ' ';
3231 if (bracketlev > 0)
3232 continue;
3241 } 3233 }
3242 else if (/* cplpl && */ *lp == '/') 3234 else if (/* cplpl && */ *lp == '/')
3243 { 3235 {
@@ -3270,7 +3262,7 @@ C_entries (int c_ext, FILE *inf)
3270 for (cp = newlb.buffer; cp < lp-1; cp++) 3262 for (cp = newlb.buffer; cp < lp-1; cp++)
3271 if (!iswhite (*cp)) 3263 if (!iswhite (*cp))
3272 { 3264 {
3273 if (*cp == '*' && *(cp+1) == '/') 3265 if (*cp == '*' && cp[1] == '/')
3274 { 3266 {
3275 cp++; 3267 cp++;
3276 cpptoken = TRUE; 3268 cpptoken = TRUE;
@@ -3284,7 +3276,17 @@ C_entries (int c_ext, FILE *inf)
3284 continue; 3276 continue;
3285 case '[': 3277 case '[':
3286 bracketlev++; 3278 bracketlev++;
3287 continue; 3279 continue;
3280 default:
3281 if (bracketlev > 0)
3282 {
3283 if (c == ']')
3284 --bracketlev;
3285 else if (c == '\0')
3286 CNL_SAVE_DEFINEDEF ();
3287 continue;
3288 }
3289 break;
3288 } /* switch (c) */ 3290 } /* switch (c) */
3289 3291
3290 3292