all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 42424@debbugs.gnu.org, victorhge@gmail.com
Subject: bug#42424: 27.0.90; replace-match: point is NOT left at the end of replacement
Date: Sat, 31 Jul 2021 16:03:44 +0200	[thread overview]
Message-ID: <87r1fefum7.fsf@gnus.org> (raw)
In-Reply-To: <87tuusj618.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 18 Oct 2020 10:24:19 +0200")

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> Other types of modification (insert or delete) do not have this issue.
>> `point' is adjusted before running modification hooks.
>
> So I think the suggestion is to move point to the end of the replacement
> before running the modification hooks, i.e., move the point logic to
> replace_range.

No, that was wrong -- the suggestion was to not move point to the end of
the replacement text (numerically speaking).  But we can't do that --
the `replace-match' interface guarantees that it will do that, and
changing this will break stuff.

The modification hooks may do all kinda of oddball stuff that changes
the buffer before moving to that point, so to make that work more
reliably, we'd have to make a marker, I think?  But `replace-match' is
used so heavily that I'm not sure the performance impact won't be
noticeable.

One possible idea is to postpone the modification hooks until the end of
replace_match (instead of doing it in replace_range -- that should have
no performance impact, and not change behaviour in most cases.  But I'm
having problems making that work.

The hook is called from update_compositions, isn't it?  Are there any
caveats to using that?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2021-07-31 14:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-19  5:50 bug#42424: 27.0.90; replace-match: point is NOT left at the end of replacement Ren Victor
2020-10-17  9:49 ` Lars Ingebrigtsen
2020-10-17 17:25   ` Eli Zaretskii
2020-10-18  8:24     ` Lars Ingebrigtsen
2021-07-31 14:03       ` Lars Ingebrigtsen [this message]
2021-07-31 14:20         ` Eli Zaretskii
2021-07-31 14:28           ` Lars Ingebrigtsen
2021-07-31 14:49             ` Lars Ingebrigtsen
2021-07-31 15:10               ` Eli Zaretskii
2021-07-31 15:45                 ` Lars Ingebrigtsen
2024-04-09 15:14 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r1fefum7.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=42424@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=victorhge@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 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.