[AC21.5R21.4] etags and implicit tags

Stephen J. Turnbull stephen at xemacs.org
Sat Mar 24 08:48:00 EDT 2007


APPROVE COMMIT 21.5 RECOMMEND 21.4

(sorry for the XEmacs process gobbledygook)

Steve Youngs writes:

 > * Francesco Potorti` <pot at gnu.org> writes:
 > 
 >   > The first one is that etags should be compiled with
 >   >   -DEMACS_NAME="\"Xemacs"\"
 >   >   -DVERSION="\"${version}\""

 > Steve T, you won't need to add `-DVERSION' in the XEmacs Makefile,
 > like SXEmacs, it's already defined in config.h.

Thanks for the hint; EMACS_NAME is defined there, too.  It looks like
all we actually need is -DHAVE_CONFIG_H, but I haven't tested that yet.

 > Also, both XEmacs and SXEmacs define `EMACS_VERSION' which might be
 > better to use in etags.c.  There's an advantage for SXEmacs, (not sure
 > about XEmacs), in that it will print the exact patchset revision of
 > the SXEmacs that this etags goes with...

I'm going to go ahead and tentatively put both suggestions into XEmacs,
as I think that's useful precision, and there's a warning I want
suppressed so we will be a tiny bit divergent anyway.  If Francesco
decides not to adopt the idea, we will probably resync (ie, get rid of
the extra info) at the next update to etags.

This patch has been tested both with "make etags" in XEmacs and
standalone with the -D flags removed from the compile command that
make etags uses.  In the latter case, gcc throws a few warnings about
implicit definitions of built-in functions.  (Apple's GCC 4.01)

Index: lib-src/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lib-src/ChangeLog,v
retrieving revision 1.216
diff -u -r1.216 ChangeLog
--- lib-src/ChangeLog	24 Mar 2007 11:46:43 -0000	1.216
+++ lib-src/ChangeLog	24 Mar 2007 12:21:24 -0000
@@ -0,0 +1,7 @@
+2007-03-24  Stephen J. Turnbull  <stephen at xemacs.org>
+
+	* etags.c (print_version): More precise version info.  Suggested
+	by Steve Youngs.
+	(print_help): Use #ifdef; PRINT_UNDOCUMENTED_OPTIONS_HELP may be
+	undefined.
+

Index: lib-src/etags.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lib-src/etags.c,v
retrieving revision 1.37
diff -u -r1.37 etags.c
--- lib-src/etags.c	24 Mar 2007 11:46:43 -0000	1.37
+++ lib-src/etags.c	24 Mar 2007 12:21:26 -0000
@@ -834,13 +834,23 @@
 #ifndef EMACS_NAME
 # define EMACS_NAME "standalone"
 #endif
-#ifndef VERSION
-# define VERSION "version"
+#ifdef EMACS_VERSION
+# ifdef XEMACS_EXTRA_NAME
+#  define E_VERSION EMACS_VERSION " " XEMACS_EXTRA_NAME
+# else
+#  define E_VERSION EMACS_VERSION
+# endif
+#elif defined(VERSION)
+# define E_VERSION VERSION
+#else
+# define E_VERSION "version"
 #endif
+
 static void
 print_version ()
 {
-  printf ("%s (%s %s)\n", (CTAGS) ? "ctags" : "etags", EMACS_NAME, VERSION);
+  printf ("%s (%s %s)\n", (CTAGS) ? "ctags" : "etags", EMACS_NAME, E_VERSION);
+  puts (pot_etags_version);
   puts ("Copyright (C) 2006 Free Software Foundation, Inc. and Ken Arnold");
   puts ("This program is distributed under the same terms as Emacs");
 
@@ -978,7 +988,7 @@
         Print on the standard output an index of items intended for\n\
         human consumption, similar to the output of vgrind.  The index\n\
         is sorted, and gives the page number of each item.");
-# if PRINT_UNDOCUMENTED_OPTIONS_HELP
+# ifdef PRINT_UNDOCUMENTED_OPTIONS_HELP
       puts ("-w, --no-duplicates\n\
         Do not create duplicate tag entries, for compatibility with\n\
 	traditional ctags.");



More information about the XEmacs-Patches mailing list