From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Etags and regexps
Date: Sat, 20 Jul 2019 12:48:11 +0300 [thread overview]
Message-ID: <83h87ht4tg.fsf@gnu.org> (raw)
In-Reply-To: <8336j7pd80.fsf@gmail.com> (message from Pascal Quesseveur on Mon, 15 Jul 2019 16:46:39 +0200)
> 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.
next prev parent reply other threads:[~2019-07-20 9:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-15 14:46 Etags and regexps Pascal Quesseveur
2019-07-20 9:48 ` Eli Zaretskii [this message]
2019-07-22 9:46 ` Pascal Quesseveur
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=83h87ht4tg.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=help-gnu-emacs@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.
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).