GNU bug report logs - #51580
hl-line-mode doesn't override global-hl-line-mode in current buffer

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Stefan Kangas <stefan@HIDDEN>; dated Wed, 3 Nov 2021 06:48:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 51580 <at> debbugs.gnu.org:


Received: (at 51580) by debbugs.gnu.org; 4 Nov 2021 18:09:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 04 14:09:38 2021
Received: from localhost ([127.0.0.1]:43403 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mihBB-0006iC-Qj
	for submit <at> debbugs.gnu.org; Thu, 04 Nov 2021 14:09:37 -0400
Received: from quimby.gnus.org ([95.216.78.240]:57990)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mihBA-0006hv-2M
 for 51580 <at> debbugs.gnu.org; Thu, 04 Nov 2021 14:09:36 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=Fuyaf7e2ajhl3HLj2SYe3NfLkWPHL//YaVE0yCuIC4s=; b=L8+BDSo1HKEhOcF2ul1HRlCZaG
 ngosr/CZum9vFP52bahLKW5wl4GVBJVP7Pycny1yISUPkJhCD5G0u5d632ui3W2g8etj8UjlmfwM4
 95Cb1SIP/lXN/cF8rDfnSX4ke4/UXfd7I6zGhhLzpGbOorS2n/Jj8tWLf+XLL6vPuyBc=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mihB1-0005Kx-SN; Thu, 04 Nov 2021 19:09:30 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Stefan Kangas <stefan@HIDDEN>
Subject: Re: bug#51580: hl-line-mode doesn't override global-hl-line-mode in
 current buffer
References: <CADwFkm=DOj4=ii9Wh6L34bXVw_62L5Lpe8KX7f0KnqXOGWSygg@HIDDEN>
 <11d5fecb4445fdc6fc5c@HIDDEN>
 <CADwFkmmXnt_8OYyF2yaefBYVNBBv4a2qZT=QtVU3xPJ4KHG+rg@HIDDEN>
 <11d5fecb447e1d78ea0f@HIDDEN>
 <CADwFkmmTde304uYr6VUVPnD4HbmvOxAvwXjpqkKPeRHSYs6q-Q@HIDDEN>
X-Now-Playing: Orange's _Orange_: "Feijoa"
Date: Thu, 04 Nov 2021 19:09:27 +0100
In-Reply-To: <CADwFkmmTde304uYr6VUVPnD4HbmvOxAvwXjpqkKPeRHSYs6q-Q@HIDDEN>
 (Stefan Kangas's message of "Wed, 3 Nov 2021 17:06:08 -0700")
Message-ID: <87k0hnssh4.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Stefan Kangas <stefan@HIDDEN> writes: > So in line with
 this convention, I expect that no new command is needed: > I should just
 be able call `M-x hl-line-mode' to disable it. Yup. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51580
Cc: 51580 <at> debbugs.gnu.org, Gregory Heytings <gregory@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Stefan Kangas <stefan@HIDDEN> writes:

> So in line with this convention, I expect that no new command is needed:
> I should just be able call `M-x hl-line-mode' to disable it.

Yup.

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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51580; Package emacs. Full text available.

Message received at 51580 <at> debbugs.gnu.org:


Received: (at 51580) by debbugs.gnu.org; 4 Nov 2021 00:06:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 03 20:06:17 2021
Received: from localhost ([127.0.0.1]:41534 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1miQGm-0000ND-QC
	for submit <at> debbugs.gnu.org; Wed, 03 Nov 2021 20:06:17 -0400
Received: from mail-pl1-f169.google.com ([209.85.214.169]:33540)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1miQGk-0000Mi-NK
 for 51580 <at> debbugs.gnu.org; Wed, 03 Nov 2021 20:06:15 -0400
Received: by mail-pl1-f169.google.com with SMTP id s24so4363355plp.0
 for <51580 <at> debbugs.gnu.org>; Wed, 03 Nov 2021 17:06:14 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:in-reply-to:references:user-agent
 :mime-version:date:message-id:subject:to:cc;
 bh=m6ZpT+UqeNTzRxQPEcZlbbLPiLnQWyfs3PtxRGM1QKQ=;
 b=chQxgVPjz0j8GxLKOaNEwlliM92SiBjwhVaq+UNlFrWfQn1U9KuqS60YYhwvQ3X1F7
 eHi38UvJ1lsyvh2S935+qnSIZKGgPI6y2yINWHBZgLXc3dZmFFHRUGy7OKxARblH9/2h
 hS3/LE2+xrrA2hmnAM/75fbKPnd1QEpe6UDNTTwRhS8HYUR5ECrzBfKugo/QY27mEV8j
 yK6bt2G2Cxoyb4GPQE/Jp8WOn35KkO/etP0lIaNkTxveso2+snyqW6Cd/rdhGaaphio2
 jp43kplWEqcT9LcYVq74j/upPK+pdyR8lWuGMl3Zj/GygmnOuLRnM0z48yH47f8MW8p9
 DJLA==
X-Gm-Message-State: AOAM531tTEspxYoH7IRrJyghBfFuYsK26WTpsNA8OjtQrvfSOOELx/t2
 eekaVEh7sVuU44z2vG8cq9luw76RP+6yzJ82dbOjeq0b
X-Google-Smtp-Source: ABdhPJz90yfe0OVH1glX9HNnx83dptzBxvXgsJf5/bkj+QV/mUUzN3TiqpyovrUt9evfHL+Rmm104+m7lrUaWX1yhM0=
X-Received: by 2002:a17:90a:be10:: with SMTP id
 a16mr17757842pjs.133.1635984369177; 
 Wed, 03 Nov 2021 17:06:09 -0700 (PDT)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Wed, 3 Nov 2021 17:06:08 -0700
From: Stefan Kangas <stefan@HIDDEN>
In-Reply-To: <11d5fecb447e1d78ea0f@HIDDEN> (Gregory Heytings's message
 of "Wed, 03 Nov 2021 11:42:22 +0000")
References: <CADwFkm=DOj4=ii9Wh6L34bXVw_62L5Lpe8KX7f0KnqXOGWSygg@HIDDEN>
 <11d5fecb4445fdc6fc5c@HIDDEN>
 <CADwFkmmXnt_8OYyF2yaefBYVNBBv4a2qZT=QtVU3xPJ4KHG+rg@HIDDEN>
 <11d5fecb447e1d78ea0f@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Date: Wed, 3 Nov 2021 17:06:08 -0700
Message-ID: <CADwFkmmTde304uYr6VUVPnD4HbmvOxAvwXjpqkKPeRHSYs6q-Q@HIDDEN>
Subject: Re: bug#51580: hl-line-mode doesn't override global-hl-line-mode in
 current buffer
To: Gregory Heytings <gregory@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 51580
Cc: 51580 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

Gregory Heytings <gregory@HIDDEN> writes:

>>>> It seems like there is currently no way to use `global-hl-line-mode' while
>>>> disabling it for individual buffers.
>>>
>>> There is one: (setq-local global-hl-line-mode nil).
>>
>> Here, that leaves an overlay in the buffer.  Does it not do that for you?
>>
>> [You didn't quote it, but I wrote "(setq-default global-hl-line-mode nil)" in
>> the bug report.  That was a typo.  I meant to write "(setq-local
>> global-hl-line-mode nil)".]
>>
>
> Oh, now I see what you mean.  Indeed I had seen your setq-default, but did not
> guess it meant setq-local.  Indeed, M-: (setq-local global-hl-line-mode nil)
> leaves an overlay in the buffer.  I use this in buffer setup hooks, so the
> overlay is not created.  If you want to remove that overlay, you also need to
> call global-hl-line-unhighlight:
>
> (defun buffer-deactivate-global-hl-line-mode ()
>   (interactive)
>   (global-hl-line-unhighlight)
>   (setq-local global-hl-line-mode nil))

My understanding is that our convention for minor modes that provide
both a global and local variant is that calling the local mode should
disable the global mode in the current buffer.

See for example `show-paren-mode' and `show-paren-local-mode'.

So in line with this convention, I expect that no new command is needed:
I should just be able call `M-x hl-line-mode' to disable it.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51580; Package emacs. Full text available.

Message received at 51580 <at> debbugs.gnu.org:


Received: (at 51580) by debbugs.gnu.org; 3 Nov 2021 13:11:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 03 09:11:28 2021
Received: from localhost ([127.0.0.1]:39466 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1miG36-0008TJ-Jo
	for submit <at> debbugs.gnu.org; Wed, 03 Nov 2021 09:11:28 -0400
Received: from heytings.org ([95.142.160.155]:47246)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gregory@HIDDEN>) id 1miG33-0008TA-WA
 for 51580 <at> debbugs.gnu.org; Wed, 03 Nov 2021 09:11:27 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org;
 s=20210101; t=1635945085;
 bh=hlkm21gRRTqG3B30WAYiKKGiI4NFWliFkshbHxM2GOM=;
 h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From;
 b=A1OXRjiXAQn1eiLBdWsuDAUCSCgFv1cEUEAvRjFsrjSIfOnQYFkv7NF+ttfijj/cR
 ukgbFhXvik9GS5b6CU39G3dNvi8X0zyuctImoDMRyTVaWUb//uAhGwiRGnpmXC6YuM
 foG1GNwouf9sSFiioCu0AAcLOiJ0napeMEDFob5I6v0OgP/Gp4cVKpn3Oqf05ldX1O
 /kOxSQRqGb8L5PjAwX9mtrIG8x55C84z+fFuEuCq2K/9CB5QzEcZ+1LteWs6cm8faA
 3OxYPiOImX/bGKQymtf4g3Erd+B4CJ8vPXK2ColoLj3tlZU/orR0Nc92Zqf6Fvcaj6
 1ORELX1Giwp0A==
Date: Wed, 03 Nov 2021 13:11:24 +0000
From: Gregory Heytings <gregory@HIDDEN>
To: Stefan Kangas <stefan@HIDDEN>
Subject: Re: bug#51580: hl-line-mode doesn't override global-hl-line-mode in
 current buffer
In-Reply-To: <11d5fecb445396a2df7d@HIDDEN>
Message-ID: <11d5fecb44babaf9332f@HIDDEN>
References: <CADwFkm=DOj4=ii9Wh6L34bXVw_62L5Lpe8KX7f0KnqXOGWSygg@HIDDEN>
 <11d5fecb4445fdc6fc5c@HIDDEN>
 <CADwFkmmXnt_8OYyF2yaefBYVNBBv4a2qZT=QtVU3xPJ4KHG+rg@HIDDEN>
 <11d5fecb447e1d78ea0f@HIDDEN>
 <11d5fecb445396a2df7d@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="uxMS045Vax"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 51580
Cc: 51580 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


--uxMS045Vax
Content-Type: text/plain; charset=us-ascii; format=flowed


And just in case, here's a patch with that command.
--uxMS045Vax
Content-Type: text/x-diff; name=Add-command-to-toggle-global-hl-line-mode-locally.patch
Content-Transfer-Encoding: base64
Content-ID: <11d5fecb442eab61c1c3@HIDDEN>
Content-Description: 
Content-Disposition: attachment; filename=Add-command-to-toggle-global-hl-line-mode-locally.patch

RnJvbSBjNzQ3ZGQwMjJkMTMzMTMzYWU5ZDQzY2ExMzdmODdmMmU4MjAzZTRk
IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQ0KRnJvbTogR3JlZ29yeSBIZXl0
aW5ncyA8Z3JlZ29yeUBoZXl0aW5ncy5vcmc+DQpEYXRlOiBXZWQsIDMgTm92
IDIwMjEgMTM6MDc6MDUgKzAwMDANClN1YmplY3Q6IFtQQVRDSF0gQWRkIGNv
bW1hbmQgdG8gdG9nZ2xlIGdsb2JhbC1obC1saW5lLW1vZGUgbG9jYWxseS4N
Cg0KKiBsaXNwL2hsLWxpbmUuZWwgKGdsb2JhbC1obC1saW5lLW1vZGUtdG9n
Z2xlKTogTmV3IGNvbW1hbmQuDQotLS0NCiBsaXNwL2hsLWxpbmUuZWwgfCAx
MCArKysrKysrKysrDQogMSBmaWxlIGNoYW5nZWQsIDEwIGluc2VydGlvbnMo
KykNCg0KZGlmZiAtLWdpdCBhL2xpc3AvaGwtbGluZS5lbCBiL2xpc3AvaGwt
bGluZS5lbA0KaW5kZXggMjZjZmNjM2Y5Yy4uZTYzMzEzMTI4ZSAxMDA2NDQN
Ci0tLSBhL2xpc3AvaGwtbGluZS5lbA0KKysrIGIvbGlzcC9obC1saW5lLmVs
DQpAQCAtMjE1LDYgKzIxNSwxNiBAQCBnbG9iYWwtaGwtbGluZS1tb2RlDQog
ICAgIChyZW1vdmUtaG9vayAncG9zdC1jb21tYW5kLWhvb2sgIydnbG9iYWwt
aGwtbGluZS1oaWdobGlnaHQpDQogICAgIChyZW1vdmUtaG9vayAnY2hhbmdl
LW1ham9yLW1vZGUtaG9vayAjJ2dsb2JhbC1obC1saW5lLXVuaGlnaGxpZ2h0
KSkpDQogDQorOzs7IyMjYXV0b2xvYWQNCisoZGVmdW4gZ2xvYmFsLWhsLWxp
bmUtbW9kZS10b2dnbGUgKCkNCisgICJUb2dnbGUgbGluZSBoaWdobGlnaHRp
bmcgaW4gdGhpcyBidWZmZXIgd2l0aCBHbG9iYWwgSGwtTGluZSBtb2RlLiIN
CisgIChpbnRlcmFjdGl2ZSkNCisgIChtYWtlLXZhcmlhYmxlLWJ1ZmZlci1s
b2NhbCAnZ2xvYmFsLWhsLWxpbmUtbW9kZSkNCisgIChpZiBnbG9iYWwtaGwt
bGluZS1tb2RlDQorICAgICAgKGdsb2JhbC1obC1saW5lLXVuaGlnaGxpZ2h0
KQ0KKyAgICAoZ2xvYmFsLWhsLWxpbmUtaGlnaGxpZ2h0KSkNCisgIChzZXRx
IGdsb2JhbC1obC1saW5lLW1vZGUgKG5vdCBnbG9iYWwtaGwtbGluZS1tb2Rl
KSkpDQorDQogKGRlZnVuIGdsb2JhbC1obC1saW5lLWhpZ2hsaWdodCAoKQ0K
ICAgIkhpZ2hsaWdodCB0aGUgY3VycmVudCBsaW5lIGluIHRoZSBjdXJyZW50
IHdpbmRvdy4iDQogICAod2hlbiBnbG9iYWwtaGwtbGluZS1tb2RlCTsgTWln
aHQgYmUgY2hhbmdlZCBvdXRzaWRlIHRoZSBtb2RlIGZ1bmN0aW9uLg0KLS0g
DQoyLjMzLjANCg0K

--uxMS045Vax--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51580; Package emacs. Full text available.

Message received at 51580 <at> debbugs.gnu.org:


Received: (at 51580) by debbugs.gnu.org; 3 Nov 2021 11:51:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 03 07:51:52 2021
Received: from localhost ([127.0.0.1]:39279 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1miEo4-00067S-G4
	for submit <at> debbugs.gnu.org; Wed, 03 Nov 2021 07:51:52 -0400
Received: from heytings.org ([95.142.160.155]:47124)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gregory@HIDDEN>) id 1miEo3-00067I-Cp
 for 51580 <at> debbugs.gnu.org; Wed, 03 Nov 2021 07:51:51 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org;
 s=20210101; t=1635940310;
 bh=j5aKuTa3PAZbU7fvJBoczRrRrGm/RYV+pZNZUiJVQgQ=;
 h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From;
 b=dFXSUmq7EUwMJWbG3GEPi3veqW0hJGYSov2dI9qYqMwM0un+G2vQKb1QCa+I3hrzF
 la90J7DzKCIei5vhDGhY0kIfT/ppJgqrplMSVDBC7mt8d/q387Jl6qG4+1U5voVWx3
 +jp73E01jfGFMQoydlHEnjvl7e3LrSIyzjFdOclKnz10XqfYwd4vudL69RwFEnBRZ+
 /vaP382ol9acaOR1At4jWpg7mTUS6unTPI0JxPWu/hjzJUCPTvwaSuqEH9HSyDTyt4
 leioWV1DyH4cPk+nUNV88r81n0x0RwanVmYKOPkl4SLjXM06P+MPw6myE6427ZP9uA
 PvzqEKxm8eJHw==
Date: Wed, 03 Nov 2021 11:51:49 +0000
From: Gregory Heytings <gregory@HIDDEN>
To: Stefan Kangas <stefan@HIDDEN>
Subject: Re: bug#51580: hl-line-mode doesn't override global-hl-line-mode in
 current buffer
In-Reply-To: <11d5fecb447e1d78ea0f@HIDDEN>
Message-ID: <11d5fecb445396a2df7d@HIDDEN>
References: <CADwFkm=DOj4=ii9Wh6L34bXVw_62L5Lpe8KX7f0KnqXOGWSygg@HIDDEN>
 <11d5fecb4445fdc6fc5c@HIDDEN>
 <CADwFkmmXnt_8OYyF2yaefBYVNBBv4a2qZT=QtVU3xPJ4KHG+rg@HIDDEN>
 <11d5fecb447e1d78ea0f@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 51580
Cc: 51580 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


And of course this could become a command:

(defun buffer-toggle-global-hl-line-mode ()
   (interactive)
   (make-variable-buffer-local 'global-hl-line-mode)
   (if global-hl-line-mode
       (global-hl-line-unhighlight)
     (global-hl-line-highlight))
   (setq global-hl-line-mode (not global-hl-line-mode)))




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51580; Package emacs. Full text available.

Message received at 51580 <at> debbugs.gnu.org:


Received: (at 51580) by debbugs.gnu.org; 3 Nov 2021 11:42:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 03 07:42:27 2021
Received: from localhost ([127.0.0.1]:39267 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1miEew-0005oa-Ub
	for submit <at> debbugs.gnu.org; Wed, 03 Nov 2021 07:42:27 -0400
Received: from heytings.org ([95.142.160.155]:47110)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gregory@HIDDEN>) id 1miEeu-0005oP-JF
 for 51580 <at> debbugs.gnu.org; Wed, 03 Nov 2021 07:42:25 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org;
 s=20210101; t=1635939743;
 bh=Pwm1A1E4Xy/Mydx36IstyYFQtGgDhIIog+wPygs7Tag=;
 h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From;
 b=l87yuYd43DfibIR/kWV31a1pxBDnn8nTz4q18HjInoFzy1FFRLdvH1A7D7QKVhrlZ
 ptbfJx0GdLTR/tZ99+l8sRyG0MX0amRLEC2S3l8xGf5/rJe95FvVsfYuTe4dMtaPsa
 4USkcka3PXiqZCOOdwh773vCj3whwBrB3hckyWd1mIFnPfxPdamoHeyDCaI6rb1NBR
 CCr38C9fTYakBVeafW499ub2LKvvgIlwz0f5JPfBozvG7oYQJpcAqGV0gd9lLJFzha
 GDSneVlXMpcd/CUWoirxTAre79y6T9wWq/eBFvzuqA1/7rzLX1d3Td849rjd/yYJXe
 XxPgtMSfBZJsQ==
Date: Wed, 03 Nov 2021 11:42:22 +0000
From: Gregory Heytings <gregory@HIDDEN>
To: Stefan Kangas <stefan@HIDDEN>
Subject: Re: bug#51580: hl-line-mode doesn't override global-hl-line-mode in
 current buffer
In-Reply-To: <CADwFkmmXnt_8OYyF2yaefBYVNBBv4a2qZT=QtVU3xPJ4KHG+rg@HIDDEN>
Message-ID: <11d5fecb447e1d78ea0f@HIDDEN>
References: <CADwFkm=DOj4=ii9Wh6L34bXVw_62L5Lpe8KX7f0KnqXOGWSygg@HIDDEN>
 <11d5fecb4445fdc6fc5c@HIDDEN>
 <CADwFkmmXnt_8OYyF2yaefBYVNBBv4a2qZT=QtVU3xPJ4KHG+rg@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 51580
Cc: 51580 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


>>> It seems like there is currently no way to use `global-hl-line-mode' 
>>> while disabling it for individual buffers.
>>
>> There is one: (setq-local global-hl-line-mode nil).
>
> Here, that leaves an overlay in the buffer.  Does it not do that for 
> you?
>
> [You didn't quote it, but I wrote "(setq-default global-hl-line-mode 
> nil)" in the bug report.  That was a typo.  I meant to write 
> "(setq-local global-hl-line-mode nil)".]
>

Oh, now I see what you mean.  Indeed I had seen your setq-default, but did 
not guess it meant setq-local.  Indeed, M-: (setq-local 
global-hl-line-mode nil) leaves an overlay in the buffer.  I use this in 
buffer setup hooks, so the overlay is not created.  If you want to remove 
that overlay, you also need to call global-hl-line-unhighlight:

(defun buffer-deactivate-global-hl-line-mode ()
   (interactive)
   (global-hl-line-unhighlight)
   (setq-local global-hl-line-mode nil))




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51580; Package emacs. Full text available.

Message received at 51580 <at> debbugs.gnu.org:


Received: (at 51580) by debbugs.gnu.org; 3 Nov 2021 11:29:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 03 07:29:11 2021
Received: from localhost ([127.0.0.1]:39247 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1miES7-0003Hw-5B
	for submit <at> debbugs.gnu.org; Wed, 03 Nov 2021 07:29:11 -0400
Received: from mail-pg1-f179.google.com ([209.85.215.179]:42513)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1miES4-0003Hg-Oh
 for 51580 <at> debbugs.gnu.org; Wed, 03 Nov 2021 07:29:09 -0400
Received: by mail-pg1-f179.google.com with SMTP id t7so2083967pgl.9
 for <51580 <at> debbugs.gnu.org>; Wed, 03 Nov 2021 04:29:08 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=C42eTLP/NmJ3Y+ubOBAHK8Rn15hD1onAWhh2yxAtr00=;
 b=eVjp+RYcXAgVAxfjjv9PicX0tFrWiG73ydXoYVCP66apUM+FhvoS5sbB8sEqg4nkYr
 UVzszA7EbVvpL+zQxfIfjW1Izo3tCug/+RqwccEoBbhXrry2atfM5uCp05wJvdsxlSZ1
 yO3Gim/2Fx9mAopSmHanwWhqQ58iqVtuBBulCVg2eLnB0QTr+vNpAgWViTbJ+WyKXmJ2
 YT97UWm9NZXmpSvTXdILrd0Cmnb/DrFRou4hDup+eoBaSv4+EGCqU28E/8A/W67kcv1s
 x3cOF5In9Z4pZKyobBvjcQ5KK4uqTcNjgpRuucCvGK3HODL0DKkJRHyaUgV2XfunEmBl
 2TgA==
X-Gm-Message-State: AOAM533QhP+wiCIyFPxXOwou7Nka1fpfFnTQYnDI8YH99Umi+bWNA3Vp
 up56OlEv366YnNeiIM09QSc4HpqYXkAEndurlU4=
X-Google-Smtp-Source: ABdhPJwPPR90ZEJ9bK+NpqsR8DHNm9wO56TbX7HxODh83FuntliDeA9t8a1XyDuFDxzfyjMuKLIkOP10RfFuePanmrI=
X-Received: by 2002:a63:370c:: with SMTP id e12mr32462240pga.359.1635938942809; 
 Wed, 03 Nov 2021 04:29:02 -0700 (PDT)
MIME-Version: 1.0
References: <CADwFkm=DOj4=ii9Wh6L34bXVw_62L5Lpe8KX7f0KnqXOGWSygg@HIDDEN>
 <11d5fecb4445fdc6fc5c@HIDDEN>
In-Reply-To: <11d5fecb4445fdc6fc5c@HIDDEN>
From: Stefan Kangas <stefan@HIDDEN>
Date: Wed, 3 Nov 2021 12:28:51 +0100
Message-ID: <CADwFkmmXnt_8OYyF2yaefBYVNBBv4a2qZT=QtVU3xPJ4KHG+rg@HIDDEN>
Subject: Re: bug#51580: hl-line-mode doesn't override global-hl-line-mode in
 current buffer
To: Gregory Heytings <gregory@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 51580
Cc: 51580 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

Gregory Heytings <gregory@HIDDEN> writes:

> > It seems like there is currently no way to use `global-hl-line-mode'
> > while disabling it for individual buffers.
>
> There is one: (setq-local global-hl-line-mode nil).

Here, that leaves an overlay in the buffer.  Does it not do that for you?

[You didn't quote it, but I wrote "(setq-default global-hl-line-mode
nil)" in the bug report.  That was a typo.  I meant to write
"(setq-local global-hl-line-mode nil)".]




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51580; Package emacs. Full text available.

Message received at 51580 <at> debbugs.gnu.org:


Received: (at 51580) by debbugs.gnu.org; 3 Nov 2021 10:06:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 03 06:06:05 2021
Received: from localhost ([127.0.0.1]:39084 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1miD9h-0000fD-HV
	for submit <at> debbugs.gnu.org; Wed, 03 Nov 2021 06:06:05 -0400
Received: from heytings.org ([95.142.160.155]:47008)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gregory@HIDDEN>) id 1miD9f-0000f3-NO
 for 51580 <at> debbugs.gnu.org; Wed, 03 Nov 2021 06:06:04 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org;
 s=20210101; t=1635933962;
 bh=bGwokz3HNRBPWP8kfxJ8FrXe3aAcUOfxP9jNKVRqm94=;
 h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From;
 b=XP8ivKzFFx34insdYmvI0ILDivrqn2i80XkDRTPOmaG0B4HyBzWUT6Rp7dhft9huW
 tClerPQeBApoWKuotQ12PraZwZLFIud9LlGQbT76AF2TgJ6c0fYFdD3brERtYEyVpC
 FPKpSjgo562A+3kL2Y3MF+CpqZY8AiviWgGK6gKfGvjHpUeInLMHbv4pb3QQ7sYjPO
 qih11AeTpnzrrnff0N7e9nlb6gCL4qO/PWt9ZEZskpCIX2/3IDOilKFkD+M965XM9H
 dcsNaBBiHtHGDdWlqhTI95Blba2fczFA1qV3CoYusDoZO6BaLx6C1fQeQeI8hMFkcD
 Hzm1arJcio9eQ==
Date: Wed, 03 Nov 2021 10:06:01 +0000
From: Gregory Heytings <gregory@HIDDEN>
To: Stefan Kangas <stefan@HIDDEN>
Subject: Re: bug#51580: hl-line-mode doesn't override global-hl-line-mode in
 current buffer
In-Reply-To: <CADwFkm=DOj4=ii9Wh6L34bXVw_62L5Lpe8KX7f0KnqXOGWSygg@HIDDEN>
Message-ID: <11d5fecb4445fdc6fc5c@HIDDEN>
References: <CADwFkm=DOj4=ii9Wh6L34bXVw_62L5Lpe8KX7f0KnqXOGWSygg@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 51580
Cc: 51580 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


>
> It seems like there is currently no way to use `global-hl-line-mode' 
> while disabling it for individual buffers.
>

There is one: (setq-local global-hl-line-mode nil).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51580; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 3 Nov 2021 06:47:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 03 02:47:20 2021
Received: from localhost ([127.0.0.1]:38724 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1miA3L-0003jV-SJ
	for submit <at> debbugs.gnu.org; Wed, 03 Nov 2021 02:47:20 -0400
Received: from lists.gnu.org ([209.51.188.17]:58422)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1miA3K-0003jO-8D
 for submit <at> debbugs.gnu.org; Wed, 03 Nov 2021 02:47:18 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:52434)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <stefankangas@HIDDEN>)
 id 1miA3K-0007SV-1z
 for bug-gnu-emacs@HIDDEN; Wed, 03 Nov 2021 02:47:18 -0400
Received: from mail-pj1-f54.google.com ([209.85.216.54]:46787)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <stefankangas@HIDDEN>)
 id 1miA3I-0008Gr-Ev
 for bug-gnu-emacs@HIDDEN; Wed, 03 Nov 2021 02:47:17 -0400
Received: by mail-pj1-f54.google.com with SMTP id
 x16-20020a17090a789000b001a69735b339so656946pjk.5
 for <bug-gnu-emacs@HIDDEN>; Tue, 02 Nov 2021 23:47:16 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:mime-version:date:message-id:subject:to;
 bh=T93+yJk6boIp2VIU6lSPS6dCpl4i5SGIxp+REsnCoRM=;
 b=xpPzOELDlyq0P0SF5MsReM817zaTdfq77uC/qJYrOZwD1+6X2ZGjcdfUnAztf3QVp7
 aSGfuA4Gl+xlNieRcc5jlbE+ABPQiAWpnTzEQDBokam47ERpoAwsPT9lPm4fL+ltJ3q4
 OY0FecyPtMXmzS3MLj+trkeHldVQwvL8H7UhR7rLBxdvXsHyJVJ8dQNQwiqdVveDNqOz
 L+U2tW72nVKoGQnXOK3VBun/negbTqoTi31K2cGzSTug7orP0L37qByNkTkjhJifKNpM
 bHGkgLmRS5XtmWCYu5tKoKdpoIy6MeGJO5MYkTM0xS7PmLKN/PmYLIui6aq+MmU/Uj7w
 klZQ==
X-Gm-Message-State: AOAM531JZBx3RA4Bwx/OVaGhtrP1d6yXPquDbeWV9KobSmA1Ny1n9u2c
 AQt7dhg2cXjaVTIBTB2drsRhsv5rbYx7+ruXbAFD+0SM
X-Google-Smtp-Source: ABdhPJy+Dc8vW9yaEWtXK/N4huR/tS1j5c31QLKzJstpSDnQHhJPMB3kKO0aX3SrH/qgebQ2L46sLmu+FkPxF3wVpPI=
X-Received: by 2002:a17:90a:be10:: with SMTP id
 a16mr12197406pjs.133.1635922035005; 
 Tue, 02 Nov 2021 23:47:15 -0700 (PDT)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Tue, 2 Nov 2021 23:47:14 -0700
From: Stefan Kangas <stefan@HIDDEN>
MIME-Version: 1.0
Date: Tue, 2 Nov 2021 23:47:14 -0700
Message-ID: <CADwFkm=DOj4=ii9Wh6L34bXVw_62L5Lpe8KX7f0KnqXOGWSygg@HIDDEN>
Subject: hl-line-mode doesn't override global-hl-line-mode in current buffer
To: bug-gnu-emacs@HIDDEN
Content-Type: text/plain; charset="UTF-8"
Received-SPF: pass client-ip=209.85.216.54;
 envelope-from=stefankangas@HIDDEN; helo=mail-pj1-f54.google.com
X-Spam_score_int: -13
X-Spam_score: -1.4
X-Spam_bar: -
X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9,
 FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001,
 HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001,
 RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -0.8 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.8 (-)

It seems like there is currently no way to use `global-hl-line-mode'
while disabling it for individual buffers.

Steps to reproduce:

0. emacs -Q
1. M-x global-hl-line-mode
2. M-x hl-line-mode

Now, `global-hl-line-mode' is still in effect, and lines are still
highlighted.  I expect that running `hl-line-mode' turns off line
highlighting.

There is a comment in hl-line.el saying:

    ;; You could make variable `global-hl-line-mode' buffer-local and set
    ;; it to nil to avoid highlighting specific buffers, when the global
    ;; mode is used.

However, if I say M-x global-hl-line-mode and then

    M-: (setq-default global-hl-line-mode nil)

the highlighting overlay is left on the current line.




Acknowledgement sent to Stefan Kangas <stefan@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#51580; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 4 Nov 2021 18:15:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.