unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#17784: hilit-chg.el marks bigger change than necessary
@ 2014-06-15  3:23 Le Wang
  2014-06-16 21:01 ` Stefan Monnier
  2021-07-14 10:44 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 4+ messages in thread
From: Le Wang @ 2014-06-15  3:23 UTC (permalink / raw)
  To: 17784

Repro steps:

1 create file:
<file>
hi
_
</file>

2. insert "a" on line 2, before "_"

3. backspace

4. insert "a" on line 2, before "_", again

5. inspect text property of "_", and notice it has hilit-chg property
even though it hasn't been changed.


-- 
Le





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#17784: hilit-chg.el marks bigger change than necessary
  2014-06-15  3:23 bug#17784: hilit-chg.el marks bigger change than necessary Le Wang
@ 2014-06-16 21:01 ` Stefan Monnier
  2014-06-16 21:35   ` Le Wang
  2021-07-14 10:44 ` Lars Ingebrigtsen
  1 sibling, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2014-06-16 21:01 UTC (permalink / raw)
  To: Le Wang; +Cc: 17784

> 2. insert "a" on line 2, before "_"
> 3. backspace
> 4. insert "a" on line 2, before "_", again
> 5. inspect text property of "_", and notice it has hilit-chg property
> even though it hasn't been changed.

IIUC the property is added at step 3 to remember that something was
removed here.  So I guess what you're saying is that we could remove
that property at step 4 since the insertion makes it redundant.


        Stefan





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#17784: hilit-chg.el marks bigger change than necessary
  2014-06-16 21:01 ` Stefan Monnier
@ 2014-06-16 21:35   ` Le Wang
  0 siblings, 0 replies; 4+ messages in thread
From: Le Wang @ 2014-06-16 21:35 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 17784

[-- Attachment #1: Type: text/plain, Size: 547 bytes --]

Yes that sounds right.
On 16 Jun 2014 17:02, "Stefan Monnier" <monnier@iro.umontreal.ca> wrote:

> > 2. insert "a" on line 2, before "_"
> > 3. backspace
> > 4. insert "a" on line 2, before "_", again
> > 5. inspect text property of "_", and notice it has hilit-chg property
> > even though it hasn't been changed.
>
> IIUC the property is added at step 3 to remember that something was
> removed here.  So I guess what you're saying is that we could remove
> that property at step 4 since the insertion makes it redundant.
>
>
>         Stefan
>

[-- Attachment #2: Type: text/html, Size: 913 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#17784: hilit-chg.el marks bigger change than necessary
  2014-06-15  3:23 bug#17784: hilit-chg.el marks bigger change than necessary Le Wang
  2014-06-16 21:01 ` Stefan Monnier
@ 2021-07-14 10:44 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-07-14 10:44 UTC (permalink / raw)
  To: Le Wang; +Cc: 17784

Le Wang <l26wang@gmail.com> writes:

> Repro steps:
>
> 1 create file:
> <file>
> hi
> _
> </file>
>
> 2. insert "a" on line 2, before "_"
>
> 3. backspace
>
> 4. insert "a" on line 2, before "_", again
>
> 5. inspect text property of "_", and notice it has hilit-chg property
> even though it hasn't been changed.

This should now be fixed in Emacs 28.  The problem was that the code
tried to cater for the case where you have

hi
_

and then

hi
ab_

then deleting the "a" and then inserting something else.  That worked
for "b" (which was already highlighted), but not for "_", which was
not.  So I introduced a new text property to separate the two cases.

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





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-14 10:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-15  3:23 bug#17784: hilit-chg.el marks bigger change than necessary Le Wang
2014-06-16 21:01 ` Stefan Monnier
2014-06-16 21:35   ` Le Wang
2021-07-14 10:44 ` Lars Ingebrigtsen

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).