From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Linus =?UTF-8?Q?K=C3=A4llberg?= Newsgroups: gmane.emacs.bugs Subject: bug#36550: mouse-face overlay calculation error Date: Sat, 13 Jul 2019 15:38:05 +0000 Message-ID: References: <87v9wc2t8p.fsf@mouse.gnus.org> <831ryu31fc.fsf@gnu.org> <834l3q132a.fsf@gnu.org> <83zhliyq5p.fsf@gnu.org> <83y312yony.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="89728"; mail-complaints-to="usenet@blaine.gmane.org" Cc: "36550@debbugs.gnu.org" <36550@debbugs.gnu.org> To: Lars Ingebrigtsen , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 13 17:43:35 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 1hmKBT-000NBV-KX for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Jul 2019 17:43:35 +0200 Original-Received: from localhost ([::1]:56912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmK79-0000cC-Od for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Jul 2019 11:39:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35609) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmK75-0000bs-Mj for bug-gnu-emacs@gnu.org; Sat, 13 Jul 2019 11:39:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hmK74-0000Jf-It for bug-gnu-emacs@gnu.org; Sat, 13 Jul 2019 11:39:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34381) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hmK74-0000JG-Ba for bug-gnu-emacs@gnu.org; Sat, 13 Jul 2019 11:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hmK74-0002ac-6c for bug-gnu-emacs@gnu.org; Sat, 13 Jul 2019 11:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Linus =?UTF-8?Q?K=C3=A4llberg?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Jul 2019 15:39:02 +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.15630322959892 (code B ref 36550); Sat, 13 Jul 2019 15:39:02 +0000 Original-Received: (at 36550) by debbugs.gnu.org; 13 Jul 2019 15:38:15 +0000 Original-Received: from localhost ([127.0.0.1]:43202 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmK6I-0002ZT-E7 for submit@debbugs.gnu.org; Sat, 13 Jul 2019 11:38:14 -0400 Original-Received: from mail-oln040092070024.outbound.protection.outlook.com ([40.92.70.24]:23891 helo=EUR03-AM5-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmK6G-0002ZB-7m for 36550@debbugs.gnu.org; Sat, 13 Jul 2019 11:38:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xqm6V5Em43cd0FBmfwaH+MSbYz7iGub0BcebYWYMi8U=; b=MlazXWGG7mjDXH31oiuQEFaeLsdZ6+URBs3puKqK5tQjPCiddDyEYsfCHwCBZznhQkXdY1aIMzKOFtIhxDBZfHaqHUXJ22dHxZc/jDZ89iIeEuGEwxRS9XIdQTwYXZILF0XM09BJncFCYbDlFV2A4s0fo6eRlAHI/j8IZhZsz+RPsmlgdtNpxbAYrWrSLAKZKPvnyqrvEvehGr+7Ywoknfzc5Sj457rzYddGDEmrS34RORIXqPWwGXiesJzY6eHlhlWN/5xz0rJhQz9DZKsz+FjrFu/qukHMd/bpiAS9P2HvhkPhdOGgFQYpk5tlArs/M0HtPLnfNL2PJ0VKF7Z1oQ== Original-Received: from DB5EUR03FT029.eop-EUR03.prod.protection.outlook.com (10.152.20.51) by DB5EUR03HT090.eop-EUR03.prod.protection.outlook.com (10.152.21.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18; Sat, 13 Jul 2019 15:38:05 +0000 Original-Received: from AM0PR09MB2867.eurprd09.prod.outlook.com (10.152.20.59) by DB5EUR03FT029.mail.protection.outlook.com (10.152.20.131) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Sat, 13 Jul 2019 15:38:05 +0000 Original-Received: from AM0PR09MB2867.eurprd09.prod.outlook.com ([fe80::bc7b:8964:ba14:f6a2]) by AM0PR09MB2867.eurprd09.prod.outlook.com ([fe80::bc7b:8964:ba14:f6a2%3]) with mapi id 15.20.2073.012; Sat, 13 Jul 2019 15:38:05 +0000 Thread-Topic: bug#36550: mouse-face overlay calculation error Thread-Index: AQHVORJK1h+C6vMxBU6hzne99E+cCabIEqsEgABzzsSAAAOtSIAAB6shgAAHoW6AAAIcgIAABvVjgAAEILGAAAD+AoAACBUA In-Reply-To: Accept-Language: sv-SE, en-US Content-Language: en-US x-clientproxiedby: HE1PR05CA0257.eurprd05.prod.outlook.com (2603:10a6:3:fb::33) To AM0PR09MB2867.eurprd09.prod.outlook.com (2603:10a6:208:134::10) x-incomingtopheadermarker: OriginalChecksum:B07E7B27D6DA2A4C74E77BFCADC341074F32C8F53A847C8BE7FB4802D7DD92EA; UpperCasedChecksum:C865240418D546C49DD2C8D5C694DCB6C98CF81E4CD873C594E1FB04B7F77061; SizeAsReceived:8025; Count:49 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [QszIW09ojq+KV0cuMzhSBnvepY4Fwqr3] x-microsoft-original-message-id: <212543e1-25e4-906d-4f83-1db53e3653e2@outlook.com> x-ms-publictraffictype: Email x-incomingheadercount: 49 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(5050001)(7020095)(20181119110)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031323274)(2017031324274)(2017031322404)(1601125500)(1603101475)(1701031045); SRVR:DB5EUR03HT090; x-ms-traffictypediagnostic: DB5EUR03HT090: x-microsoft-antispam-message-info: ec8TZNA29uV6il9KhCSQkoPXEEQq8lnMx81jia/IYo/a/fS6c8o2/ycGH0QNVttvDTpFEY5sl+I0Ggn6TU96x/tXLHKWNZ0zZ5jSxSp/NMqNEZzelcMlQ0m+Mipo59vFmV+/Mwc4CE8PszTZhLPzwK540B5GF8JAQjXi1N5H9qxpC/0cTBSPzMAKc8TP721r Content-ID: X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: af016f47-0576-4877-5763-08d707a818ee X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jul 2019 15:38:05.5854 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5EUR03HT090 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:162908 Archived-At: Den 2019-07-13 kl. 17:08, skrev Lars Ingebrigtsen: > Lars Ingebrigtsen writes: >=20 >> Eli Zaretskii writes: >> >>> OK, but then they simply should use a separate overlay for the >>> mouse-face, I think, one that doesn't cover the newline. Does that >>> solve the problem? >> >> Yes, I can hack wid-edit.el as previously suggested. >=20 > OK, I took another look at the wid-edit.el code which reminded me that > it's not that simple, because it does a lot of manipulation of the > overlays in the most tedious way. >=20 > So I'll just leave this for somebody else to fix one rainy day... I might have misunderstood the discussion, but just to clarify my=20 opinion, if the overlay ends with a newline character, the mouse-face=20 should *not* extend to the right edge of the window (and definitely not=20 to the first character on the next line). I would expect it to end after=20 the last character before the newline, or possibly one character further=20 to the right (as if there was an imaginary space character inserted=20 there). As was said earlier, it doesn't make sense to highlight parts of=20 a line that doesn't contain clickable text. In recentf, the newline after the file name is included in each link so=20 that if point is positioned right after the last character -- which=20 happens, e.g., if one i-searches for a file extension -- one can simply=20 press enter to open the file (as said in the commit message). However,=20 due to the "bug" in question (if it is indeed a bug), when hovering the=20 mouse over a link, the whole line (up to the right edge of the window)=20 and the first character on the next line is highlighted. I have been=20 using Emacs, and the recentf package, for only five years, but I always=20 thought that this looked ugly and somewhat "buggy". The other day I was=20 a bit cranky and decided to look into it :-) As I said earlier, one way to fix the issue in recentf is simply to move=20 the newline outside of the link, but put a space character after each=20 file name. This way, the mouse-over highlights look okay, and one can=20 still i-search for a file extension and then simply press enter. Here is=20 a patch that does this: diff --git "a/lisp/recentf.el" "b/lisp/recentf.el" index 4112b44e48..5d832a9d37 100644 --- "a/lisp/recentf.el" +++ "b/lisp/recentf.el" @@ -1179,9 +1179,9 @@ IGNORE other arguments." ;; Represent a single file with a link widget `(link :tag ,(car menu-element) :button-prefix "" - :button-suffix "" + :button-suffix " " :button-face default - :format "%[%t\n%]" + :format "%[%t%]\n" :help-echo ,(concat "Open " (cdr menu-element)) :action recentf-open-files-action ;; Override the (problematic) follow-link property of the Best regards, Linus K=E4llberg