emacs-devel
[Top][All Lists]
Advanced

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

Re: [ELPA] New package proposal: visual-path-abbrev.el


From: Stefan Monnier
Subject: Re: [ELPA] New package proposal: visual-path-abbrev.el
Date: Fri, 08 Mar 2019 14:01:56 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> Ok, now after the hymn of praise, here's the caveat which I couldn't
> solve so far: When point leaves one of my overlays and immediately
> appears in another one, the `cursor-sensor-functions' are NOT CALLED.
> Of course, I expected to get a one call with 'left followed by a call
> with 'entered.

IIRC you should indeed get 2 calls (one for leave and one for enter),
unless the overlays are adjacent I think (the code looks at
char-properties so doesn't pay much attention to overlay boundaries
themselves).

> Can we consider that a bug in cursor-sensor or is that the expected
> behavior?  And more importantly, can I influence it so that it works for
> my use-case?

Not sure if it's a bug, but if the problem is that your overlays are
adjacent (so that all the chars between the old and the new positions
have the same `cursor-sensor-functions` property), then you can fix it
in one of two ways:
- change your overlay's boundaries so as to leave some chars between
  the overlays.
- use artificially non-eql values of the functions placed on
  `cursor-sensor-functions` (e.g. using closures that close over the
  overlay itself).

> An easy recipe for reproduction is to run M-x rgrep, then activate my
> mode in the *grep* buffer, and then move up and down using C-p / C-n.

Haven't tried it yet, but it sounds like maybe it's just a plain bug in
cursor-sensor.


        Stefan



reply via email to

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