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: Sat, 17 Jun 2023 10:46:05 +0300 Message-ID: <83ttv6r0oy.fsf@gnu.org> References: <87a5x3sa7w.fsf@localhost> <83bkhjweco.fsf@gnu.org> <875y7rs5s5.fsf@localhost> <835y7rwbmb.fsf@gnu.org> <87352vs2g5.fsf@localhost> <83wn07usx7.fsf@gnu.org> <87sfavqhn5.fsf@localhost> <83mt12uufn.fsf@gnu.org> <87fs6u8b0p.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26588"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 64048@debbugs.gnu.org To: Ihor Radchenko , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 17 09:47:33 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 1qAQej-0006kT-CW for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Jun 2023 09:47:33 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qAQeW-0002Ok-01; Sat, 17 Jun 2023 03:47:20 -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 1qAQeN-0002Mp-2l for bug-gnu-emacs@gnu.org; Sat, 17 Jun 2023 03:47:12 -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 1qAQeE-0001wx-7Z for bug-gnu-emacs@gnu.org; Sat, 17 Jun 2023 03:47:10 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qAQeE-0007oQ-2J for bug-gnu-emacs@gnu.org; Sat, 17 Jun 2023 03:47: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: Sat, 17 Jun 2023 07:47: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.168698797429969 (code B ref 64048); Sat, 17 Jun 2023 07:47:02 +0000 Original-Received: (at 64048) by debbugs.gnu.org; 17 Jun 2023 07:46:14 +0000 Original-Received: from localhost ([127.0.0.1]:50795 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAQdS-0007nH-B3 for submit@debbugs.gnu.org; Sat, 17 Jun 2023 03:46:14 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44882) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAQdQ-0007n4-5r for 64048@debbugs.gnu.org; Sat, 17 Jun 2023 03:46:13 -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 1qAQdK-0001tF-JI; Sat, 17 Jun 2023 03:46:06 -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=0Q3BfWQ26eX3FxtWymJbdXx56jWwOh5sXzMR93DHm0I=; b=fbsynI6xVroU /eYk+a3LT0ugF0zpBtd0qVAdD9j3I7mIFav/OY2vTGhSCf5laKT6F/GlHvKNt2fPuPriMAsAJR2fk gmjSMBeCOPWIwnlD8V85zD/6jnOYcQ0/ZPP8ussVban3IVtB+u/0JvmxUZEGhA9OvhcqUiKruA8Zq vFpbt+3eUT3HpriSRcamP3Mq9vXr5S6ozD1U74X6veHDDDeCiKMDpAz1HagINNHJFLhF78KQagRzF 60MV/zSd5HoIPO2AgTXwB/NVxWYikJV+64KaBmu+3uFyBLtZO3bSKm7Q04SlLgHJ/v1K+kSsJDb2h /cTI3a9dglguggtS/yMo/A==; 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 1qAQdK-0005fj-3L; Sat, 17 Jun 2023 03:46:06 -0400 In-Reply-To: <87fs6u8b0p.fsf@localhost> (message from Ihor Radchenko on Wed, 14 Jun 2023 12:48:54 +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:263510 Archived-At: > From: Ihor Radchenko > Cc: Stefan Monnier , 64048@debbugs.gnu.org > Date: Wed, 14 Jun 2023 12:48:54 +0000 > > Eli Zaretskii writes: > > >> Let me correct my initial suggestion: > >> > >> (define-globalized-minor-mode global-display-line-numbers-mode > >> display-line-numbers-mode display-line-numbers--turn-on > >> :predicate t) > > > > This change is probably harmless, but OTOH what does it give you that > > the current code doesn't? AFAIU, you still cannot customize the modes > > where line numbers will be off. > > > > IOW, :predicate is not a means for user customizations of the modes > > where the minor mode will be turned on. Or am I missing something? > > >> :predicate defines the default value of > >> `global-display-line-numbers-modes' variable. > > > > It does? Where is this documented? > > Yup. It is not documented on API level, but when :predicate is non-nil, > `define-globalized-minor-mode' does the following: > > (setq turn-on-function > `(lambda () > (require 'easy-mmode) > (when (easy-mmode--globalized-predicate-p ,MODE-predicate) > (funcall ,turn-on-function)))) > > ;; Minor mode docstring: > (if predicate > (concat > "\n\n" > (internal--format-docstring-line > "`%s' is used to control which modes this minor mode is used in." > MODE-predicate)) ;; -modes > "") > > ,(when predicate > `(defcustom ,MODE-predicate ,(car predicate) > ,(format "Which major modes `%s' is switched on in. > This variable can be either t (all major modes), nil (no major modes), > or a list of modes and (not modes) to switch use this minor mode or > not. For instance > > (c-mode (not message-mode mail-mode) text-mode) > > means \"use this mode in all modes derived from `c-mode', don't use in > modes derived from `message-mode' or `mail-mode', but do use in other > modes derived from `text-mode'\". An element with value t means \"use\" > and nil means \"don't use\". There's an implicit nil at the end of the > list." > mode) > :type '(repeat sexp) > ,@group)) Stefan, is our current documentation of :predicate incomplete?