From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#41727: 26.3; Doc of `define-minor-mode' and minor-mode commands Date: Fri, 5 Jun 2020 13:39:27 -0700 (PDT) Message-ID: <963d4189-17dc-4f4e-9993-0335fa271e50@default> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="124536"; mail-complaints-to="usenet@ciao.gmane.io" To: 41727@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 05 22:40:11 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 1jhJ8M-000WIQ-Mq for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Jun 2020 22:40:10 +0200 Original-Received: from localhost ([::1]:35856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhJ8L-0000B2-P4 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Jun 2020 16:40:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhJ8E-00009x-GI for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2020 16:40:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38481) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jhJ8E-0003A4-7L for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2020 16:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jhJ8E-00041R-2W for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2020 16:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Jun 2020 20:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41727 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.159138957815425 (code B ref -1); Fri, 05 Jun 2020 20:40:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Jun 2020 20:39:38 +0000 Original-Received: from localhost ([127.0.0.1]:50027 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhJ7p-00040j-Kc for submit@debbugs.gnu.org; Fri, 05 Jun 2020 16:39:37 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:37542) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhJ7m-00040a-Va for submit@debbugs.gnu.org; Fri, 05 Jun 2020 16:39:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40654) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhJ7m-0008BQ-Ns for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2020 16:39:34 -0400 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:52430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhJ7l-00033L-IR for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2020 16:39:34 -0400 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 055KahxW015015 for ; Fri, 5 Jun 2020 20:39:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=66pxRLVmd+1woi3nAPNl+K5ahiReKAmoLpNzfdSQdXo=; b=Bqm5LZQ1af0KkS880S/byWAw5T/1JrVe5Xiy2QtHYHir6hjfEcDSmzc78rf7/9sIyd+U UMNunlGZ+31JYModctUalmhEJBTsipgHGpCUAbQ22Zh8QDUQuayNbc3Z45ntWGkPcRQ5 NQR25q9tRz3r9LfamZo2oKpo38AJ6wTq+XcfKTqB1oh9nMGi5cV+bJxYqTGNLh8GzBEN gTzImy3m7yErd6kFnba3r6eOkwzbhqoyxYullNf2FqeOQ67SY80VtSN1/QkQbmM9afP9 1CaPYVVSxODq78ZPPHuAhkK4FITiPLwvx5ZvL+Dh8sZqgNwzw6QhunfPD9+x6G6XS0MZ dw== Original-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 31f91dvnt0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 05 Jun 2020 20:39:31 +0000 Original-Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 055KcAWL163878 for ; Fri, 5 Jun 2020 20:39:30 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3020.oracle.com with ESMTP id 31f927prv4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 05 Jun 2020 20:39:30 +0000 Original-Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 055KdTnW031525 for ; Fri, 5 Jun 2020 20:39:30 GMT X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.5005.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9643 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 mlxlogscore=999 bulkscore=0 suspectscore=1 adultscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006050153 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9643 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 bulkscore=0 clxscore=1015 cotscore=-2147483648 malwarescore=0 adultscore=0 priorityscore=1501 suspectscore=1 phishscore=0 spamscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006050153 Received-SPF: pass client-ip=141.146.126.78; envelope-from=drew.adams@oracle.com; helo=aserp2120.oracle.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/05 16:39:32 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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:181583 Archived-At: 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). This is wrong (incomplete). It disables the mode if the `prefix-numeric-value' of ARG <=3D 0, not if ARG is a non-positive integer. The code does this: (prefix-numeric-value arg). So if you pass the symbol `-' as ARG then the mode is disabled. 1. The (default) doc string produced by `define-minor-mode' says this: If called from Lisp, enable the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'. Again, this is wrong (incomplete). It doesn't say that if ARG is non-nil other than `toggle' then disable the mode if the `prefix-numeric-value' of ARG <=3D 0, and enable it if the `prefix-numeric-value' of ARG > 0. 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. Again, this is wrong (incomplete). * It says nothing about how the mode is disabled when called from Lisp. It should say that an ARG whose `prefix-numeric-value' is non-positive disables the mode. * It should say that an ARG whose `prefix-numeric-value' is non-positive enables the mode. In GNU Emacs 26.3 (build 1, x86_64-w64-mingw32) of 2019-08-29 Repository revision: 96dd0196c28bc36779584e47fffcca433c9309cd Windowing system distributor `Microsoft Corp.', version 10.0.18362 Configured using: `configure --without-dbus --host=3Dx86_64-w64-mingw32 --without-compress-install 'CFLAGS=3D-O2 -static -g3''