aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorEli Zaretskii2017-09-10 19:46:00 +0300
committerEli Zaretskii2017-09-10 19:46:00 +0300
commit4b86cf5668ef70b9ee71975e5c3f5d47b08f4e37 (patch)
tree92d5da7e7c8d8aa096a27c778aebc5636f2a4edc /lib-src
parentcdef84fb6893f69ffee1a99fe82a262e02e59bf5 (diff)
downloademacs-4b86cf5668ef70b9ee71975e5c3f5d47b08f4e37.tar.gz
emacs-4b86cf5668ef70b9ee71975e5c3f5d47b08f4e37.zip
Add --debug option to etags
* lib-src/etags.c (make_tag): Print found tags under --debug. (longopts): Add --debug.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/etags.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 38be60e9cbb..1d0fa292079 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -462,6 +462,7 @@ static bool cplusplus; /* .[hc] means C++, not C (undocumented) */
462static bool ignoreindent; /* -I: ignore indentation in C */ 462static bool ignoreindent; /* -I: ignore indentation in C */
463static int packages_only; /* --packages-only: in Ada, only tag packages*/ 463static int packages_only; /* --packages-only: in Ada, only tag packages*/
464static int class_qualify; /* -Q: produce class-qualified tags in C++/Java */ 464static int class_qualify; /* -Q: produce class-qualified tags in C++/Java */
465static int debug; /* --debug */
465 466
466/* STDIN is defined in LynxOS system headers */ 467/* STDIN is defined in LynxOS system headers */
467#ifdef STDIN 468#ifdef STDIN
@@ -479,6 +480,7 @@ static struct option longopts[] =
479 { "append", no_argument, NULL, 'a' }, 480 { "append", no_argument, NULL, 'a' },
480 { "packages-only", no_argument, &packages_only, 1 }, 481 { "packages-only", no_argument, &packages_only, 1 },
481 { "c++", no_argument, NULL, 'C' }, 482 { "c++", no_argument, NULL, 'C' },
483 { "debug", no_argument, &debug, 1 },
482 { "declarations", no_argument, &declarations, 1 }, 484 { "declarations", no_argument, &declarations, 1 },
483 { "no-line-directive", no_argument, &no_line_directive, 1 }, 485 { "no-line-directive", no_argument, &no_line_directive, 1 },
484 { "no-duplicates", no_argument, &no_duplicates, 1 }, 486 { "no-duplicates", no_argument, &no_duplicates, 1 },
@@ -1917,6 +1919,10 @@ make_tag (const char *name, /* tag name, or NULL if unnamed */
1917 bool named = (name != NULL && namelen > 0); 1919 bool named = (name != NULL && namelen > 0);
1918 char *nname = NULL; 1920 char *nname = NULL;
1919 1921
1922 if (debug)
1923 fprintf (stderr, "%s on %s:%d: %s\n",
1924 named ? name : "(unnamed)", curfdp->taggedfname, lno, linestart);
1925
1920 if (!CTAGS && named) /* maybe set named to false */ 1926 if (!CTAGS && named) /* maybe set named to false */
1921 /* Let's try to make an implicit tag name, that is, create an unnamed tag 1927 /* Let's try to make an implicit tag name, that is, create an unnamed tag
1922 such that etags.el can guess a name from it. */ 1928 such that etags.el can guess a name from it. */