[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug Report (Feature request?) etags (GNU Emacs 21.1)

From: Sven Utcke
Subject: Re: Bug Report (Feature request?) etags (GNU Emacs 21.1)
Date: 18 Feb 2002 11:59:29 +0100

address@hidden (Kim F. Storm) writes:

> address@hidden (Francesco Potorti`) writes:
> >    When programming, I usually do not write my *.c files directly
> >    
> >    --- snip ---
> >    #line 1085 "test-homology.web"
> >    --- snip ---
> > 
> >    that etags should honour #line directives, or at least provide an
> >    option to do so.
> > 
> > Thanks for this suggestion.  Currently, etags does not intepret
> > metainformation like this, apart form the #! on the first line, for
> > cerating languages (currently, only Perl).  Do people on this list think
> > that it would be wise for etags to intepret #line directives?
> In most cases, it will probably be ok to do so.
> However, if the original source file is not available, it would not
> make sense to do so.  

But, as you point out below, in that case you would also get into all
kinds of trouble trying to debug the thing, and the user should then
really remove the #line directives (which, of course, is easily done
using grep -v).

> In a few cases, files may have been autogenerated at some point in
> time, but manually edited since - leaving some old #line directives in
> the file.  But in this case, those #line directives doesn't make sense
> (they would make a compiler output bogus error references), so in this
> case the user should actually remove those lines.

Indeed, same as above.  After all, the #line directives _will_ be
honoured by the compiler and, based on that, the debugger, no matter
whether the original file still exists, or whether the source-file was
manipulated to not match the #line directives anymore, so I think
etags should treat this the same as any other of your tools.

> So I would say: yes, let emacs handle #line - if the source file is
> readable (and older than the current file) -- and if it is in a
> format which is supported by etags.

Well, I'm not sure whether checking for the source-file is actually a
good idea --- at the very least etags would then need to be able to
deal with version-control and to know how to create such a file if
needed (same as make or emacs do).  And the (original) source-file
certainly does not need to be in a format recognised by etags --- FWEB
(which I am using) can not be handled by Emacs, but most of the
languages created from that fweb-file _can_!  So in my opinion, etags
should simply point at the file and line-number which, according to
the information in the line-directives, contains the relevant
definition, even if the user choose to define this C-function in a
language which looks like gobbledidok to Emacs --- after all, since
the user choose gobbledidok as his primary implementation-language, he
probably prefers to look at gobbledidok rather than plain C...

But then of course I'm the one who originally requested this feature

 _  __                     The Cognitive Systems Group
| |/ /___  __ _ ___                                       University of Hamburg
| ' </ _ \/ _` (_-<  phone:    +49 (0)40 42883-2576      Vogt-Koelln-Strasse 30
|_|\_\___/\__, /__/  fax  :    +49 (0)40 42883-2572             D-22527 Hamburg
          |___/ http://kogs-www.informatik.uni-hamburg.de/~utcke/home.html

reply via email to

[Prev in Thread] Current Thread [Next in Thread]