unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Francesco Potortì" <pot@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 73771@debbugs.gnu.org, Morgan Willcock <morgan@ice9.digital>
Subject: bug#73771: 30.0.91; etags generates broken TAGS file for multi-line regex match
Date: Sun, 13 Oct 2024 12:48:40 +0200	[thread overview]
Message-ID: <871q0ki8hj.fsf@tucano.isti.cnr.it> (raw)
In-Reply-To: <86wmiduw93.fsf@gnu.org> (eliz@gnu.org)

>This is because etags always records one extra character with the
>regexp match, which is harmless, unless that extra character is a
>newline.  The patch below fixes it:
>
>diff --git a/lib-src/etags.c b/lib-src/etags.c
>index a822a82..848d8ea 100644
>--- a/lib-src/etags.c
>+++ b/lib-src/etags.c
>@@ -7420,7 +7420,7 @@ regex_tag_multiline (void)
> 
> 	      /* Force explicit tag name, if a name is there. */
> 	      pfnote (name, true, buffer + linecharno,
>-		      charno - linecharno + 1, lineno, linecharno);
>+		      charno - linecharno, lineno, linecharno);
> 
> 	      if (debug)
> 		fprintf (stderr, "%s on %s:%"PRIdMAX": %s\n",
>
>Francesco, why does the code add one more character there?

While I can't remember the reason, I am sure it was not done by chance.

Sure, I may have been wrong at that time, or maybe that reason is now obsolete.  To check, one should run the etags regression test and check the results.

Off the top of my head, it may have to do with implicitly named tags that are initial substring of a different tag, but this may be a fake reconstruction of my mind,





  reply	other threads:[~2024-10-13 10:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-12 14:39 bug#73771: 30.0.91; etags generates broken TAGS file for multi-line regex match Morgan Willcock
2024-10-12 16:22 ` Eli Zaretskii
2024-10-13 10:48   ` Francesco Potortì [this message]
2024-10-13 12:58     ` 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=871q0ki8hj.fsf@tucano.isti.cnr.it \
    --to=pot@gnu.org \
    --cc=73771@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=morgan@ice9.digital \
    /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).