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: 36550@debbugs.gnu.org, linus.kallberg@outlook.com
Subject: bug#36550: mouse-face overlay calculation error
Date: Sat, 13 Jul 2019 15:50:41 +0200	[thread overview]
Message-ID: <m3d0ieoxfy.fsf@gnus.org> (raw)
In-Reply-To: <834l3q132a.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 13 Jul 2019 16:23:09 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

> I don't understand why Widget would want to do that.  As I explained,
> it makes no sense to highlight parts of display that have no text with
> a face that shows mouse-sensitive text.  When the next line's
> characters are also sensitive, then yes, we do highlight all the way
> to the newline.

This is the commit that introduced the problem:

commit 5d24c60e3a3b07ccb31b886885ea117a058168be
Author: David Ponce <david@dponce.com>
Date:   Mon Apr 3 14:34:28 2006 +0000

    (recentf-open-files-item): Include newline in button
    field, so opening a file will work, when the point is at the end
    of the file name.  Allow, for example, to [i]search a file by
    extension and just push RET to open it.

So it really wants the widget to have the newline inside the widget for
usability reasons.

I can special-case this in wid-edit.el -- if the final character in the
region is a newline, then all the other overlays extend all the way, but
mouse-face stops just short of the newline.  But it's more than a bit
hacky...

>> Oh, wow; that's a daunting function indeed...
>
> Yes.  The problem it tries to solve is to highlight correctly when
> buffer positions do not increment monotonously with screen
> coordinates.  Unsurprisingly, at the time it took me some time to get
> that code right.

I see.

Well, it's not 100% right, since it highlights the first character on
the next line if you have mouse-face on the preceding newline, which has
to be a bug even if we're not supposed to put mouse-face on the newline.
:-)

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





  reply	other threads:[~2019-07-13 13:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-08 12:54 bug#36550: Small bug fix in recentf.el Linus Källberg
2019-07-08 19:58 ` Lars Ingebrigtsen
     [not found]   ` <AM0PR09MB2867529A5BCE4551365F142C87F60@AM0PR09MB2867.eurprd09.prod.outlook.com>
2019-07-09 13:04     ` Lars Ingebrigtsen
2019-07-11 16:34       ` Linus Källberg
2019-07-12 15:07         ` Lars Ingebrigtsen
2019-07-13  0:31         ` bug#36550: mouse-face overlay calculation error Lars Ingebrigtsen
2019-07-13  6:15           ` Eli Zaretskii
2019-07-13 13:10             ` Lars Ingebrigtsen
2019-07-13 13:23               ` Eli Zaretskii
2019-07-13 13:50                 ` Lars Ingebrigtsen [this message]
2019-07-13 14:17                   ` Eli Zaretskii
2019-07-13 14:25                     ` Lars Ingebrigtsen
2019-07-13 14:50                       ` Eli Zaretskii
2019-07-13 15:05                         ` Lars Ingebrigtsen
2019-07-13 15:08                           ` Lars Ingebrigtsen
2019-07-13 15:38                             ` Linus Källberg
2019-07-13 15:49                               ` Eli Zaretskii
2019-07-13 19:49                                 ` Linus Källberg
2019-07-14  5:30                                   ` Eli Zaretskii

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=m3d0ieoxfy.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=36550@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=linus.kallberg@outlook.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.