unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Barry OReilly <gundaetiapo@gmail.com>
Cc: 14281@debbugs.gnu.org
Subject: bug#14281: 24.3; replace-match leaves point at wrong place
Date: Fri, 10 May 2013 16:56:31 -0400	[thread overview]
Message-ID: <jwvip2q36h3.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CAFM41H1xOC-TYW1rLU-Obfmhq0BVYTVA9=n1O+PVogDg=ASAJA@mail.gmail.com> (Barry OReilly's message of "Fri, 10 May 2013 14:19:24 -0400")

>> Maybe we could add code that saves just the (match-beginning 0) and
>> signals an error if it was not properly preserved.  This would still
>> require change-functions to save the match-data if they use it, but it
>> might catch the offenders earlier.
> I made a crack at it.

Cool.

> It was necessary to use save-match-data in a couple of around advices
> and disable undo-tree to get some basic commands to work.  I imagine
> there would be more cases to resolve.

Can you show us the offenders?

> Are the changes in the .diff what you had in mind roughly?

Pretty much, yes (tho with spaces before open parens, staying with 80
columns, and maybe not using match_limit since it seems like it can
signal errors in corner cases).  Also I wouldn't bother defining a new
kind of error: it should always correspond to a coding mistake, so not
something which you might like to catch in a condition-case.

If there are "many offenders" (as you saw) or in case (worse) there are
legitimate cases where the test signals an error, we could introduce
a debug-match-data variable so only masochists help us debug.


        Stefan





  reply	other threads:[~2013-05-10 20:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-27  1:19 bug#14281: 24.3; replace-match leaves point at wrong place Barry OReilly
2013-05-09 19:07 ` Barry OReilly
2013-05-09 21:27   ` Stefan Monnier
2013-05-10 13:27     ` Barry OReilly
2013-05-10 18:19       ` Barry OReilly
2013-05-10 20:56         ` Stefan Monnier [this message]
2013-05-14 17:01           ` Barry OReilly
2013-05-15 15:03             ` Barry OReilly
2013-05-15 19:18               ` Stefan Monnier
2013-05-15 20:44                 ` Barry OReilly
2013-05-15 20:58                   ` Barry OReilly
2013-05-21 21:49                     ` Stefan Monnier

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=jwvip2q36h3.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=14281@debbugs.gnu.org \
    --cc=gundaetiapo@gmail.com \
    /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).