* Help with etags
@ 2017-12-05 12:53 N. Raghavendra
2017-12-08 10:28 ` Eli Zaretskii
0 siblings, 1 reply; 3+ messages in thread
From: N. Raghavendra @ 2017-12-05 12:53 UTC (permalink / raw)
To: help-gnu-emacs
I am trying to build a tags table for some files which look like this
------------------------File: Homotopies.v ---------------------------
Require Export Paths.
Definition
homotopies
{X Y : U} (f g : X -> Y)
: U
:= prod (x : X) , (paths (f x) (g x)).
Notation
"f ~ g"
:= (homotopies f g).
Definition
function_induced_function_homotopic_identity
{X : U} (f : X -> X) (h : f ~ (Functions.identity X)) (x y : X)
(p : paths x y)
: paths ((induced_function f p) @ (h y)) ((h x) @ p).
----------------------------------------------------------------------
I want the tags table to show the identifier in every line following a
line containing `Definition', e.g., `homotopies' and
`function_induced_function_homotopic_identity'.
I tried the command
etags --language=none --regex="/^[[:space:]]*Definition[[:space:]\n]+[[:space:]]*\([[:alnum:]_]+\)[[:space:]]*\n/\1/" Homotopies.v
but am getting an empty tags table. What is the right way to generate
tags for such files?
Thanks,
Raghu.
--
N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Help with etags
2017-12-05 12:53 Help with etags N. Raghavendra
@ 2017-12-08 10:28 ` Eli Zaretskii
2017-12-09 13:33 ` N. Raghavendra
0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2017-12-08 10:28 UTC (permalink / raw)
To: help-gnu-emacs
> From: "N. Raghavendra" <nyraghu27132@gmail.com>
> Date: Tue, 05 Dec 2017 18:23:47 +0530
>
> I tried the command
>
> etags --language=none --regex="/^[[:space:]]*Definition[[:space:]\n]+[[:space:]]*\([[:alnum:]_]+\)[[:space:]]*\n/\1/" Homotopies.v
>
> but am getting an empty tags table.
This is because (a) you should drop the leading "^" in the regexp
(the regexp is always used anchored, as described in the manual);
and (b) you should use the 'm' modifier, because your regexp is
multi-line (this is also in the manual).
This works for me:
etags --language=none --regex="/[[:space:]]*Definition[[:space:]\n]+[[:space:]]*\([[:alnum:]_]+\)[[:space:]]*\n/\1/m" Homotopies.v
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Help with etags
2017-12-08 10:28 ` Eli Zaretskii
@ 2017-12-09 13:33 ` N. Raghavendra
0 siblings, 0 replies; 3+ messages in thread
From: N. Raghavendra @ 2017-12-09 13:33 UTC (permalink / raw)
To: help-gnu-emacs
At 2017-12-08T12:28:33+02:00, Eli Zaretskii wrote:
> This works for me:
>
> etags --language=none
> --regex="/[[:space:]]*Definition[[:space:]\n]+[[:space:]]*\([[:alnum:]_]+\)[[:space:]]*\n/\1/m"
> Homotopies.v
Thank you. I tried that regex on my files. It produces a tags table,
but when I use the table, and do M-. at an identifier, it takes me to
the wrong places in the files.
Meanwhile, I found the Perl program `coqtags', distributed with Emacs
Proof General, for tagging Coq files, such as the ones I am trying to
tag, and it works well.
Kind regards,
Raghu.
--
N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-12-09 13:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-05 12:53 Help with etags N. Raghavendra
2017-12-08 10:28 ` Eli Zaretskii
2017-12-09 13:33 ` N. Raghavendra
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.