From unknown Sat Sep 20 03:58:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#44341: 27.1; define-minor-mode generates inaccurate docstring Resent-From: Thibault Polge Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 31 Oct 2020 11:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44341 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 44341@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.160414204929902 (code B ref -1); Sat, 31 Oct 2020 11:01:02 +0000 Received: (at submit) by debbugs.gnu.org; 31 Oct 2020 11:00:49 +0000 Received: from localhost ([127.0.0.1]:60611 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYocq-0007mE-SS for submit@debbugs.gnu.org; Sat, 31 Oct 2020 07:00:49 -0400 Received: from lists.gnu.org ([209.51.188.17]:55676) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYocp-0007m6-5m for submit@debbugs.gnu.org; Sat, 31 Oct 2020 07:00:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54608) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYoco-0004eB-Tw for bug-gnu-emacs@gnu.org; Sat, 31 Oct 2020 07:00:46 -0400 Received: from smtp12.smtpout.orange.fr ([80.12.242.134]:60303 helo=smtp.smtpout.orange.fr) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.90_1) (envelope-from ) id 1kYocm-000059-R8 for bug-gnu-emacs@gnu.org; Sat, 31 Oct 2020 07:00:46 -0400 Received: from maladict ([92.170.249.235]) by mwinf5d47 with ME id mb0Y2300U55UkPw03b0YVY; Sat, 31 Oct 2020 12:00:33 +0100 X-ME-Helo: maladict X-ME-Date: Sat, 31 Oct 2020 12:00:33 +0100 X-ME-IP: 92.170.249.235 From: Thibault Polge Date: Sat, 31 Oct 2020 12:00:23 +0100 Message-ID: <87361u64oo.fsf@thb.lt> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Received-SPF: softfail client-ip=80.12.242.134; envelope-from=thibault@thb.lt; helo=smtp.smtpout.orange.fr X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/31 07:00:33 X-ACL-Warn: Detected OS = Linux 2.6.x [fuzzy] X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable In my Emacs 27.1, the following line: (define-minor-mode test-mode "A test.") generates a function test-mode whose docstring ends as follows: > If called from Lisp, also enable the mode if ARG is omitted or nil, > and toggle it if ARG is =E2=80=98toggle=E2=80=99; disable the mode otherw= ise. This case (non-interactively, enable the mode if ARG is non-nil, unless it's toggle) doesn't seem to have been implemented. Here's a test that demonstrates that: (mapcar (lambda (x) (test-mode x) (cons x test-mode)) '(t ; Should disable. nil ; Should disable -33 ; Should NOT disable (but will) 33 ; Should enable 0 ; Should disable toggle ;=E2=80=AFShould toggle, and will. toggle ;=E2=80=AFRepeated for confirmation disable ; Should disable (as a random symbol) disable ; Again "What?" ; Same. )) The generated function reads as follows, and indeed implements none of the conditions the docstring describes. The relevant par is in the first half, before (run-hooks) (defun test-mode (&optional arg) "A test.\n\nIf called interactively, enable Test mode if ARG is positive,= and\ndisable it if ARG is zero or negative. If called from Lisp, also\nen= able the mode if ARG is omitted or nil, and toggle it if ARG is\n`toggle'; = disable the mode otherwise." (interactive (list (or current-prefix-arg 'toggle))) (let ((last-message (current-message))) (setq test-mode (if (eq arg 'toggle) (not test-mode) (> (prefix-numeric-value arg) 0))) (run-hooks 'test-mode-hook (if test-mode 'test-mode-on-hook 'test-mode-off-hook)) (if (called-interactively-p 'any) (progn nil (unless (and (current-message) (not (equal last-message (current-message)))) (let ((local " in current buffer")) (message "Test mode %sabled%s" (if test-mode "en" "dis") local)))))) (force-mode-line-update) test-mode) Best regards, Thibault --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJEBAEBCAAuFiEExwXquOM8bWb4Q2zVGxM2FxoLkGQFAl+dQ8gQHHRoaWJhdWx0 QHRoYi5sdAAKCRAbEzYXGguQZA4cD/92RytgB4myykg9ybWB0XQ4Sc9wClrzVIAN 9OLsaAwJ5Ni8iJo4my/35q09VuENG5rQtvgfZcsRvJbnrGtG9MEvptEbBEJGJCal s3rtaUdkcUgAP7srtsvSg31+UsX2uBYHqXxr5ZXRu5uM2kY7g1ADc+RCLoVR0W0j hCVJeEbi+kQSZyZdSS/WOoLY5g5m3Mbjsh8kmYJj9Q4m6k58x5fNS+HekpI6a0Wm mT4H+NGH4fRw1gthlEqBR83iYTDtvd6WKG1FwvMcWMRAA1/jexspNNXnKy8Cj1si MT0gyScVnsrc672V4b79dXJEr25PxNHCl64mSVlXCOCmZcS1qSeyETvXsnCKvFeZ /7Zmc7EVoAtFRsbVMK8/gov0m3cFg6/nGjzowYxGUHE/fJKLKpNnE26EnB3++cFf YtNRx6Z5hsZM/FhNdetFsVhPGGG0eK0XxhMPz3ylbgbtmxUerLHTDV+wXuwXqqyH TQDAJAsLP5FZI6oBWbgBked2QT0TYBgicunrX+L2ZZyRBkle9NLexMBYtzMW38QZ NlI/amZ8Vsof2ojVUHt5M+rsDN3+kaXN1KIXnixVTqWHMcC8b4kPXQNlnGFu/to7 NMq2O4xIUt8aQ1AWKnqKM7qu10M263YPvTp4IDUw2sT7nozxAStMFLGTyzNkuPCF /r0ovnfY0w== =IPNW -----END PGP SIGNATURE----- --=-=-=-- From unknown Sat Sep 20 03:58:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#44341: 27.1; define-minor-mode generates inaccurate docstring Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Nov 2020 14:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44341 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Thibault Polge Cc: 44341@debbugs.gnu.org Received: via spool by 44341-submit@debbugs.gnu.org id=B44341.160423927112496 (code B ref 44341); Sun, 01 Nov 2020 14:02:01 +0000 Received: (at 44341) by debbugs.gnu.org; 1 Nov 2020 14:01:11 +0000 Received: from localhost ([127.0.0.1]:36028 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZDuw-0003FU-LP for submit@debbugs.gnu.org; Sun, 01 Nov 2020 09:01:10 -0500 Received: from quimby.gnus.org ([95.216.78.240]:34572) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZDuu-0003FG-7P for 44341@debbugs.gnu.org; Sun, 01 Nov 2020 09:01:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To: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=ef58ZGMwke7OoOLg9J2OjPVtdlp5B1GOGaaILyD02+w=; b=dBIvN1Y1SCbE5BwDsOEaPvNv3e o2Vj2oupBzKLAK9WU/rHPTzCrtkf3tjuSkMegRjKWnUnXvX2lq7A+5eEEqTgLVgA3X1Y86sUWivsl SCbRwG0lu1p1PGn9Age0Ou8dvToWrM+f/74MPR1hbt/XVkgog36433bXL/gM170xDlJ0=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kZDud-0000lR-NT; Sun, 01 Nov 2020 15:01:01 +0100 From: Lars Ingebrigtsen References: <87361u64oo.fsf@thb.lt> X-Now-Playing: Blaine Reiniger's _Songs From The Rain Palace_: "Song For J.J. " Date: Sun, 01 Nov 2020 15:00:50 +0100 In-Reply-To: <87361u64oo.fsf@thb.lt> (Thibault Polge's message of "Sat, 31 Oct 2020 12:00:23 +0100") Message-ID: <87sg9tb2i5.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Thibault Polge writes: >> If called from Lisp, also enable the mode if ARG is omitted or nil, >> and toggle it if ARG is =?UTF-8?Q?=E2=80=98toggle=E2=80=99;?= disable the mode otherwise. > > This case (non-interactively, enable the mode if ARG is [...] 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: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Thibault Polge writes: >> If called from Lisp, also enable the mode if ARG is omitted or nil, >> and toggle it if ARG is =E2=80=98toggle=E2=80=99; disable the mode other= wise. > > This case (non-interactively, enable the mode if ARG is non-nil, unless > it's toggle) doesn't seem to have been implemented. Here's a test that > demonstrates that: > > (mapcar > (lambda (x) (test-mode x) (cons x test-mode)) > '(t ; Should disable. > nil ; Should disable > -33 ; Should NOT disable (but will) > 33 ; Should enable > 0 ; Should disable > toggle ;=E2=80=AFShould toggle, and will. > toggle ;=E2=80=AFRepeated for confirmation > disable ; Should disable (as a random symbol) > disable ; Again > "What?" ; Same. > )) I think there's bugs here both in the doc string and in the implementation: A negative number should switch the mode off, so the code works correctly there (but not according to documentation). Is this a typo? > nil ; Should disable because nil should enable (as documented), and does. The other values that enables (but should disable) you note are correct. I mean, it's correct that the current implementation is incorrect, and I've now pushed a fixed for this to the trunk. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 01 09:01:33 2020 Received: (at control) by debbugs.gnu.org; 1 Nov 2020 14:01:33 +0000 Received: from localhost ([127.0.0.1]:36033 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZDvI-0003G6-Uu for submit@debbugs.gnu.org; Sun, 01 Nov 2020 09:01:33 -0500 Received: from quimby.gnus.org ([95.216.78.240]:34586) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZDvG-0003Fs-PT for control@debbugs.gnu.org; Sun, 01 Nov 2020 09:01:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=gfbVXoyvnkjgCfPDCyKNe0mBm/p6QAbnrt/fY8zmjWY=; b=H+89GmV7FomiShe/Yj9HnPJJoX L1+oqVgc0tLk2X6bv7dFB0EI7mnCPgrL4h0uRH6VCwLsdKwd5dLoFaeYByix3LqiFj7F4UDVeFwIc zsxkdNSAxfSd1ekstqGulI0hXvrTlq/z9brmN4ilVIeS5jwtu0I7JDvJc/Zyozw3Z5zQ=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kZDv8-0000ld-Ux for control@debbugs.gnu.org; Sun, 01 Nov 2020 15:01:25 +0100 Date: Sun, 01 Nov 2020 15:01:21 +0100 Message-Id: <87r1pdb2ha.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #44341 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: tags 44341 fixed close 44341 28.1 quit 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: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 44341 fixed close 44341 28.1 quit From unknown Sat Sep 20 03:58:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#44341: 27.1; define-minor-mode generates inaccurate docstring Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Nov 2020 15:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44341 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed To: Thibault Polge Cc: 44341@debbugs.gnu.org Received: via spool by 44341-submit@debbugs.gnu.org id=B44341.160424458223574 (code B ref 44341); Sun, 01 Nov 2020 15:30:02 +0000 Received: (at 44341) by debbugs.gnu.org; 1 Nov 2020 15:29:42 +0000 Received: from localhost ([127.0.0.1]:38240 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZFIc-00068A-1i for submit@debbugs.gnu.org; Sun, 01 Nov 2020 10:29:42 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:22889) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZFIa-00067y-D0 for 44341@debbugs.gnu.org; Sun, 01 Nov 2020 10:29:40 -0500 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id BC29C440980; Sun, 1 Nov 2020 10:29:34 -0500 (EST) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 1D17544096C; Sun, 1 Nov 2020 10:29:33 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1604244573; bh=1Ju7+MMgaIvE4EMKnmBnvJa7wuFQiNu0Qs9Y80319Ws=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=clmH8Db66Akp/zE2+d2S1XnXoCfSvEX2uZ4p8SGCj+iDY9lE3WLL6q//y6UTkYIsM 91o5iB6h3MLTHVK4puEQPgBA7BCA2zVQKvf/lb1CkfinIcT5HQvtQarrK8Ugq5jzyK IYP3EPFxrUhMaRqRfX/SzbxwWRpS7oW5868hTTYykMolGkChYG+MtXi1AejRbAPceI NXD8Lzu3aPX/AAB8E8Mxu12R82Kk4X9HAmrxSVudT49jCAxLhiAR++tyDm6lM1IWo1 d3Xrb2zphf2070n4xPQUXm9jvwHch4cZfZxIfXJ6BHwjTp/vmeQZIqA+0G03IH2dgJ yQw9xnpQDhvYg== Received: from alfajor (unknown [157.52.9.240]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B08831201CD; Sun, 1 Nov 2020 10:29:32 -0500 (EST) From: Stefan Monnier Message-ID: References: <87361u64oo.fsf@thb.lt> Date: Sun, 01 Nov 2020 10:29:27 -0500 In-Reply-To: <87361u64oo.fsf@thb.lt> (Thibault Polge's message of "Sat, 31 Oct 2020 12:00:23 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.073 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > (mapcar > (lambda (x) (test-mode x) (cons x test-mode)) > '(t ; Should disable. An argument of the form t has traditionally enabled the mode. Many .emacs file have calls like (foo-mode t), so we need to preserve this. > nil ; Should disable The argument nil should definitely enable the mode. > -33 ; Should NOT disable (but will) > 33 ; Should enable Negative and positive are the "canonical" way to disable and enable a mode, no -33 should disable and 33 should enable. > 0 ; Should disable Historically, 0 has been defined to disable the mode, indeed. I recommend to use -1 instead, but a lot of code uses 0. > toggle ;=E2=80=AFShould toggle, and will. > toggle ;=E2=80=AFRepeated for confirmation Right. > disable ; Should disable (as a random symbol) > disable ; Again > "What?" ; Same. These should be considered as errors. Whether we catch them and signal an error or silently do something else is not particular important to me. But we shouldn't document the behavior for those arguments as being anything else than errors. Stefan From unknown Sat Sep 20 03:58:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#44341: 27.1; define-minor-mode generates inaccurate docstring Resent-From: Philipp Stephani Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Nov 2020 12:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44341 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed To: Stefan Monnier Cc: 44341@debbugs.gnu.org, Thibault Polge Received: via spool by 44341-submit@debbugs.gnu.org id=B44341.160432010432217 (code B ref 44341); Mon, 02 Nov 2020 12:29:01 +0000 Received: (at 44341) by debbugs.gnu.org; 2 Nov 2020 12:28:24 +0000 Received: from localhost ([127.0.0.1]:40032 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZYwi-0008NZ-Bs for submit@debbugs.gnu.org; Mon, 02 Nov 2020 07:28:24 -0500 Received: from mail-oi1-f180.google.com ([209.85.167.180]:47053) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZYwh-0008NL-4s for 44341@debbugs.gnu.org; Mon, 02 Nov 2020 07:28:23 -0500 Received: by mail-oi1-f180.google.com with SMTP id x1so14429225oic.13 for <44341@debbugs.gnu.org>; Mon, 02 Nov 2020 04:28:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=w1oLR60L0yEL30hlEYVQNyonhVftJ2jTBpMPdlmzUHI=; b=USsQ4WnTXOtvZVyrELtnVZi+toWTcbAL1TmOqFMWu66fp59HcGGlj0voVUdsWoXY+b pnFK71w+aM/tp15r0npqs4onh//SUbWylaWPRpi/nIaxqIP3E99wi0h4BcoUtw+vqG0U bzqP+fS6WDutXYA6RSPZDL44lA7x9E/PENDhM8//dVdZkbrAh/xOwOOGx0/9tm7PT7r9 mK6m1tIkIt1PCMqFZ/oUTgASiEWGSysu/nj/IkaE6FFL1BXoOjMHF0aaILr/2ytxRMGg dLTyTmXg9A9tQMaI5WgPcfXvMvrD+tWRhcVuYak2ROB7aB0hGPckuNzQHAD9Ks3JJXkU iwmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=w1oLR60L0yEL30hlEYVQNyonhVftJ2jTBpMPdlmzUHI=; b=NU8DzG1VvmqUR4hYHuWztbmYaa8327lFsyk+QyFtULWz4/cr47YPKjN5Rrf5QWxk9p cgKBC2NAePA5lJsCjJzWZCXvmU2LFfVUpLw8MiW0+xPcJRaFLORUuWDIvWS80lhIcLEs eDfvCRaPG9CZC3q/GuCj+f/9e6+oO/SdsOr3oDw0vA5duQJfAvqG4HDOlT+lhDtLpayz IiiEzIoq93EmYSwlBa4LsUlpl6XfAz/+cFI6fvMDGOhXAY1Kd6obN3/uzgGLoHFg0JXw 6Tj52ndtDEH1yZYKZn9hahRWCNQTpvr5Y1ywWuQzIbNGNU5R/1qDiPQAl//KbrtsizAj lGuQ== X-Gm-Message-State: AOAM533myGEYQsw6SZekwk0n7bSSeyupGvBI0CzNeYDicGCn4xnz4AiP FBlOI+EpaLqod+StqhPJGUA0P8lgNfWm9Du6wH8= X-Google-Smtp-Source: ABdhPJzR/gA9ElSTNaAVqJ4Q4Hf+GWKRXo/HyQs7//AND+l5WMlHZ3I89Jv2RPYXmUyUnJAWclGetsWd9Qwoe0QsIL4= X-Received: by 2002:a05:6808:3af:: with SMTP id n15mr2933305oie.65.1604320097367; Mon, 02 Nov 2020 04:28:17 -0800 (PST) MIME-Version: 1.0 References: <87361u64oo.fsf@thb.lt> In-Reply-To: From: Philipp Stephani Date: Mon, 2 Nov 2020 13:28:06 +0100 Message-ID: Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Am So., 1. Nov. 2020 um 16:30 Uhr schrieb Stefan Monnier : > > disable ; Should disable (as a random symbol) > > disable ; Again > > "What?" ; Same. > > These should be considered as errors. Whether we catch them and signal > an error or silently do something else is not particular important > to me. We should definitely signal an error here. A form such as (my-mode 'enable) actually disabling the mode is very confusing. The mode function needs to check for the various cases anyway, it might as well use `cond' and signal an error in the non-matching case. From unknown Sat Sep 20 03:58:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#44341: 27.1; define-minor-mode generates inaccurate docstring Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Nov 2020 15:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44341 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed To: Philipp Stephani Cc: 44341@debbugs.gnu.org, Thibault Polge , Stefan Monnier Received: via spool by 44341-submit@debbugs.gnu.org id=B44341.160433132212009 (code B ref 44341); Mon, 02 Nov 2020 15:36:02 +0000 Received: (at 44341) by debbugs.gnu.org; 2 Nov 2020 15:35:22 +0000 Received: from localhost ([127.0.0.1]:42186 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZbrd-00037d-On for submit@debbugs.gnu.org; Mon, 02 Nov 2020 10:35:21 -0500 Received: from quimby.gnus.org ([95.216.78.240]:48472) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZbrc-00037P-E5 for 44341@debbugs.gnu.org; Mon, 02 Nov 2020 10:35:20 -0500 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=XxLOh5S/cDNjJAEUiel2k5vitZXPy3SmxKNuN3hyE7o=; b=bhYDjSYzXag+BTDKuXXFyUs2m/ EOce/iPnSmnQMKpLJhErpY5tnV9OpLLTXcD7rxmx/mOSiUS9RFNQN4p1STFdyAQ7CcXoNL0fdBRVi jRnoBUGoN2w170DuX56tIXyvtSrfmDxKKE61nDl7TWscGuwcXdEjS97E9SMH0pxjuuN8=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kZbrS-0001wI-NK; Mon, 02 Nov 2020 16:35:13 +0100 From: Lars Ingebrigtsen References: <87361u64oo.fsf@thb.lt> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEXftaDTkHOeamBJ Nj+GeIP///9UTBKyAAAAAWJLR0QF+G/pxwAAAAd0SU1FB+QLAg47MxUkqYoAAAGFSURBVDjLbZQN bsMgDIXN1gMAu8Cwd4DVzgGqJfc/055NkkJaS5Uqf/jvGUKU6YNb6VaZuRHs0ygR8QSWG8DNKGeA chiAbkSJjUo+MlEHtoFsRvUokSl1sGwPopWYhMOLzFHEPORPqCVB8eytUI9wsAr9VgAEwZ/cD4Bc q9E9gGnJpYjtpmKkVVpJYmgAh/2MA7S71BW+KncqTiv3kIjgMKrGLbpyEwDzEg4Uf84yDqquD7QF sNppBHfhWlrKtZXbj+gJWH2ukqhy8ol4BNCkhMh9wg4wW8nQD8d9yDoBNwch8BWUWGQdUlmsoxVx sGsygsQawJ4gVp5TrP4VIJVcge8iQekQV0bQsHMxe6q+Azhyqu/AXtVFkwmoLyjmuwI+zSYAhdk1 H/wH8J/YaB2oXtwH6MPzO8DjDCPQqfITaPfKDNhBXI+53e+AjBvOUyo8ppjd7+mYKvuj1iA6RcC+ /KH4Q7YLwODSk12BR+h0/gTzcAcQ4xcNLT4oS2J+F2G/VF9C/gEWf6lMTPjvrwAAACV0RVh0ZGF0 ZTpjcmVhdGUAMjAyMC0xMS0wMlQxNDo1OTo1MSswMDowMAfa8TcAAAAldEVYdGRhdGU6bW9kaWZ5 ADIwMjAtMTEtMDJUMTQ6NTk6NTErMDA6MDB2h0mLAAAAAElFTkSuQmCC X-Now-Playing: Richard And Linda Thompson's _Pour Down Like Silver_: "Dimming Of The Day-Dargai" Date: Mon, 02 Nov 2020 16:35:09 +0100 In-Reply-To: (Philipp Stephani's message of "Mon, 2 Nov 2020 13:28:06 +0100") Message-ID: <87h7q76ac2.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.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: Philipp Stephani writes: >> > disable ; Should disable (as a random symbol) >> > disable ; Again >> > "What?" ; Same. >> >> These should be considered as errors. Whether we catch them and signal >> an error or silently do som [...] 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: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Philipp Stephani writes: >> > disable ; Should disable (as a random symbol) >> > disable ; Again >> > "What?" ; Same. >> >> These should be considered as errors. Whether we catch them and signal >> an error or silently do something else is not particular important >> to me. > > We should definitely signal an error here. A form such as (my-mode > 'enable) actually disabling the mode is very confusing. The mode > function needs to check for the various cases anyway, it might as well > use `cond' and signal an error in the non-matching case. We can't signal an error here -- ARG has been documented to accept these values, and starting to signal an error would break a lot of people's code. (Now, ARG has been documented to work exactly opposite of the way it really works for these values, but that's a different wrinkle.) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Sat Sep 20 03:58:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#44341: 27.1; define-minor-mode generates inaccurate docstring Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Nov 2020 15:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44341 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed To: Philipp Stephani Cc: 44341@debbugs.gnu.org, thibault@thb.lt, monnier@iro.umontreal.ca Received: via spool by 44341-submit@debbugs.gnu.org id=B44341.160433237722017 (code B ref 44341); Mon, 02 Nov 2020 15:53:02 +0000 Received: (at 44341) by debbugs.gnu.org; 2 Nov 2020 15:52:57 +0000 Received: from localhost ([127.0.0.1]:42244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZc8f-0005j3-1p for submit@debbugs.gnu.org; Mon, 02 Nov 2020 10:52:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:32808) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZc8d-0005iq-J6 for 44341@debbugs.gnu.org; Mon, 02 Nov 2020 10:52:56 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48714) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZc8W-0003ip-Tn; Mon, 02 Nov 2020 10:52:48 -0500 Received: from [176.228.60.248] (port=2183 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kZc8W-0002qO-9N; Mon, 02 Nov 2020 10:52:48 -0500 Date: Mon, 02 Nov 2020 17:52:38 +0200 Message-Id: <835z6neoxl.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Philipp Stephani on Mon, 2 Nov 2020 13:28:06 +0100) References: <87361u64oo.fsf@thb.lt> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Philipp Stephani > Date: Mon, 2 Nov 2020 13:28:06 +0100 > Cc: 44341@debbugs.gnu.org, Thibault Polge > > Am So., 1. Nov. 2020 um 16:30 Uhr schrieb Stefan Monnier > : > > > > disable ; Should disable (as a random symbol) > > > disable ; Again > > > "What?" ; Same. > > > > These should be considered as errors. Whether we catch them and signal > > an error or silently do something else is not particular important > > to me. > > We should definitely signal an error here. A form such as (my-mode > 'enable) actually disabling the mode is very confusing. Signaling an error would be an incompatible change. Someone who has (my-mode 'disable) in their Lisp code will complain that it makes perfect sense. I object to making incompatible changes in this area; let's fix the problems wrt documentation, but it's too late to introduce incompatible changes into this stuff, which is used all over, in Emacs and elsewhere. Wed already had the first bug report about such incompatible changes, less than a day after it was pushed. I'm quite certain that incompatible change was unintended, but here you propose to make it quite intentionally, and that would be a serious mistake, IMO. From unknown Sat Sep 20 03:58:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#44341: 27.1; define-minor-mode generates inaccurate docstring Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Nov 2020 16:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44341 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed To: Philipp Stephani , Stefan Monnier Cc: 44341@debbugs.gnu.org, Thibault Polge Received: via spool by 44341-submit@debbugs.gnu.org id=B44341.1604333921578 (code B ref 44341); Mon, 02 Nov 2020 16:19:01 +0000 Received: (at 44341) by debbugs.gnu.org; 2 Nov 2020 16:18:41 +0000 Received: from localhost ([127.0.0.1]:42351 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZcXZ-00009G-0V for submit@debbugs.gnu.org; Mon, 02 Nov 2020 11:18:41 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:47406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZcXV-000092-Vi for 44341@debbugs.gnu.org; Mon, 02 Nov 2020 11:18:39 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0A2G92nK034845; Mon, 2 Nov 2020 16:18:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=RulARSAzvhikJEjfs5n0EUA62a3+TXwyjF/bPfyJrDU=; b=qWurFW4IVQypeD3Z72tXvT24J2ddaC+De1Zo+AjXzmQsEbypGSNyJUjMFcYi9X5yJUkN m4UeGFH/70h9mxzyxohuhd+T/sTUmFD4vR7tUbLhqAD9+soICqisKRUhufwzKOZjj9zo cVydG7O8nF1DqYbxLcQYElenr3ycp4xdyTGW20xQ0AIrqs8aqE0MYWd/pvC/U1gt6CI0 DROyvdX4qJsctiEAbqLDOvn2HJQf4YVsv9eviaX+s2VeLUecNJLohcdJb8KftUnwROBF l+6qC6kZKYfDM1fBPpYE49nd3OL78il24KpzFhwt3x3N4UORpFgoBj4cJosNwFIr8PDt GA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 34hhw2ctwx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 02 Nov 2020 16:18:32 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0A2GB0rH057954; Mon, 2 Nov 2020 16:18:31 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3030.oracle.com with ESMTP id 34jf46r3ay-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 02 Nov 2020 16:18:31 +0000 Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 0A2GIQRV027981; Mon, 2 Nov 2020 16:18:27 GMT MIME-Version: 1.0 Message-ID: <5af254d0-9bad-4443-919e-b05382e90b56@default> Date: Mon, 2 Nov 2020 08:18:24 -0800 (PST) From: Drew Adams References: <87361u64oo.fsf@thb.lt> In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.5056.0 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9793 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 mlxscore=0 bulkscore=0 malwarescore=0 mlxlogscore=994 phishscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011020125 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9793 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 malwarescore=0 mlxscore=0 suspectscore=0 clxscore=1011 priorityscore=1501 impostorscore=0 spamscore=0 lowpriorityscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011020125 X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > We should definitely signal an error here. A form such as (my-mode > 'enable) actually disabling the mode is very confusing. The mode > function needs to check for the various cases anyway, it might as well > use `cond' and signal an error in the non-matching case. Not to argue, but this kind of thing is all over Emacs Lisp. The ability to use an unspecified non-nil value, to mean/do something that might work against the natural-language "meaning" of the name of a symbol argument, is just one example of the vast amounts of rope that Lisp gives its users to hang themselves with. Do you really think `define-minor-mode' should be fiddled with specially here, to prevent use of an unfortunately named symbol arg to disable the mode? `define-minor-mode' and its doc, and the doc of minor modes, are already complex/confusing enough. Do you think fiddling to eliminate confusion over poorly named symbol values won't actually add to that confusion?