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.help Subject: Re: hl-line mode -- visual effect Date: Wed, 10 Aug 2022 21:10:35 +0300 Message-ID: <831qtoq89w.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14400"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 10 20:11:38 2022 Return-path: Envelope-to: geh-help-gnu-emacs@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 1oLqB7-0003cN-LB for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 10 Aug 2022 20:11:37 +0200 Original-Received: from localhost ([::1]:40508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oLqB6-0004Zd-0Z for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 10 Aug 2022 14:11:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLqAH-0004ZP-PH for help-gnu-emacs@gnu.org; Wed, 10 Aug 2022 14:10:46 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:38272) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLqAH-00021G-GW for help-gnu-emacs@gnu.org; Wed, 10 Aug 2022 14:10:45 -0400 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=5cz7RiHzm0a4NYuLfaOIuRQ0TBLSuypfW/usebCRkuQ=; b=oArPQnIIZVV6 BDi9v83Ztljg6vFcb4K3j2+AtOXxsVviwci+HeHjPFSAsvXroDTCcjWmvTEHRqDJdqgqTAbE6JPcE q6XqEhs6gyo/1gjW+PQdfbis8bzKn/0hbDcpXwe9/Mi6CobgqkQrC+Rk69mieseEELCn25C2uvd/w /oaXcko4Fw04eme02d4t8lz6r6fa77vZ8I4i/+pWABo7UbWmvQdU//ZqrzSo2MbLrnCRyhtZlNv/g rD5i9maOaWWV55xKg0Vm9BUMtw4U0Rhj7zEOKrw4ZY6nnNv7Mufax1AT3sBrXu4hdIhjLl3s1POU5 a4WvGhy1CNMdJD1wyE36CQ==; Original-Received: from [87.69.77.57] (port=4249 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 1oLqAH-0007oQ-0B for help-gnu-emacs@gnu.org; Wed, 10 Aug 2022 14:10:45 -0400 In-Reply-To: (message from Dani Moncayo on Wed, 10 Aug 2022 19:51:29 +0200) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:138785 Archived-At: > From: Dani Moncayo > Date: Wed, 10 Aug 2022 19:51:29 +0200 > > Until now, I have customized the "hl-line" font to set a background > color, slightly more saturated than the background of the "default" > font. > > This approach has worked reasonably well for me for quite some time. > But it's not perfect: I have buffers (eg. "*Diff*" buffer) > where the background color of each line conveys valuable semantic > information (added line, removed line, ...), and thus, in those > buffers, > my current approach doesn't work well, because the background color of > the selected line is fixed (i.e. _overrides_ the _original_ background > color of the line). > > So, I'd like to highlight the selected line in a more subtle way: I'd > like the selected line to slightly alter[1] the _original_ background > color. > > Does Emacs currently provide a reasonably simple way to achieve this? No, at least not in the way you put it. When Emacs merges two colors each of which has the same attribute (in this case, background color) defined, only one of them "wins". What you could do is highlight the line using face attributes other than fore-/background colors. But you already know that.