From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#36550: mouse-face overlay calculation error Date: Sat, 13 Jul 2019 15:50:41 +0200 Message-ID: References: <87v9wc2t8p.fsf@mouse.gnus.org> <831ryu31fc.fsf@gnu.org> <834l3q132a.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="152791"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 36550@debbugs.gnu.org, linus.kallberg@outlook.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 13 15:51:09 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hmIQe-000dSw-29 for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Jul 2019 15:51:08 +0200 Original-Received: from localhost ([::1]:55410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmIQc-0005zB-HB for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Jul 2019 09:51:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59028) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmIQZ-0005xe-1A for bug-gnu-emacs@gnu.org; Sat, 13 Jul 2019 09:51:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hmIQX-0006A6-RJ for bug-gnu-emacs@gnu.org; Sat, 13 Jul 2019 09:51:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:32805) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hmIQX-00069w-Nn for bug-gnu-emacs@gnu.org; Sat, 13 Jul 2019 09:51:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hmIQX-00036Q-Ky for bug-gnu-emacs@gnu.org; Sat, 13 Jul 2019 09:51:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Jul 2019 13:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36550 X-GNU-PR-Package: emacs Original-Received: via spool by 36550-submit@debbugs.gnu.org id=B36550.156302585811917 (code B ref 36550); Sat, 13 Jul 2019 13:51:01 +0000 Original-Received: (at 36550) by debbugs.gnu.org; 13 Jul 2019 13:50:58 +0000 Original-Received: from localhost ([127.0.0.1]:41626 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmIQQ-000366-Lu for submit@debbugs.gnu.org; Sat, 13 Jul 2019 09:50:58 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:34178) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmIQK-00035s-D0 for 36550@debbugs.gnu.org; Sat, 13 Jul 2019 09:50:52 -0400 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hmIQE-00016R-42; Sat, 13 Jul 2019 15:50:46 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAADFBMVEVoSzWRfmBJMSUmFBJN q2pcAAACZ0lEQVQokR3QT0iTcQDG8ed9e98Ym9QYm2Betp3mDolEFwk3M8E/odPt3cSpg/BQElaH IELm71VnoqAReYgum2Bsr3OTTrrJZmIQeUjsDx1VZumEvf7BmE3fX6PLA5/Dc/lCz/YJfZJGOWdo FsQq2uf2WGVfTbcgSXyCZqT4uwP5FbIWoUB/hUPuAh1CatZFM6q/0x66yYLudk6dDiuG27bvGlDR Gz+3FZFeoTgXvFSxnQmtqbP/yBZsR0Jr/FAGFbzf6OCF4HNepEEDWq6mUhGa9MtpHAndoxW2j4Ze 7UIaitAzwSS3hf5PnAyT0FpJFkKCv4asg6n1KRPbfL1f0ayB8D5Fbak3PMpbAsjzlSmjNzhty7+5 j+uuGB1zLLUnlIp2tPf2K2HTg7KEEuKwoSqipE1MHgef4MQ3eatfs+Kvzi/aUHD+6O7x5FrKnj7z Iep25xx35rudS41OzHt0i55CVYf3qPMQgU7xoScT8PJVvg2U3jV1fdlre35z4KoJpdZ6r7zmMBpa 4iKSUfYg/TL9WD1JXfhNRb88PpHkldQ9WGOqAflUWjYl4i9gSVcP7nPG5UjS+BrSSbYYSpIjdNaF oZMDmncPr8/RXQeGsgXZusmuy7loBy4dH4cRLM9+DpoB3Q5HXMa6n1rRxYAtXGYZ1O1pGaEWeB80 hO3sKvSMHZjBSAwIs9pIEdLKSBzsONFFXAhCHFepCatXGe0Y030wNVnRPMsX/zMcmAYz0XKGRhZh LsgU1w2ugUXITFTNJEAIrwbMN3beThEySUquAGN/5kblBPs1Wh4j8OhzC9JW17Xoajb0D5SkFion jrTzAAAAAElFTkSuQmCC In-Reply-To: <834l3q132a.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 13 Jul 2019 16:23:09 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:162878 Archived-At: Eli Zaretskii 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 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