From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#24706: 26.0.50; Minor mode functions should do strict argument type checking Date: Sun, 16 Oct 2016 09:12:14 -0700 (PDT) Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1476634401 32746 195.159.176.226 (16 Oct 2016 16:13:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 16 Oct 2016 16:13:21 +0000 (UTC) To: Philipp Stephani , 24706@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 16 18:13:17 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvo3k-0007Ip-VQ for geb-bug-gnu-emacs@m.gmane.org; Sun, 16 Oct 2016 18:13:13 +0200 Original-Received: from localhost ([::1]:56965 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvo3m-0007AE-T2 for geb-bug-gnu-emacs@m.gmane.org; Sun, 16 Oct 2016 12:13:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvo3d-000792-SW for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2016 12:13:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvo3a-0003tb-Lk for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2016 12:13:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57133) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bvo3a-0003sy-II for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2016 12:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bvo3a-0004X1-7w for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2016 12:13: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: Sun, 16 Oct 2016 16:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24706 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24706-submit@debbugs.gnu.org id=B24706.147663434717369 (code B ref 24706); Sun, 16 Oct 2016 16:13:02 +0000 Original-Received: (at 24706) by debbugs.gnu.org; 16 Oct 2016 16:12:27 +0000 Original-Received: from localhost ([127.0.0.1]:35087 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvo31-0004W5-BT for submit@debbugs.gnu.org; Sun, 16 Oct 2016 12:12:27 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:22698) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvo2z-0004Vs-JN for 24706@debbugs.gnu.org; Sun, 16 Oct 2016 12:12:25 -0400 Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u9GGCIP9018471 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2016 16:12:18 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id u9GGCHvA018235 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 16 Oct 2016 16:12:18 GMT Original-Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u9GGCFCc009354; Sun, 16 Oct 2016 16:12:16 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] X-Source-IP: userv0022.oracle.com [156.151.31.74] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:124551 Archived-At: > (define-minor-mode foo-mode nil) > its docstring will be >=20 > "Toggle Foo mode on or off. > With a prefix argument ARG, enable Foo mode if ARG is > positive, and disable it otherwise. If called from Lisp, enable > the mode if ARG is omitted or nil, and toggle it if ARG is =E2=80=98toggl= e=E2=80=99." >=20 > This appears to indicate that (foo-mode 'banana) > should disable foo-mode, but it enables it. No, it does not suggest that. But to be clearer, it should probably explicitly address the non-nil and non-`toggle' case, like so: If called from Lisp, enable the mode if ARG is omitted or nil, toggle it if ARG is =E2=80=98toggle=E2=80=99, and disable it if ARG = is any other non-nil value. (And place the Lisp description in a separate paragraph from the interactive description.) > I think minor modes should simply not allow anything but > integers and 'toggle for ARG, avoiding this confusion. Why? There is no confusion possible, once the doc string=20 explicitly speaks about all possible argument values. Why would you change the behavior, instead of just clarifying the doc?