From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#24706: 26.0.50; Minor mode functions should do strict argument type checking Date: Sun, 16 Oct 2016 12:31:51 -0400 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 1476635553 12102 195.159.176.226 (16 Oct 2016 16:32:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 16 Oct 2016 16:32:33 +0000 (UTC) Cc: 24706@debbugs.gnu.org, Philipp Stephani To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 16 18:32:29 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 1bvoME-0001TJ-FL for geb-bug-gnu-emacs@m.gmane.org; Sun, 16 Oct 2016 18:32:18 +0200 Original-Received: from localhost ([::1]:57034 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvoMG-0004gw-FW for geb-bug-gnu-emacs@m.gmane.org; Sun, 16 Oct 2016 12:32:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48220) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvoM4-0004fn-2R for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2016 12:32:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvoLz-0003bb-Gy for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2016 12:32:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57175) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bvoLz-0003bX-DO for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2016 12:32:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bvoLz-00050Z-6G for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2016 12:32:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 16 Oct 2016 16:32:03 +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.147663551919226 (code B ref 24706); Sun, 16 Oct 2016 16:32:03 +0000 Original-Received: (at 24706) by debbugs.gnu.org; 16 Oct 2016 16:31:59 +0000 Original-Received: from localhost ([127.0.0.1]:35130 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvoLu-000502-SM for submit@debbugs.gnu.org; Sun, 16 Oct 2016 12:31:59 -0400 Original-Received: from mail-oi0-f51.google.com ([209.85.218.51]:33510) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvoLt-0004zq-KY for 24706@debbugs.gnu.org; Sun, 16 Oct 2016 12:31:58 -0400 Original-Received: by mail-oi0-f51.google.com with SMTP id y2so188852843oie.0 for <24706@debbugs.gnu.org>; Sun, 16 Oct 2016 09:31:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=NJO/zDCP4lFK/Xnl9O7/fW4mS8o7QfVl5u5KH1gL7sU=; b=ELSu5EEB7SQ1dMqMRtYItxO8ev+iou1aXTWleWBFI5Eqk0WovZ2NFbc5sVjvx/Y9Bo AcK5AHq6bhtjKAP/W5MgAIexfm1yv1Ft7jpMbXGaxChITOihr9srpt2m/RygtUGqgsR0 bvFlaqXdLNxhDjZLKV9T9+gtacs454w3Cqm9QDcuyNVha9UBSWOR9/7B8NqhsQlbAteM y7v7r0xbfI44m15X7vs4REPYmUmib9tup6RAp7KNmdRUPhZCrjhfab7sv3hJ9xmrH/5+ PXBXIeHIx8V7MKwfqCkdE+UWgkbAPtCHzrDXqS2s09bClk5Ajhds9Gdt7scgPnEvISQu ZZzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=NJO/zDCP4lFK/Xnl9O7/fW4mS8o7QfVl5u5KH1gL7sU=; b=OshuyBpQHMRxBl/RIcMIIbIpSLDaoJXnk3b7JFRPIzrDZU7o3ewT5TdnWLgECN0DSD EXrqsMBcnjDeGp0xQEBR1YERCZKq8DeX69D6DJKbaUHdPDdD5J5khbrDjhFKHqorU5wI mTDjzskyNvyBoCocQkcQyGawktZwdcnY+8zjSW3abjt0oc9MNFq2CdLoxvdVEu6Q4mAW tT3fpV2cRLTECYVPaPAIDb9EMP2TKGXnxL9iRa0dtlI2Gup2+ShHyxBylyh1Ei6bkXW3 6ixwWt8HdKrTmgcNXbGgmAyBkYIVv6vvV4r9nwajL6+mRtS47Cv3Ih3qpgSLkSm13SPO zsGw== X-Gm-Message-State: AA6/9Rl3JLT52eZ6ut+SCaHe3jVWl7YF+QcoSIkfVI6NNNvXYOjIzpzLdISk4eMko5UOs6V6mT2m52ZrM+jftw== X-Received: by 10.202.234.69 with SMTP id i66mr14431792oih.38.1476635512131; Sun, 16 Oct 2016 09:31:52 -0700 (PDT) Original-Received: by 10.157.29.239 with HTTP; Sun, 16 Oct 2016 09:31:51 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: WxrVGuNDytYSei74VxApn3fEIik 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:124553 Archived-At: On Sun, Oct 16, 2016 at 12:12 PM, Drew Adams wrote: >> (define-minor-mode foo-mode nil) >> its docstring will be >> >> "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=98togg= le=E2=80=99." >> >> 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 AR= G is > any other non-nil value. If the Lisp description is meant to be exhaustive by itself, we should cover the numeric case too: If called from Lisp, enable the mode if ARG is omitted, nil, or a positive number; toggle it if ARG is `toggle'; and disable it otherwise.