summaryrefslogtreecommitdiff
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 @@
+2011-12-25 Andreas Schwab <schwab@linux-m68k.org>
+
+ * etags.c (C_entries): Properly skip over string and character
+ constants and comments inside brackets. (Bug#10357)
+
+2011-12-04 Juanma Barranquero <lekktu@gmail.com>
+
+ * 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 <usenet@siart.de> in this thread:
+ http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00303.html
+
2011-11-30 Chong Yidong <cyd@gnu.org>
* emacsclient.c (main): Condition last change on WINDOWSNT
@@ -3129,7 +3142,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
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 */
}
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) */