unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Sven Utcke <utcke@kogs1.informatik.uni-hamburg.de>
Cc: pot@gnu.org (Francesco Potorti`), emacs-devel@gnu.org (Emacs developers)
Subject: Re: Bug Report (Feature request?) etags (GNU Emacs 21.1)
Date: Thu, 21 Feb 2002 17:21:14 +0100 (CET)	[thread overview]
Message-ID: <200202211621.g1LGLEt01092@kogs46.informatik.uni-hamburg.de> (raw)
In-Reply-To: <5xvgcqrfya.fsf@kfs2.cua.dk> from "Kim F. Storm" at Feb 21, 2002 04:51:25 PM

Hello Kim,

> I'm still not sure I understand all the implication of etags looking
> at #line lines.
> 
> In the case of the C-preprocessor, there is a 1:1 correpondance
> between the line numbers in the source file and the target file,
> meaning that if it output a #line 1000 while at line 1000 (of course),
> then if you advance 25 lines in the target file, it corresponds to
> line 1025 of the source file (provided there are no other #line in
> those 25 lines).  

Yes.

> However, this will often NOT be the case when #line directives are
> found in files generated by other programs (there may be a 1:100 or a
> 100:1 correspondance) -- but you don't know.  So etags will have to 
> put the #line directive's line number directly into TAGS.

I do not think this is correct.  The program generating the #line
directives can, I think, be assumed to output a new #line directive
whenever there is no 1:1 correspondence.  So I don't think there
should be a problem.  This might look like this:

--- snip ---
/* 3: */
#line 210 "test-homology.web"

int main(int argc,char**argv)
{
/* 6: */
#line 323 "test-homology.web"

int c;
extern char*optarg;
char*bitangent_file= NULL;
/* 8: */
#line 349 "test-homology.web"

bitangent_array bitangents;
/* 10: */
#line 113 "test-homology.web"

outline_list_pointer outlines= NULL;
outline_list_pointer the_outline= NULL;
int num_outlines= 0;
int i;
--- snip ---

Note that the line-number need not be monotonically increasing though
(something the gdb handles badly, btw --- maybe I should post a
bug-report :-)

> So, what does etags put into the TAGS file about f::x ?
> 
> It writes:
>         _YLfunc_x__f_ is at line 100 in myfile.ylag
> 
> Supposing that etags understood YLAG syntax, I would - as a user of
> etags - like to use   M-. f::x RET   to jump to the definition of f::x
> 
> But I cannot do that, since etags according to your rule didn't parse
> myfile.ylag at all.  Is that really acceptable?

No.  If etags understands YLAG, then it should preferably parse the
original file, not the derived one.

> We could have a command which can go backwards in a file looking for a
> #line tag and jump to the referenced file and line (optionally plus
> the offset to that line).  This would not really mess with (or even
> require) etags as all!  Maybe such a function already exists?

Sounds like a viable workaround, but I still believe that etags should
honour #line directives (that's what they are there for, after all).
Personally, I also believe that when both *.c and *.y were given to
etags, it _should_ create dual references, both pointing to the *.y
file...

Sven
-- 
 _  __                     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

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


  reply	other threads:[~2002-02-21 16:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200202211303.g1LD3ar29903@kogs46.informatik.uni-hamburg.de>
2002-02-21 14:43 ` Bug Report (Feature request?) etags (GNU Emacs 21.1) Francesco Potorti`
2002-02-21 15:51   ` Kim F. Storm
2002-02-21 16:21     ` Sven Utcke [this message]
2002-02-22 14:08       ` Francesco Potorti`
     [not found]     ` <200202220433.g1M4XAt14047@aztec.santafe.edu>
2002-02-22 11:48       ` Sven Utcke
2002-02-22 14:29       ` Francesco Potorti`
2002-02-22 14:56         ` Sven Utcke
2002-02-23 20:19         ` Richard Stallman
     [not found]   ` <200202220433.g1M4X3f14032@aztec.santafe.edu>
2002-02-22 14:10     ` Francesco Potorti`
2002-02-22 15:02       ` Sven Utcke
2002-02-22 16:27         ` Stefan Monnier
     [not found] <200202220433.g1M4XCj14050@aztec.santafe.edu>
2002-02-22 11:37 ` Sven Utcke
2002-02-23 20:19   ` Richard Stallman
     [not found] <200202141816.g1EIGWQ19766@kogs12.informatik.uni-hamburg.de>
     [not found] ` <871yfjhgk7.fsf@pot.cnuce.cnr.it>
     [not found]   ` <5xg03zg0hc.fsf@kfs2.cua.dk>
     [not found]     ` <vd0bsenf432.fsf@kogs12.informatik.uni-hamburg.de>
     [not found]       ` <5xu1sfq8t9.fsf@kfs2.cua.dk>
     [not found]         ` <Pine.SUN.3.91.1020218153612.5449D-100000@is>
     [not found]           ` <87n0y6emxz.fsf@pot.cnuce.cnr.it>
     [not found]             ` <uofimd4mp.fsf@synopsys.com>
     [not found]               ` <87lmdq7cwm.fsf@creche.redhat.com>
     [not found]                 ` <87eljie7ty.fsf@pot.cnuce.cnr.it>
     [not found]                   ` <200202192131.g1JLVp413268@aztec.santafe.edu>
2002-03-05 12:15                     ` Francesco Potorti`
2002-03-05 13:11                       ` Sven Utcke
2002-03-06  5:57                         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200202211621.g1LGLEt01092@kogs46.informatik.uni-hamburg.de \
    --to=utcke@kogs1.informatik.uni-hamburg.de \
    --cc=emacs-devel@gnu.org \
    --cc=pot@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).