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.bugs Subject: bug#64048: 30.0.50; global-display-line-numbers-mode has no easy way to set modes where it is enabled Date: Tue, 13 Jun 2023 21:19:00 +0300 Message-ID: <83wn07usx7.fsf@gnu.org> References: <87a5x3sa7w.fsf@localhost> <83bkhjweco.fsf@gnu.org> <875y7rs5s5.fsf@localhost> <835y7rwbmb.fsf@gnu.org> <87352vs2g5.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36617"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 64048@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 13 20:19:23 2023 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 1q98bx-0009Cr-HB for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Jun 2023 20:19:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q98bg-0008Ki-NB; Tue, 13 Jun 2023 14:19:04 -0400 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 1q98bf-0008KR-CP for bug-gnu-emacs@gnu.org; Tue, 13 Jun 2023 14:19:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q98bf-0007in-1n for bug-gnu-emacs@gnu.org; Tue, 13 Jun 2023 14:19:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q98be-0001PL-FH for bug-gnu-emacs@gnu.org; Tue, 13 Jun 2023 14:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Jun 2023 18:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64048 X-GNU-PR-Package: emacs Original-Received: via spool by 64048-submit@debbugs.gnu.org id=B64048.16866803315390 (code B ref 64048); Tue, 13 Jun 2023 18:19:02 +0000 Original-Received: (at 64048) by debbugs.gnu.org; 13 Jun 2023 18:18:51 +0000 Original-Received: from localhost ([127.0.0.1]:43046 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q98bT-0001Os-Aj for submit@debbugs.gnu.org; Tue, 13 Jun 2023 14:18:51 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:60124) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q98bQ-0001Oc-JO for 64048@debbugs.gnu.org; Tue, 13 Jun 2023 14:18:49 -0400 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 1q98bK-0007hf-EO; Tue, 13 Jun 2023 14:18:42 -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=25MbE4fRhMHop/cdERJNH0rHj/q8eRuIuwfHpbV9gaY=; b=QY0CHjKKqqW/ nyN0V5t03qm3kejSOUQpTeFVvkeGvPeTAWluHDp9IbyFndnWZlpOdazpLRIMVGBmwgXuUikwmflz6 pFdtUVXo/IeYA62K/mdzrieE9wMo3xcPHWBF5ET4bgk1rhnGePTfOTtTzqsydYHTwRPkrGBpMJTGd GypFv3mT3DWSC6p9HDQbZL5LOcNhjqsEJID+jZ7+marZ4QEPGTQPW57RtDpAENj0SejPhSvrxPPJQ mTYDeVmukGz09lbhaWCYVzMiy7OUnUNsz1TCL0Tg3vmzJ/jlUv0+Oj1trmnd4bOG9j2kziNxm+bkQ fp8CWk1grl6rS0HopJ5Hww==; 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 1q98bJ-0003w9-LE; Tue, 13 Jun 2023 14:18:42 -0400 In-Reply-To: <87352vs2g5.fsf@localhost> (message from Ihor Radchenko on Tue, 13 Jun 2023 17:21:30 +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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:263343 Archived-At: > From: Ihor Radchenko > Cc: 64048@debbugs.gnu.org > Date: Tue, 13 Jun 2023 17:21:30 +0000 > > May I rephrase is as a feature request then? > Like, please add `global-*-modes' customization for modes defined via `define-globalized-minor-mode'? > Or, at least, add `global-display-line-numbers-modes' customization? I'm not against such a feature, not at all. My objection was only to the particular implementation that you suggested: we cannot suddenly add a :predicate to a global mode where previously there wasn't one. People who activate this global mode expect it to be active everywhere, no questions asked. > I recall multiple occasions when I tried hard to disable a global mode > in some buffers, remembered that there is some special variable for it; > just to find out that a specific global minor mode does not support it. The usual way of enabling a mode selectively is to enable the non-global variant of the mode in a mode hook. I'm sure you know it. > And then we have non-standard variables like > `dabbrev-ignored-buffer-modes', `hi-lock-exclude-modes', > `which-func-modes' - all with different conventions. > > I can also tell you that a question about disabling global minor modes > in some buffers re-surfaces regularly in reddit discussions and IRC. > > We even have FAQ entries like https://www.emacswiki.org/emacs/LineNumbers#h5o-10 > And the suggested solution is re-defunning "turn-on" function - do we > really want to say that it is the way to go? You are preaching to the choir, really. There's nothing wrong with using :predicate when introducing a new globalized minor mode. I only objected to doing that in a mode that exists for such a long time without any conditions. (Btw, I don't think I understand the use of :predicate which you proposed: it isn't documented as accepting a function, only nil, t, or a list of modes.)