From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#51580: hl-line-mode doesn't override global-hl-line-mode in current buffer Date: Wed, 3 Nov 2021 17:06:08 -0700 Message-ID: References: <11d5fecb4445fdc6fc5c@heytings.org> <11d5fecb447e1d78ea0f@heytings.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31736"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 51580@debbugs.gnu.org To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 04 01:07:40 2021 Return-path: Envelope-to: geb-bug-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 1miQI7-00084h-By for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 04 Nov 2021 01:07:39 +0100 Original-Received: from localhost ([::1]:60686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1miQI6-0003LM-0R for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Nov 2021 20:07:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51672) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1miQHd-0003Iz-AC for bug-gnu-emacs@gnu.org; Wed, 03 Nov 2021 20:07:12 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58221) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1miQHW-0003YX-Oa for bug-gnu-emacs@gnu.org; Wed, 03 Nov 2021 20:07:09 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1miQHW-0000OG-9H for bug-gnu-emacs@gnu.org; Wed, 03 Nov 2021 20:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Nov 2021 00:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51580 X-GNU-PR-Package: emacs Original-Received: via spool by 51580-submit@debbugs.gnu.org id=B51580.16359843771443 (code B ref 51580); Thu, 04 Nov 2021 00:07:02 +0000 Original-Received: (at 51580) by debbugs.gnu.org; 4 Nov 2021 00:06:17 +0000 Original-Received: from localhost ([127.0.0.1]:41534 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1miQGm-0000ND-QC for submit@debbugs.gnu.org; Wed, 03 Nov 2021 20:06:17 -0400 Original-Received: from mail-pl1-f169.google.com ([209.85.214.169]:33540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1miQGk-0000Mi-NK for 51580@debbugs.gnu.org; Wed, 03 Nov 2021 20:06:15 -0400 Original-Received: by mail-pl1-f169.google.com with SMTP id s24so4363355plp.0 for <51580@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) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 3 Nov 2021 17:06:08 -0700 In-Reply-To: <11d5fecb447e1d78ea0f@heytings.org> (Gregory Heytings's message of "Wed, 03 Nov 2021 11:42:22 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:218902 Archived-At: Gregory Heytings 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.