GNU bug report logs - #39245
26.3; 'mouse-face highlighting is extended beyond EOB

Previous Next

Package: emacs;

Reported by: ynyaaa <at> gmail.com

Date: Thu, 23 Jan 2020 02:06:01 UTC

Severity: normal

Found in version 26.3

Full log


Message #8 received at 39245 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: ynyaaa <at> gmail.com
Cc: 39245 <at> debbugs.gnu.org
Subject: Re: bug#39245: 26.3; 'mouse-face highlighting is extended beyond EOB
Date: Wed, 28 Oct 2020 13:36:09 +0100
ynyaaa <at> gmail.com writes:

> If a buffer does not end with a newline and 'mouse-face property is
> added at the last character, 'mouse-face highlighting covers the blank
> area to the right of the last character.
>
> If 'mouse-face region contains newline characters,
> the blank area to the right of the last character is not highlighted.
>
> Example: Evaluate the form below and move the mouse pointer onto 'XYZ'.
> Then the blank area to the right of 'Z' is highlighted.
> If a newline character is inserted between 'X' and 'Y',
> the blank area to the right of 'Z' is not highlighted.
>
>   (let ((buf (generate-new-buffer "tmp")))
>     (switch-to-buffer buf)
>     (insert (propertize "XYZ" 'mouse-face 'region)))

This behaviour is still present in Emacs 28.

But I'm not sure what the correct behaviour would be.  Since mouse-face
has :extend, would it make sense to also extend it at eob?  Possibly...
not?

In any case, the current behaviour is a bug -- if it should extend at
eob, it should continue to do so even if the area has a newline, I
think.  (Or not extend at eob at all.)

This is just an issue with mouse-face, face doesn't have this problem:

  (let ((buf (generate-new-buffer "tmp")))
    (switch-to-buffer buf)
    (insert (propertize "XYZ" 'face 'region)))


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




This bug report was last modified 4 years and 234 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.