bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19650:


From: Stefan Monnier
Subject: bug#19650:
Date: Thu, 12 Mar 2015 21:19:41 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> 1) Changing insert for insert-before-markers is problematic because it
> somehow wreaks havoc with font locking. I guess some other markers are
> being moved around besides he-string-end, maybe the one pointing to
> the end of the prompt or something like that (since everything gets
> colored the same the prompt is). Moreover, the he-string-beg marker
> would still point to the wrong place no matter what its type were.

Indeed, the issue is not "insert-before" vs "insert-after" but that we
delete+insert the exact same text, so the markers should simply not
move, but Emacs can't know that.

Basically, the delete+insert only changes the text's properties, so "the
right way" to fix this is to not delete and not insert, but instead to
take the result string, extract its text-properties and apply them
carefully to the corresponding of the buffer, so as not to affect
any marker.

Another "right way" is to do the font-locking "in situ" instead of doing
it in a side buffer.  This would be good, but IIUC it's not as
straightforward as it sounds.

> 3) Same as (2) above, but saving/restoring the *positions*  of both
> he-string-beg and he-string-end. This is the best solution I could
> figure out till now. Take a look at the attached patch, please.
> What do you think?

I think it's hideous, but maybe it's OK as a temporary workaround.
I'll let Fabian decide if he wants it in his code.  But if he accepts
it, the code should have some extra comments explaining what's going on.


        Stefan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]