From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#41727: 26.3; Doc of `define-minor-mode' and minor-mode commands Date: Sat, 06 Jun 2020 09:13:53 +0300 Message-ID: <83k10kafha.fsf@gnu.org> References: <963d4189-17dc-4f4e-9993-0335fa271e50@default> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="66828"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 41727@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 06 08:15:10 2020 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 1jhS6o-000HI5-Mr for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Jun 2020 08:15:10 +0200 Original-Received: from localhost ([::1]:48470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhS6n-0000dG-7V for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Jun 2020 02:15:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhS6g-0000d8-Mc for bug-gnu-emacs@gnu.org; Sat, 06 Jun 2020 02:15:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38992) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jhS6g-0007Lb-Dc for bug-gnu-emacs@gnu.org; Sat, 06 Jun 2020 02:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jhS6g-0003A2-75 for bug-gnu-emacs@gnu.org; Sat, 06 Jun 2020 02:15: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, 06 Jun 2020 06:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41727 X-GNU-PR-Package: emacs Original-Received: via spool by 41727-submit@debbugs.gnu.org id=B41727.159142405012076 (code B ref 41727); Sat, 06 Jun 2020 06:15:02 +0000 Original-Received: (at 41727) by debbugs.gnu.org; 6 Jun 2020 06:14:10 +0000 Original-Received: from localhost ([127.0.0.1]:50538 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhS5q-00038i-Cq for submit@debbugs.gnu.org; Sat, 06 Jun 2020 02:14:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhS5o-00038W-Cx for 41727@debbugs.gnu.org; Sat, 06 Jun 2020 02:14:08 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57014) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhS5i-0006tJ-Sf; Sat, 06 Jun 2020 02:14:02 -0400 Original-Received: from [176.228.60.248] (port=3199 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jhS5i-0002Y5-67; Sat, 06 Jun 2020 02:14:02 -0400 In-Reply-To: <963d4189-17dc-4f4e-9993-0335fa271e50@default> (message from Drew Adams on Fri, 5 Jun 2020 13:39:27 -0700 (PDT)) 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:181590 Archived-At: > Date: Fri, 5 Jun 2020 13:39:27 -0700 (PDT) > From: Drew Adams > > The doc needs improvement when describing calling the mode from Lisp. > > 1. The doc string of `define-minor-mode' says this: > > When called from Lisp, the mode command toggles the mode if the > argument is `toggle', disables the mode if the argument is a > non-positive integer, and enables the mode otherwise (including if > the argument is omitted or nil or a positive integer). It actually says this: Interactively with no prefix argument, it toggles the mode. A prefix argument enables the mode if the argument is positive, and disables it otherwise. When called from Lisp, the mode command toggles the mode if the argument is ‘toggle’, disables the mode if the argument is a non-positive integer, and enables the mode otherwise (including if the argument is omitted or nil or a positive integer). > 3. The Elisp manual doc says this (node `Defining Minor Modes'): > > From Lisp, an argument of 'toggle' toggles the mode, whereas an > omitted or 'nil' argument enables the mode. It actually says this: The toggle command takes one optional (prefix) argument. If called interactively with no argument it toggles the mode on or off. A positive prefix argument enables the mode, any other prefix argument disables it. From Lisp, an argument of ‘toggle’ toggles the mode, whereas an omitted or ‘nil’ argument enables the mode. Are you reading obsolete docs?