unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Etags and regexps
@ 2019-07-15 14:46 Pascal Quesseveur
  2019-07-20  9:48 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Pascal Quesseveur @ 2019-07-15 14:46 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

I am trying to set regexps to let etags recognize tags from Object
Pascal code. For ex. the following regexp;

/^[[:space:]]*type[[:space:]]+\([^ \t=]+\)/\1/

applied to a type declaration:

type MyType = class(TObject)

matches class MyType. I am now trying to match declarations on
multiple lines, for ex.:

type
  MyType = class(TObject)

I have tried to put a new line in my regexp and use m modifier in
etags regexp but it doesn't work (emacs 24 & 26.2). When i add a m
modifier to the original regexp which doesn't contain newlines, it
doesn't work anymore.

So how are we supposed to use m modifier?


-- 
Pascal Quesseveur
pquessev@gmail.com




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Etags and regexps
  2019-07-15 14:46 Etags and regexps Pascal Quesseveur
@ 2019-07-20  9:48 ` Eli Zaretskii
  2019-07-22  9:46   ` Pascal Quesseveur
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2019-07-20  9:48 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Pascal Quesseveur <pquessev@gmail.com>
> Date: Mon, 15 Jul 2019 16:46:39 +0200
> 
> I am trying to set regexps to let etags recognize tags from Object
> Pascal code. For ex. the following regexp;
> 
> /^[[:space:]]*type[[:space:]]+\([^ \t=]+\)/\1/
> 
> applied to a type declaration:
> 
> type MyType = class(TObject)
> 
> matches class MyType. I am now trying to match declarations on
> multiple lines, for ex.:
> 
> type
>   MyType = class(TObject)
> 
> I have tried to put a new line in my regexp and use m modifier in
> etags regexp but it doesn't work (emacs 24 & 26.2). When i add a m
> modifier to the original regexp which doesn't contain newlines, it
> doesn't work anymore.
> 
> So how are we supposed to use m modifier?

The problem is with the leading "^" in your regexp: remove it, and
everything will work as you expect.  Etags always matches the regexp
anchored, i.e. it prepends "^" to it, so that "^" confuses the regexp
engine.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Etags and regexps
  2019-07-20  9:48 ` Eli Zaretskii
@ 2019-07-22  9:46   ` Pascal Quesseveur
  0 siblings, 0 replies; 3+ messages in thread
From: Pascal Quesseveur @ 2019-07-22  9:46 UTC (permalink / raw)
  To: help-gnu-emacs

>"EZ" == Eli Zaretskii <eliz@gnu.org> writes:

  EZ> The problem is with the leading "^" in your regexp

Yes, that was it. Thank you.


-- 
Pascal Quesseveur
pquessev@gmail.com




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-22  9:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-15 14:46 Etags and regexps Pascal Quesseveur
2019-07-20  9:48 ` Eli Zaretskii
2019-07-22  9:46   ` Pascal Quesseveur

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).