From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: How to implement mouse highlighing in tabulated list mode, just like for buttons? Date: Sun, 05 Feb 2023 12:19:50 +0200 Message-ID: <83fsbks9bt.fsf@gnu.org> References: <3a7d15dca834fe52fb6470c3564b7cd2.support1@rcdrun.com> <83ilghtl6w.fsf@gnu.org> <837cwxtfv5.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37291"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Jean Louis Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Feb 05 11:20:25 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pOc8G-0009Ss-P5 for ged-emacs-devel@m.gmane-mx.org; Sun, 05 Feb 2023 11:20:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOc7c-0005w6-PP; Sun, 05 Feb 2023 05:19:44 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pOc7b-0005vy-VN for emacs-devel@gnu.org; Sun, 05 Feb 2023 05:19:44 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pOc7Z-0007MM-C7; Sun, 05 Feb 2023 05:19:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=5UVS87js/b7eADhDvcuG66ystIgTwExSSknaZacnWWc=; b=Bb/KfztlwQOl WPBZ6AEawYLhS5hBXU/X8aNRrDpl6W6XL/6kDVcn0B6/xMxUfl2tH8g6TplIsUrqEcAKTG8IOKSWY AuN06rSkjzOijScCwsbGoZ9CwZPBLAwJfLoYIGrN+Qa7HeW+6zuGApCYX64wXeXBAs6d7ojyEr8WP wXFtt40hMlxnLIgQr2Ei+0FFYLusy0C/9ALNaNwYzaMa8p+EkDW12nUYka3FrTLl05GkEsPTmUutp bXVAK42N5/iwR3FTggiFnH1Uy2+0Hwcmmhs1BoLYVT60VQhSX66QrmNeM6uXQfBT0w0FiBu/qcT8p x8fhC4h/gnOK6Itg56QyYQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pOc7Y-0005Pc-2C; Sun, 05 Feb 2023 05:19:40 -0500 In-Reply-To: (message from Jean Louis on Sun, 5 Feb 2023 12:06:16 +0300) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:302997 Archived-At: > Date: Sun, 5 Feb 2023 12:06:16 +0300 > From: Jean Louis > Cc: emacs-devel@gnu.org > > Can I could just add face with 'mouse-face as text property? 'face' and 'mouse-face' are two different text properties, so a face cannot "have" another text property. Also, only 'mouse-face' text property is handled in the way that makes the text highlighted when the mouse pointer is above it. > I am achieving now the effect by using `propertize` on the element of > each entry of `tabulated-list-entries': > > (let ((name (propertize (aref item 1) 'mouse-face 'highlight))) > > So that works now well! > > > > I wonder if it would slow down the listings in tabulated-list-mode. > > > > When the mouse-face has the value 'highlight', it is only shown when > > the mouse pointer is above the text with that property. Otherwise, > > the text is displayed normally. > > Yes. > > I am thinking that if I wish to place mouse-face as text property > line by line, I better avoid making it after the tabulated-list-mode, > as that would slow down. I doubt this will slow down.