From 520fca41d6ca6cc860c1f03c76cd472ea149e33a Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Sun, 4 Dec 2011 18:13:01 +0100 Subject: Fix emacsclient bug where "-n -c" does not open a new frame on Windows. * lib-src/emacsclient.c (decode_options) [WINDOWSNT]: Don't force tty = 0; instead, treat both -c and -t as always requesting a new "tty" frame, and let server.el decide which kind is actually required. Reported by Uwe Siart in this thread: http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00303.html * lisp/server.el (server-delete-client): On Windows, do not try to delete the only terminal. (server-process-filter): On Windows, treat requests for a tty frame as if they were for a GUI frame if the running server is in GUI mode. --- lib-src/ChangeLog | 8 ++++++++ lib-src/emacsclient.c | 24 ++++++++++++++++-------- 2 files changed, 24 insertions(+), 8 deletions(-) (limited to 'lib-src') diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 1eb67eb6c71..922a96ad194 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,11 @@ +2011-12-04 Juanma Barranquero + + * emacsclient.c (decode_options) [WINDOWSNT]: Don't force tty = 0; + instead, treat both -c and -t as always requesting a new "tty" frame, + and let server.el decide which kind is actually required. + Reported by Uwe Siart in this thread: + http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00303.html + 2011-11-30 Chong Yidong * emacsclient.c (main): Condition last change on WINDOWSNT 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) if (display && strlen (display) == 0) display = NULL; +#ifdef WINDOWSNT + /* Emacs on Windows does not support GUI and console frames in the same + instance. So, it makes sense to treat the -t and -c options as + equivalent, and open a new frame regardless of whether the running + instance is GUI or console. Ideally, we would only set tty = 1 when + the instance is running in a console, but alas we don't know that. + The simplest workaround is to always ask for a tty frame, and let + server.el check whether it makes sense. */ + if (tty || !current_frame) + { + display = (const char *) ttyname; + current_frame = 0; + tty = 1; + } +#endif + /* If no display is available, new frames are tty frames. */ if (!current_frame && !display) tty = 1; @@ -654,14 +670,6 @@ decode_options (int argc, char **argv) an empty string"); exit (EXIT_FAILURE); } - - /* TTY frames not supported on Windows. Continue using GUI rather than - forcing the user to change their command-line. This is required since - tty is set above if certain options are given and $DISPLAY is not set, - which is not obvious to users. */ - if (tty) - tty = 0; - #endif /* WINDOWSNT */ } -- cgit v1.2.1 From 333f9019e29e9b6de3a7ec07448be1d364ba540b Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 11 Dec 2011 21:32:49 -0800 Subject: Spelling fixes. --- lib-src/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib-src') diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 922a96ad194..40404828e0f 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -3137,7 +3137,7 @@ (main): Call put_entries here even in CTAGS mode. (main, process_file): Check the return values of fclose and pclose. (process_file): Do not call put_entries after parsing each file. - (process_file): Canonicalise file names even for ctags. + (process_file): Canonicalize file names even for ctags. (process_file): Set curfile here... (find_entries): ... not here any more. (add_node): In etags mode, build a linked list of entries (on -- cgit v1.2.1 From 28796b3a4a606e835300ce853c17a24e90da9bf0 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Sun, 25 Dec 2011 10:55:37 +0100 Subject: * etags.c (C_entries): Properly skip over string and character constants inside brackets. (Bug#10357) --- lib-src/ChangeLog | 5 +++++ lib-src/etags.c | 36 +++++++++++++++++++----------------- 2 files changed, 24 insertions(+), 17 deletions(-) (limited to 'lib-src') diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 40404828e0f..e989473219c 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,8 @@ +2011-12-25 Andreas Schwab + + * etags.c (C_entries): Properly skip over string and character + constants and comments inside brackets. (Bug#10357) + 2011-12-04 Juanma Barranquero * emacsclient.c (decode_options) [WINDOWSNT]: Don't force tty = 0; 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) } continue; } - else if (bracketlev > 0) - { - switch (c) - { - case ']': - if (--bracketlev > 0) - continue; - break; - case '\0': - CNL_SAVE_DEFINEDEF (); - break; - } - continue; - } else switch (c) { case '"': inquote = TRUE; + if (bracketlev > 0) + continue; if (inattribute) break; switch (fvdef) @@ -3224,9 +3212,11 @@ C_entries (int c_ext, FILE *inf) continue; case '\'': inchar = TRUE; + if (bracketlev > 0) + continue; if (inattribute) break; - if (fvdef != finlist && fvdef != fignore && fvdef !=vignore) + if (fvdef != finlist && fvdef != fignore && fvdef != vignore) { fvextern = FALSE; fvdef = fvnone; @@ -3238,6 +3228,8 @@ C_entries (int c_ext, FILE *inf) incomm = TRUE; lp++; c = ' '; + if (bracketlev > 0) + continue; } else if (/* cplpl && */ *lp == '/') { @@ -3270,7 +3262,7 @@ C_entries (int c_ext, FILE *inf) for (cp = newlb.buffer; cp < lp-1; cp++) if (!iswhite (*cp)) { - if (*cp == '*' && *(cp+1) == '/') + if (*cp == '*' && cp[1] == '/') { cp++; cpptoken = TRUE; @@ -3284,7 +3276,17 @@ C_entries (int c_ext, FILE *inf) continue; case '[': bracketlev++; - continue; + continue; + default: + if (bracketlev > 0) + { + if (c == ']') + --bracketlev; + else if (c == '\0') + CNL_SAVE_DEFINEDEF (); + continue; + } + break; } /* switch (c) */ -- cgit v1.2.1