From unknown Sat Aug 16 18:09:55 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#24706 <24706@debbugs.gnu.org> To: bug#24706 <24706@debbugs.gnu.org> Subject: Status: 26.0.50; Minor mode functions should do strict argument type checking Reply-To: bug#24706 <24706@debbugs.gnu.org> Date: Sun, 17 Aug 2025 01:09:55 +0000 retitle 24706 26.0.50; Minor mode functions should do strict argument type = checking reassign 24706 emacs submitter 24706 Philipp Stephani severity 24706 wishlist thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 16 11:48:42 2016 Received: (at submit) by debbugs.gnu.org; 16 Oct 2016 15:48:42 +0000 Received: from localhost ([127.0.0.1]:35036 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvng2-0003xe-4B for submit@debbugs.gnu.org; Sun, 16 Oct 2016 11:48:42 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51556) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvng0-0003xN-V8 for submit@debbugs.gnu.org; Sun, 16 Oct 2016 11:48:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvnfu-0004e1-Ps for submit@debbugs.gnu.org; Sun, 16 Oct 2016 11:48:35 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:46273) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bvnfu-0004dx-Ma for submit@debbugs.gnu.org; Sun, 16 Oct 2016 11:48:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42527) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvnft-0000yN-BM for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2016 11:48:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvnfq-0004dW-7m for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2016 11:48:33 -0400 Received: from mail-lf0-x22d.google.com ([2a00:1450:4010:c07::22d]:33691) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bvnfp-0004dG-UN for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2016 11:48:30 -0400 Received: by mail-lf0-x22d.google.com with SMTP id x79so245204261lff.0 for ; Sun, 16 Oct 2016 08:48:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=upCABc9+aJxK1Nne1JCl4YXymcBn2MykgD+n/99Yw9U=; b=C64dLjJ0nAgFoMF5gKTffonm33W/DZIhnC3qFza/VRjs0Fc1WwDuSNq2msPRmOxj4V BWT4nK8lbt6eEEJS1lgRHNN1rSGfV7+ujJsiqhsXXvJ6lH/swfSB3EPBXsVjd9YmVy3F wJxOHhEm3aW7nO2FeUXSZjCarkW/fukmEj+ZSGy8buW8u0b0ZWuGsCI7ZeM2+x4JXgHy hsZURKIediHsf5Doetdekwt2j9usv8856yyrxd1pmcl6GnwnyCa6/TijvX/rIys4AwHx lHEhUHGPBYvAB86eGKsiIKF5GXkRgk5F2abT+d9ZjBLNbxj/QPLf1YbVWLB9Gk9cTitK KheQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=upCABc9+aJxK1Nne1JCl4YXymcBn2MykgD+n/99Yw9U=; b=mXX1wJs9CvyRFVJ9AhKusknpND8s5jX+wNa24Zd4MWteZSLrFzL12EGfQyhufadJ6Z xT7YLVlxQnBnw1ec6qMd6teu0vgtYzmabtJhoREAt61dZBOqC3v7b/31Epwoi0LLYlzq y4p9Gn87k76lzia56+Sgx7paA/2Ygtw2YQUg9RtI1yMuCu2h0NQFnWyAegGi6mEmaF6G oValkMVwZbZDYk9027AUcSW1qlbi2niJGfj5LuqdDkj/u2wk6n39FIb6nbdtGQb/jffD ulWkfVwzqPVQ2ObKpvn36BTH7JpYxsUzF+tsrPJQkj/YKLKvk0vI17cUNvXqVJ4PpRmr kGLw== X-Gm-Message-State: AA6/9RnhdUVp7Ipcm9QOyq9+nGtQbhiivCKhSlDDEzPUa1G4/Rh4v4Wr22UKo1oRmvNYrw== X-Received: by 10.28.100.139 with SMTP id y133mr1648991wmb.105.1476632907593; Sun, 16 Oct 2016 08:48:27 -0700 (PDT) Received: from p (46.128.198.151.dynamic.cablesurf.de. [46.128.198.151]) by smtp.gmail.com with ESMTPSA id ux6sm32120726wjb.18.2016.10.16.08.48.26 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 16 Oct 2016 08:48:27 -0700 (PDT) From: Philipp Stephani To: bug-gnu-emacs@gnu.org Subject: 26.0.50; Minor mode functions should do strict argument type checking Date: Sun, 16 Oct 2016 17:45:58 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.8 (---) X-Debbugs-Envelope-To: submit 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.8 (---) After defining a minor mode with (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=98toggle= =E2=80=99." This appears to indicate that (foo-mode 'banana) should disable foo-mode, but it enables it. I think minor modes should simply not allow anything but integers and 'toggle for ARG, avoiding this confusion. In GNU Emacs 26.0.50.3 (x86_64-apple-darwin16.0.0, NS appkit-1504.00 Versio= n 10.12 (Build 16A323)) of 2016-10-16 built on p Repository revision: cf566b46a6cf85c6d54d0b0db80e32ed6ae8d1ca Windowing system distributor 'Apple', version 10.3.1504 Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Making completion list... Configured using: 'configure --with-modules --enable-checking --enable-check-lisp-object-type --without-xml2' Configured features: RSVG IMAGEMAGICK DBUS NOTIFY ACL GNUTLS ZLIB TOOLKIT_SCROLL_BARS NS MODULES Important settings: value of $LANG: de_DE.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message subr-x puny seq byte-opt gv bytecomp byte-compile cl-extra help-mode cconv cl-loaddefs pcase cl-lib dired dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win ucs-normalize term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind kqueue cocoa ns multi-tty make-network-process emacs) Memory information: ((conses 16 206734 11456) (symbols 48 20333 0) (miscs 40 50 157) (strings 32 18351 5209) (string-bytes 1 593891) (vectors 16 35291) (vector-slots 8 676180 5448) (floats 8 183 64) (intervals 56 219 0) (buffers 976 12)) From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 16 12:12:27 2016 Received: (at 24706) by debbugs.gnu.org; 16 Oct 2016 16:12:27 +0000 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 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 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 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 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 MIME-Version: 1.0 Message-ID: Date: Sun, 16 Oct 2016 09:12:14 -0700 (PDT) From: Drew Adams To: Philipp Stephani , 24706@debbugs.gnu.org Subject: RE: bug#24706: 26.0.50; Minor mode functions should do strict argument type checking References: 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)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 24706 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.6 (--) > (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? From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 16 12:31:59 2016 Received: (at 24706) by debbugs.gnu.org; 16 Oct 2016 16:31:59 +0000 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 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 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) MIME-Version: 1.0 Received: by 10.157.29.239 with HTTP; Sun, 16 Oct 2016 09:31:51 -0700 (PDT) In-Reply-To: References: From: Noam Postavsky Date: Sun, 16 Oct 2016 12:31:51 -0400 X-Google-Sender-Auth: WxrVGuNDytYSei74VxApn3fEIik Message-ID: Subject: Re: bug#24706: 26.0.50; Minor mode functions should do strict argument type checking To: Drew Adams Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 24706 Cc: 24706@debbugs.gnu.org, Philipp Stephani 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.0 (/) 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. From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 16 12:49:43 2016 Received: (at 24706) by debbugs.gnu.org; 16 Oct 2016 16:49:43 +0000 Received: from localhost ([127.0.0.1]:35186 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvod5-0005RR-E1 for submit@debbugs.gnu.org; Sun, 16 Oct 2016 12:49:43 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:27786) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvod3-0005RF-LD for 24706@debbugs.gnu.org; Sun, 16 Oct 2016 12:49:41 -0400 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 u9GGnZ9J008634 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2016 16:49:36 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id u9GGnYWY024773 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2016 16:49:35 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u9GGnXVk028145; Sun, 16 Oct 2016 16:49:34 GMT MIME-Version: 1.0 Message-ID: <75ec3189-08f4-455f-bfa6-f21e1d0454d6@default> Date: Sun, 16 Oct 2016 09:49:32 -0700 (PDT) From: Drew Adams To: Noam Postavsky Subject: RE: bug#24706: 26.0.50; Minor mode functions should do strict argument type checking References: 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)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 24706 Cc: 24706@debbugs.gnu.org, Philipp Stephani 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.6 (--) > >> (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=98to= ggle=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 = ARG is > > any other non-nil value. >=20 > If the Lisp description is meant to be exhaustive by itself, we should > cover the numeric case too: >=20 > 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. Yes, and anyway what I wrote was wrong. The doc string of `define-minor-mode' has it right, as does your suggestion: 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). I'd suggest the same order as in the `define-minor-mode' doc: When called from Lisp: * Toggle the mode if ARG is `toggle'. * Disable it if ARG is a non-positive integer. * Enable it if ARG is anything else. =20 From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 16 14:01:26 2016 Received: (at 24706) by debbugs.gnu.org; 16 Oct 2016 18:01:26 +0000 Received: from localhost ([127.0.0.1]:35377 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvpkT-0007CI-KL for submit@debbugs.gnu.org; Sun, 16 Oct 2016 14:01:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45197) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvpkS-0007C3-Bs for 24706@debbugs.gnu.org; Sun, 16 Oct 2016 14:01:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvpkM-0007MS-HS for 24706@debbugs.gnu.org; Sun, 16 Oct 2016 14:01:19 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60463) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvpkJ-0007JJ-QA; Sun, 16 Oct 2016 14:01:15 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2641 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bvpkI-0000Nd-Ut; Sun, 16 Oct 2016 14:01:15 -0400 Date: Sun, 16 Oct 2016 21:01:14 +0300 Message-Id: <83oa2kyxzp.fsf@gnu.org> From: Eli Zaretskii To: Noam Postavsky In-reply-to: (message from Noam Postavsky on Sun, 16 Oct 2016 12:31:51 -0400) Subject: Re: bug#24706: 26.0.50; Minor mode functions should do strict argument type checking References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.3 (-----) X-Debbugs-Envelope-To: 24706 Cc: 24706@debbugs.gnu.org, p.stephani2@gmail.com, drew.adams@oracle.com 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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.3 (-----) > From: Noam Postavsky > Date: Sun, 16 Oct 2016 12:31:51 -0400 > Cc: 24706@debbugs.gnu.org, Philipp Stephani > > > 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 ‘toggle’, and disable it if ARG 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. There's a magic word 'also", which should allow us to avoid repetitions. From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 16 14:13:20 2016 Received: (at 24706) by debbugs.gnu.org; 16 Oct 2016 18:13:20 +0000 Received: from localhost ([127.0.0.1]:35405 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvpvz-0007T8-Mi for submit@debbugs.gnu.org; Sun, 16 Oct 2016 14:13:19 -0400 Received: from mail-lf0-f49.google.com ([209.85.215.49]:36197) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvpvx-0007St-Tz for 24706@debbugs.gnu.org; Sun, 16 Oct 2016 14:13:18 -0400 Received: by mail-lf0-f49.google.com with SMTP id b75so244842538lfg.3 for <24706@debbugs.gnu.org>; Sun, 16 Oct 2016 11:13:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=Z660pfWTBfbJ2WTS+cBLTN8fWydm12824lyeMvlNm+s=; b=UdKAVayGZS6A3mVWaG6tG0PZc341VMpLk76jRvA9aEYqi2tp10wBpF+G35p4NPIHp4 E/rI5C97oOVDtnkIqW0AZuiUXn7VaRdSJbwjKyZQCTLX/Y7ObI83Tx6peZGcQFMhBhMj ll/WVloEbMdJUGT+XLChMs9bknPlZvMYkrW40eO+9DS8wmna/SJsT4YTkOchaiutaaX4 YjgKD0wy3xvN4lT32DcTi+Vg2V6YuBwSB+VKfd7IqnpOFcGwcSLCC90tzbTX0iFFPt7s 1AECbONs3PxycU54rggD/NvYdRq76QBuNI8L/0btraQs/DgZZ7dIUG0H2Voq6NxW0Z1v AwFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=Z660pfWTBfbJ2WTS+cBLTN8fWydm12824lyeMvlNm+s=; b=aMA7goKDwMN5AjKgWq9igf1FPKhHC/hOVo/NGqs+5U3A2d4fwrWsIeuOyv/IbV0q2e W2cHgcEolM3nKQiuJoqaNOTsDOgYW/czO0VQ9U7g57slQm9vv/smINILFkK7RIoC8LoE k4ozjN76YLXINawdCrF6IuV0tj3ifOYBpObN77UDV/RHNQFbEckzFIAnAHSSG2edYW7A NLeF0B32VO9WRV/EtKw3EB5a8v9YKDNKqt7cc4uW3NSziBqIwAZgkhsyS+4ldIBmb5d0 GQs0EfQv/9nceKQtTN5mf/yvQqNn5ApUmKu+E9wkXTUMvoMrqJ1IGjGj0C7v6nybK3gH yJGw== X-Gm-Message-State: AA6/9RkQp2xbfhEma/SwZwp/crQLppm2B/rzOxq8jezP0RCnEY1TWpQ0N1NqOwR+EDX7KuroSnleeOeNoEVe/w== X-Received: by 10.28.210.1 with SMTP id j1mr6223420wmg.86.1476641591974; Sun, 16 Oct 2016 11:13:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Philipp Stephani Date: Sun, 16 Oct 2016 18:13:01 +0000 Message-ID: Subject: Re: bug#24706: 26.0.50; Minor mode functions should do strict argument type checking To: Drew Adams , 24706@debbugs.gnu.org Content-Type: multipart/alternative; boundary=001a114699d08ce224053eff699f X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 24706 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.0 (/) --001a114699d08ce224053eff699f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Drew Adams schrieb am So., 16. Okt. 2016 um 18:12 Uhr: > > (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=98tog= gle=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. > > (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 > explicitly speaks about all possible argument values. > > Why would you change the behavior, instead of just clarifying > the doc? > I generally prefer the behavior to be as strict as possible. Consider (foo-mode 'disable) If you read such code, do you assume that this enables foo-mode? However, in this case I guess it's too late, and fixing the documentation is indeed more appropriate. BTW, the Elisp manual has the same issue: The mode command should accept one optional argument. If called interactively with no prefix argument, it should toggle the mode (i.e., enable if it is disabled, and disable if it is enabled). If called interactively with a prefix argument, it should enable the mode if the argument is positive and disable it otherwise. If the mode command is called from Lisp (i.e., non-interactively), it should enable the mode if the argument is omitted or =E2=80=98nil= =E2=80=99; it should toggle the mode if the argument is the symbol =E2=80=98toggle= =E2=80=99; otherwise it should treat the argument in the same way as for an interactive call with a numeric prefix argument, as described above. Probably this should be reworded so that the Lisp case doesn't refer to the interactive case at all. Making the documentation obvious is more important than avoiding repetition. --001a114699d08ce224053eff699f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Drew A= dams <drew.adams@oracle.com= > schrieb am So., 16. Okt. 2016 um 18:12=C2=A0Uhr:
> (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.=C2=A0 If called from Lisp, enable<= br class=3D"gmail_msg"> > the mode if ARG is omitted or nil, and toggle it if ARG is =E2=80=98to= ggle=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.=C2=A0 But to be clearer, it should
probably explicitly address the non-nil and non-`toggle' case,
like so:

=C2=A0 If called from Lisp, enable the mode if ARG is omitted or
=C2=A0 nil, toggle it if ARG is =E2=80=98toggle=E2=80=99, and disable it if= ARG is
=C2=A0 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?=C2=A0 There is no confusion possible, once the doc string
explicitly speaks about all possible argument values.

Why would you change the behavior, instead of just clarifying
the doc?

I generall= y prefer the behavior to be as strict as possible. Consider
(foo-= mode 'disable)
If you read such code, do you assume that this= enables foo-mode?
However, in this case I guess it's too lat= e, and fixing the documentation is indeed more appropriate. BTW, the Elisp = manual has the same issue:

=C2=A0 =C2=A0 =C2= =A0The mode command should accept one optional argument.=C2=A0 If called
=C2=A0 =C2=A0 =C2=A0interactively with no prefix argument, it shoul= d toggle the mode
=C2=A0 =C2=A0 =C2=A0(i.e., enable if it is disa= bled, and disable if it is enabled).=C2=A0 If
=C2=A0 =C2=A0 =C2= =A0called interactively with a prefix argument, it should enable the
<= div>=C2=A0 =C2=A0 =C2=A0mode if the argument is positive and disable it oth= erwise.

=C2=A0 =C2=A0 =C2=A0If the mode command is= called from Lisp (i.e., non-interactively),
=C2=A0 =C2=A0 =C2=A0= it should enable the mode if the argument is omitted or =E2=80=98nil=E2=80= =99; it
=C2=A0 =C2=A0 =C2=A0should toggle the mode if the argumen= t is the symbol =E2=80=98toggle=E2=80=99;
=C2=A0 =C2=A0 =C2=A0oth= erwise it should treat the argument in the same way as for an
=C2= =A0 =C2=A0 =C2=A0interactive call with a numeric prefix argument, as descri= bed
=C2=A0 =C2=A0 =C2=A0above.

Pro= bably this should be reworded so that the Lisp case doesn't refer to th= e interactive case at all. Making the documentation obvious is more importa= nt than avoiding repetition.
--001a114699d08ce224053eff699f-- From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 16 14:25:27 2016 Received: (at 24706) by debbugs.gnu.org; 16 Oct 2016 18:25:27 +0000 Received: from localhost ([127.0.0.1]:35429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvq7i-0007l3-Un for submit@debbugs.gnu.org; Sun, 16 Oct 2016 14:25:27 -0400 Received: from mail-lf0-f49.google.com ([209.85.215.49]:36147) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvq7g-0007kn-II for 24706@debbugs.gnu.org; Sun, 16 Oct 2016 14:25:25 -0400 Received: by mail-lf0-f49.google.com with SMTP id b75so245323193lfg.3 for <24706@debbugs.gnu.org>; Sun, 16 Oct 2016 11:25:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=Y1YChflrnW4B0fXToS164P/oQRaVb5swGlboMb1ZOOo=; b=gcvnD9KrAUnj3JdGTKXPkaoDTrFy7KO29bAq9ToDkxnYgesTB1on4iKTgrbDaSfYhg Z8aLye3kmYD8nXJ8LP7hHuYbyG6tMWVJmk6KvGw2NDtjKjwH3fQvfeqkprpcI0V2nTh3 DMawDN4Z6xWJnFx6dT0i9jgbajLauQTyVwpJ9WfeFJ532LDKlYlokg/gLsASYH63VLO4 LdfzglihzBx5ewu3ra38YHRH5wlRdMwVAC3mmeFhXfdj9AxJ0FIYdg000HjGQmv8wsZM 9+DhfOlbB+c327ahg0brPjZCn7gBwfIjcLm6kom1zJ7/NnMMINWVhXKcZH7xPSZcu7gZ 9tsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=Y1YChflrnW4B0fXToS164P/oQRaVb5swGlboMb1ZOOo=; b=a/haduEyRFjRjTLfMd/ybKxShP9ZwWZGEERLuOyWQqH2kIZQWWlKvAQE1GZtBOtRMk qc4v6t/Gp3MuPXShoh4QyQ5wv82WnrAqqefHpuC9MMfqq0G0e2CVVEW1xTo/6d9aa/6K pu3XXHkYAD9/Y5qehoQJJCUOtRtTxGmg2X0wqdIJGsSjKMJwUwDfVijVurw57Oju9Kxw Ibe8hspBwSM8B6bKKx6x22aR1Xt0aWS9p2tGrIKExexh2jklZOHqz1/rLLCNCtz7f9E7 PFWMN6fE1mGkjuD5/ebGM4BfJI9TBUwfQAIWcnntqCUFS+Xk9xzpEZNwOKDNE7gpkzM1 uA7Q== X-Gm-Message-State: AA6/9Rl+MJHKtQI4quo80b3K2/ezYOpNQ+TSPfbjDNfetY5DoS8/ycygMuQhIvZFjUbuQcNlW2ufAWfbnCLe8Q== X-Received: by 10.194.170.163 with SMTP id an3mr9357263wjc.73.1476642318673; Sun, 16 Oct 2016 11:25:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Philipp Stephani Date: Sun, 16 Oct 2016 18:25:08 +0000 Message-ID: Subject: Re: bug#24706: 26.0.50; Minor mode functions should do strict argument type checking To: Drew Adams , 24706@debbugs.gnu.org Content-Type: multipart/mixed; boundary=089e0122f07cdd8786053eff9441 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 24706 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.0 (/) --089e0122f07cdd8786053eff9441 Content-Type: multipart/alternative; boundary=089e0122f07cdd8783053eff943f --089e0122f07cdd8783053eff943f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Philipp Stephani schrieb am So., 16. Okt. 2016 um 20:13 Uhr: > Drew Adams schrieb am So., 16. Okt. 2016 um > 18:12 Uhr: > > > (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=98tog= gle=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. > > (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 > explicitly speaks about all possible argument values. > > Why would you change the behavior, instead of just clarifying > the doc? > > > I generally prefer the behavior to be as strict as possible. Consider > (foo-mode 'disable) > If you read such code, do you assume that this enables foo-mode? > However, in this case I guess it's too late, and fixing the documentation > is indeed more appropriate. BTW, the Elisp manual has the same issue: > > The mode command should accept one optional argument. If called > interactively with no prefix argument, it should toggle the mode > (i.e., enable if it is disabled, and disable if it is enabled). If > called interactively with a prefix argument, it should enable the > mode if the argument is positive and disable it otherwise. > > If the mode command is called from Lisp (i.e., non-interactively), > it should enable the mode if the argument is omitted or =E2=80=98nil= =E2=80=99; it > should toggle the mode if the argument is the symbol =E2=80=98toggle= =E2=80=99; > otherwise it should treat the argument in the same way as for an > interactive call with a numeric prefix argument, as described > above. > > Probably this should be reworded so that the Lisp case doesn't refer to > the interactive case at all. Making the documentation obvious is more > important than avoiding repetition. > Attached a patch that uses the wording from `define-minor-mode'. --089e0122f07cdd8783053eff943f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Philip= p Stephani <p.stephani2@gmail.c= om> schrieb am So., 16. Okt. 2016 um 20:13=C2=A0Uhr:
Drew Adams <= ;drew.adams@oracle.com> schrieb am So., 16. Okt. 2016 um 18:12= =C2=A0Uhr:
> (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.=C2=A0 If called from Lisp, enable<= br class=3D"gmail_msg"> > the mode if ARG is omitted or nil, and toggle it if ARG is =E2=80=98to= ggle=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.=C2=A0 But to be clearer, it should
probably explicitly address the non-nil and non-`toggle' case,
like so:

=C2=A0 If called from Lisp, enable the mode if ARG is omitted or
=C2=A0 nil, toggle it if ARG is =E2=80=98toggle=E2=80=99, and disable it if= ARG is
=C2=A0 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?=C2=A0 There is no confusion possible, once the doc string
explicitly speaks about all possible argument values.

Why would you change the behavior, instead of just clarifying
the doc?

<= div class=3D"gmail_quote gmail_msg">
I generally pr= efer the behavior to be as strict as possible. Consider
(foo-mode 'disable)
If you rea= d such code, do you assume that this enables foo-mode?
However, in this case I guess it's too late, and fixing the d= ocumentation is indeed more appropriate. BTW, the Elisp manual has the same= issue:

=C2=A0 =C2=A0 =C2=A0The mode com= mand should accept one optional argument.=C2=A0 If called
=C2=A0 =C2=A0 =C2=A0interactively with no prefix argument, i= t should toggle the mode
=C2=A0 =C2=A0 =C2=A0= (i.e., enable if it is disabled, and disable if it is enabled).=C2=A0 If
=C2=A0 =C2=A0 =C2=A0called interactively with a= prefix argument, it should enable the
=C2=A0= =C2=A0 =C2=A0mode if the argument is positive and disable it otherwise.

=C2=A0 =C2=A0 =C2=A0If the mode command is called from Lisp (i.e., = non-interactively),
=C2=A0 =C2=A0 =C2=A0it sh= ould enable the mode if the argument is omitted or =E2=80=98nil=E2=80=99; i= t
=C2=A0 =C2=A0 =C2=A0should toggle the mode = if the argument is the symbol =E2=80=98toggle=E2=80=99;
=C2=A0 =C2=A0 =C2=A0otherwise it should treat the argument in th= e same way as for an
=C2=A0 =C2=A0 =C2=A0inte= ractive call with a numeric prefix argument, as described
=C2=A0 =C2=A0 =C2=A0above.

Probably this sho= uld be reworded so that the Lisp case doesn't refer to the interactive = case at all. Making the documentation obvious is more important than avoidi= ng repetition.

Attached a= patch that uses the wording from `define-minor-mode'.=C2=A0
--089e0122f07cdd8783053eff943f-- --089e0122f07cdd8786053eff9441 Content-Type: text/plain; charset=US-ASCII; name="0001-Clarify-the-behavior-of-minor-mode-commands.txt" Content-Disposition: attachment; filename="0001-Clarify-the-behavior-of-minor-mode-commands.txt" Content-Transfer-Encoding: base64 Content-ID: <157cebd4a443590168e1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ZCBlYXN5LW1tb2RlLXRlc3RzLS1tb2RlKQorICAgIChlYXN5LW1tb2RlLXRlc3RzLS1tb2RlICd0 b2dnbGUpCisgICAgKHNob3VsZC1ub3QgZWFzeS1tbW9kZS10ZXN0cy0tbW9kZSkpKQorCisoZXJ0 LWRlZnRlc3QgZWFzeS1tbW9kZS10ZXN0cy0tbW9kZWZ1bi1vZmYgKCkKKyAgKGxldCAoKGVhc3kt bW1vZGUtdGVzdHMtLW1vZGUgbmlsKSkKKyAgICAoZWFzeS1tbW9kZS10ZXN0cy0tbW9kZSAnb2Zm KQorICAgIChzaG91bGQgZWFzeS1tbW9kZS10ZXN0cy0tbW9kZSkpKQorCisoZXJ0LWRlZnRlc3Qg ZWFzeS1tbW9kZS10ZXN0cy0tbW9kZWZ1bi10ICgpCisgIChsZXQgKChlYXN5LW1tb2RlLXRlc3Rz LS1tb2RlIG5pbCkpCisgICAgKGVhc3ktbW1vZGUtdGVzdHMtLW1vZGUgdCkKKyAgICAoc2hvdWxk IGVhc3ktbW1vZGUtdGVzdHMtLW1vZGUpKSkKKworOzs7IGVhc3ktbW1vZGUtdGVzdHMuZWwgZW5k cyBoZXJlCi0tIAoyLjEwLjEKCg== --089e0122f07cdd8786053eff9441-- From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 16 14:51:21 2016 Received: (at 24706) by debbugs.gnu.org; 16 Oct 2016 18:51:21 +0000 Received: from localhost ([127.0.0.1]:35455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvqWn-0008Nj-F5 for submit@debbugs.gnu.org; Sun, 16 Oct 2016 14:51:21 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51597) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvqWk-0008NV-5A for 24706@debbugs.gnu.org; Sun, 16 Oct 2016 14:51:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvqWb-0002E8-Qa for 24706@debbugs.gnu.org; Sun, 16 Oct 2016 14:51:12 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60776) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvqWb-0002E2-Mn; Sun, 16 Oct 2016 14:51:09 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2697 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bvqWa-0007DA-V7; Sun, 16 Oct 2016 14:51:09 -0400 Date: Sun, 16 Oct 2016 21:51:08 +0300 Message-Id: <83mvi4yvoj.fsf@gnu.org> From: Eli Zaretskii To: Philipp Stephani In-reply-to: (message from Philipp Stephani on Sun, 16 Oct 2016 18:25:08 +0000) Subject: Re: bug#24706: 26.0.50; Minor mode functions should do strict argument type checking References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.3 (-----) X-Debbugs-Envelope-To: 24706 Cc: 24706@debbugs.gnu.org, drew.adams@oracle.com 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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.3 (-----) > From: Philipp Stephani > Date: Sun, 16 Oct 2016 18:25:08 +0000 > > Attached a patch that uses the wording from `define-minor-mode'. The patch for the ELisp manual simply rearranges the same words, so it's not clear to me why we would prefer it to what's already there. As for the doc string, please avoid repetition, it's confusing. I suggested to describe the additional features when the mode is called from Lisp by using the word "also". Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 16 14:54:07 2016 Received: (at 24706) by debbugs.gnu.org; 16 Oct 2016 18:54:07 +0000 Received: from localhost ([127.0.0.1]:35459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvqZS-0008Ro-SA for submit@debbugs.gnu.org; Sun, 16 Oct 2016 14:54:07 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52176) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvqZS-0008RL-3C for 24706@debbugs.gnu.org; Sun, 16 Oct 2016 14:54:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvqZJ-0003Pi-VH for 24706@debbugs.gnu.org; Sun, 16 Oct 2016 14:54:01 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvqZJ-0003Pc-Rf; Sun, 16 Oct 2016 14:53:57 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2701 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bvqZI-0007Oy-VB; Sun, 16 Oct 2016 14:53:57 -0400 Date: Sun, 16 Oct 2016 21:53:56 +0300 Message-Id: <83lgxoyvjv.fsf@gnu.org> From: Eli Zaretskii To: Philipp Stephani In-reply-to: (message from Philipp Stephani on Sun, 16 Oct 2016 18:13:01 +0000) Subject: Re: bug#24706: 26.0.50; Minor mode functions should do strict argument type checking References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.3 (-----) X-Debbugs-Envelope-To: 24706 Cc: 24706@debbugs.gnu.org, drew.adams@oracle.com 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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.3 (-----) > From: Philipp Stephani > Date: Sun, 16 Oct 2016 18:13:01 +0000 > > Why would you change the behavior, instead of just clarifying > the doc? > > I generally prefer the behavior to be as strict as possible. Let's not consider changing long-established behavior for purely theoretical or philosophical reasons. > Consider > (foo-mode 'disable) > If you read such code, do you assume that this enables foo-mode? It would be a silly thing to do, so it would be worth a bug report. However, I don't really believe someone in their right minds would do something like that. > However, in this case I guess it's too late, and fixing the documentation is indeed more appropriate. Exactly. > Probably this should be reworded so that the Lisp case doesn't refer to the interactive case at all. Making the > documentation obvious is more important than avoiding repetition. Sorry, I disagree. with the last sentence. Repetition is a source for confusion. From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 16 15:50:17 2016 Received: (at 24706) by debbugs.gnu.org; 16 Oct 2016 19:50:17 +0000 Received: from localhost ([127.0.0.1]:35546 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvrRp-0002yx-KG for submit@debbugs.gnu.org; Sun, 16 Oct 2016 15:50:17 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:49548) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvrRo-0002yl-8x for 24706@debbugs.gnu.org; Sun, 16 Oct 2016 15:50:16 -0400 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u9GJoASo018742 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2016 19:50:10 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u9GJoA7q023296 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2016 19:50:10 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u9GJo9Wd020575; Sun, 16 Oct 2016 19:50:09 GMT MIME-Version: 1.0 Message-ID: Date: Sun, 16 Oct 2016 12:50:06 -0700 (PDT) From: Drew Adams To: Philipp Stephani , 24706@debbugs.gnu.org Subject: RE: bug#24706: 26.0.50; Minor mode functions should do strict argument type checking References: 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)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 24706 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.6 (--) >> Why would you change the behavior, instead of just clarifying >> the doc? > > I generally prefer the behavior to be as strict as possible. > Consider (foo-mode 'disable) If you read such code, do you > assume that this enables foo-mode? If I understand the function, then yes. But I agree that the doc could make the function behavior clearer. That example is akin to this: (deconst two 42) (+ 3 two) There are plenty of ways to write code that is perverse in terms of readability (whether or not it has the right behavior). > However, in this case I guess it's too late, and fixing the > documentation is indeed more appropriate. It would be a backward-incompatible change. (And I do not see any advantage to it. But others might disagree with me and agree with you.) From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 23 13:51:51 2017 Received: (at 24706) by debbugs.gnu.org; 23 Apr 2017 17:51:51 +0000 Received: from localhost ([127.0.0.1]:36725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2Lfr-0007kQ-9s for submit@debbugs.gnu.org; Sun, 23 Apr 2017 13:51:51 -0400 Received: from mail-wr0-f173.google.com ([209.85.128.173]:33816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2Lfp-0007kD-Ct for 24706@debbugs.gnu.org; Sun, 23 Apr 2017 13:51:49 -0400 Received: by mail-wr0-f173.google.com with SMTP id z109so79572680wrb.1 for <24706@debbugs.gnu.org>; Sun, 23 Apr 2017 10:51:49 -0700 (PDT) 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=1I9f91p+b+uWt8hmT/QwAztSjZkDKEA8SAKUhmauEr8=; b=T371Jdza9UVPhUP3sHM5NyqbJcvwCH1zsjQew4zk1ymBNb1B4h+8FL/+5+m+nWd5FD kUaIzbD/iT6lXTFkqyhES1Aav/45B0EexR4UZBrlSHu92J95/58rGHf7nJ9vzqLPmph7 5r6Cqwu5tEyBN1OJj75VvwcWbWUsHX/pAy4M5/Q80jDXN55OM5Qu9URIe+vABoha5Nsr y6zRK5IUbAB76r3mV2AWgRniGIelTTbt6ZvGlUogbEIiT+NylGea7w78A1OGuACILnP0 IepgbXDXzVus13dkRfSsTAbbsD1XRPD3YTWR+xV0I1kSqS6jqjiplDZancU1J4KaVAnF TLeA== 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=1I9f91p+b+uWt8hmT/QwAztSjZkDKEA8SAKUhmauEr8=; b=SPtGZFgomkEbRZ97DSwNPwS03Z4ocFA5Cw8P3+lMo6SmJkY2blA3lvA3FER+Zg3sDP WQMU2N4fjIi7VKg75lZ564Ye3T7AxJf33vDo5nqRsaL98IKNAT6NVCn3NiVZIx7Nybh8 4Ye2cM4mgjzyKXuuTFp+nrVjdmx1AF23H45CeddSy1XpN4AEkqPewce2suiW4tjf41Du yeH0w4Pq4XqNUebGYPITtaqLCmT5/froS9Fu+nsSs2bFXlleuigDRwT/gfahR5JdE5sL YKRIhhuE6c9GSwnA+Autw5VO18ZEvhVg7bhL4CG7EVTT4yLwjvpM2NiydNOwpVxcUm1d 37TQ== X-Gm-Message-State: AN3rC/6DPmSQz2AwRzwuB7EEeZbm5gf4QFX4i18lmuK3WnzNraaIp1sG r62wtVp5B+cxauylvdqYZp/+6Is27g== X-Received: by 10.223.165.138 with SMTP id g10mr3006690wrc.19.1492969903553; Sun, 23 Apr 2017 10:51:43 -0700 (PDT) MIME-Version: 1.0 References: <83mvi4yvoj.fsf@gnu.org> In-Reply-To: <83mvi4yvoj.fsf@gnu.org> From: Philipp Stephani Date: Sun, 23 Apr 2017 17:51:32 +0000 Message-ID: Subject: Re: bug#24706: 26.0.50; Minor mode functions should do strict argument type checking To: Eli Zaretskii Content-Type: multipart/alternative; boundary=94eb2c1cd99ec308f5054dd92404 X-Spam-Score: -2.5 (--) X-Debbugs-Envelope-To: 24706 Cc: 24706@debbugs.gnu.org, drew.adams@oracle.com 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.5 (--) --94eb2c1cd99ec308f5054dd92404 Content-Type: text/plain; charset=UTF-8 Eli Zaretskii schrieb am So., 16. Okt. 2016 um 20:51 Uhr: > > From: Philipp Stephani > > Date: Sun, 16 Oct 2016 18:25:08 +0000 > > > > Attached a patch that uses the wording from `define-minor-mode'. > > The patch for the ELisp manual simply rearranges the same words, so > it's not clear to me why we would prefer it to what's already there. > > As for the doc string, please avoid repetition, it's confusing. I > suggested to describe the additional features when the mode is called > from Lisp by using the word "also". > > I don't think there's any repetition or rearranging here. The key difference is that when called from Lisp with an argument that is neither nil nor an integer, the mode is also enabled. That isn't possible for interactive calls because the argument is always a number. Maybe something like "With a prefix argument ARG, enable the mode if ARG is positive, and disable it if ARG is negative or zero. Additionally, when called from Lisp, toggle the mode if ARG is the symbol `toggle' and interpret ARG as defined by `prefix-numeric-value' otherwise." (and then document the behavior of prefix-numeric-value) --94eb2c1cd99ec308f5054dd92404 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Eli Za= retskii <eliz@gnu.org> schrieb am= So., 16. Okt. 2016 um 20:51=C2=A0Uhr:
> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Sun, 16 Oct 2016 18:25:08 +0000
>
> Attached a patch that uses the wording from `define-minor-mode'.
The patch for the ELisp manual simply rearranges the same words, so
it's not clear to me why we would prefer it to what's already there= .

As for the doc string, please avoid repetition, it's confusing.=C2=A0 I=
suggested to describe the additional features when the mode is called
from Lisp by using the word "also".


I don't think there's any repe= tition or rearranging here. The key difference is that when called from Lis= p with an argument that is neither nil nor an integer, the mode is also ena= bled. That isn't possible for interactive calls because the argument is= always a number.
Maybe something like

&= quot;With a prefix argument ARG, enable the mode if ARG is positive, and di= sable it if ARG is negative or zero. Additionally, when called from Lisp, t= oggle the mode if ARG is the symbol `toggle' and interpret ARG as defin= ed by `prefix-numeric-value' otherwise."

= (and then document the behavior of prefix-numeric-value)
--94eb2c1cd99ec308f5054dd92404-- From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 26 07:27:15 2017 Received: (at 24706) by debbugs.gnu.org; 26 Apr 2017 11:27:15 +0000 Received: from localhost ([127.0.0.1]:40632 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3L6J-0007WA-0g for submit@debbugs.gnu.org; Wed, 26 Apr 2017 07:27:15 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48200) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3L6H-0007Vv-B8 for 24706@debbugs.gnu.org; Wed, 26 Apr 2017 07:27:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d3L68-0000VN-Ta for 24706@debbugs.gnu.org; Wed, 26 Apr 2017 07:27:08 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53312) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3L68-0000VJ-R5; Wed, 26 Apr 2017 07:27:04 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3766 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1d3L68-0004X4-34; Wed, 26 Apr 2017 07:27:04 -0400 Date: Wed, 26 Apr 2017 14:26:25 +0300 Message-Id: <83tw5bo1em.fsf@gnu.org> From: Eli Zaretskii To: Philipp Stephani In-reply-to: (message from Philipp Stephani on Sun, 23 Apr 2017 17:51:32 +0000) Subject: Re: bug#24706: 26.0.50; Minor mode functions should do strict argument type checking References: <83mvi4yvoj.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 24706 Cc: 24706@debbugs.gnu.org, drew.adams@oracle.com 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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Philipp Stephani > Date: Sun, 23 Apr 2017 17:51:32 +0000 > Cc: drew.adams@oracle.com, 24706@debbugs.gnu.org > > Eli Zaretskii schrieb am So., 16. Okt. 2016 um 20:51 Uhr: > > > From: Philipp Stephani > > Date: Sun, 16 Oct 2016 18:25:08 +0000 > > > > Attached a patch that uses the wording from `define-minor-mode'. > > The patch for the ELisp manual simply rearranges the same words, so > it's not clear to me why we would prefer it to what's already there. > > I don't think there's any repetition or rearranging here. Here's the ELisp manual part of your proposed change: If the mode command is called from Lisp (i.e., non-interactively), it -should enable the mode if the argument is omitted or @code{nil}; it -should toggle the mode if the argument is the symbol @code{toggle}; -otherwise it should treat the argument in the same way as for an -interactive call with a numeric prefix argument, as described above. +should toggle the mode if the argument is the symbol @code{toggle}; it +should disable the mode if the argument is a non-positive integer; +otherwise, e.g., if the argument is omitted or nil or a positive +integer, it should enable the mode. Don't you agree that it does little apart of re-shuffling the same words? > The key difference is that when called from Lisp with an > argument that is neither nil nor an integer, the mode is also enabled. Why would we want to require that? This subsection describes the conventions, it doesn't describe the effect of certain popular implementation of those conventions, because we don't really want to _require_ modes to behave in any way beyond the described behavior. > "With a prefix argument ARG, enable the mode if ARG is positive, and disable it if ARG is negative or zero. This is almost exactly the same as the current: With a prefix argument ARG, enable %s if ARG is positive, and disable it otherwise. > Additionally, when called from Lisp, toggle the mode if ARG is the symbol `toggle' and interpret ARG as > defined by `prefix-numeric-value' otherwise." And this is exactly what I suggested back then: > As for the doc string, please avoid repetition, it's confusing. I > suggested to describe the additional features when the mode is called > from Lisp by using the word "also". The wording I had in mind was similar to yours: When called from Lisp, also enable the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 01 16:47:22 2020 Received: (at 24706) by debbugs.gnu.org; 1 Aug 2020 20:47:22 +0000 Received: from localhost ([127.0.0.1]:41156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k1yPZ-0003bP-RJ for submit@debbugs.gnu.org; Sat, 01 Aug 2020 16:47:22 -0400 Received: from mail-oi1-f173.google.com ([209.85.167.173]:44425) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k1yPY-0003bA-Et for 24706@debbugs.gnu.org; Sat, 01 Aug 2020 16:47:20 -0400 Received: by mail-oi1-f173.google.com with SMTP id h3so6341648oie.11 for <24706@debbugs.gnu.org>; Sat, 01 Aug 2020 13:47:20 -0700 (PDT) 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=XGPzx/aiQxIMndLfny+mp3UiGKvd2lP1/zXYxrWklz0=; b=Zscg/GcV9bAOqW8JIAKrqJhAWvHbXFHfXUGj0XWmsW5sdTzR7gPi1hzI1RCsZxDCX3 aY92NFYJf+PdQbvbcrijAELxZWPiJ6BSP3oT/8Y+mzZoxo0Vef4cLdDWA8vGcGprB57+ 5jPcuQ3sLE4dAOQ52bSdAv3dIP92ER5r2TXBeag+7juqjh8ODKLWxXB8iAL0yNKDIie8 L2nxLfRS358qqc22Co8b1t9/MBu2Vq+XU1xXuRXC7OcfZdIzzbQZ4G4y89c+4pk2rZTU 5adMdHfCr81wnT/LjXormKPCWdm4YhZ2DnrU1U9/06zcrsPjN9Bi6D94icEEJ0fC6u2D AXgQ== 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=XGPzx/aiQxIMndLfny+mp3UiGKvd2lP1/zXYxrWklz0=; b=thMGlGBFuxJNVfKlfNPo0KdkWPUzPe5Qmyvco2uQEbs5uCeYSaN6Yk8hLbaH070DzD Bxil56tdPYNsnsgEY1qOocX6wvdiBG5vxMEew+DMuboNJVLeGbcTyFDRDITOkrkq55sZ RJIV57d4NUEiiWtBZeJNs7ZlDNDEcduyquTID9HuRTj+VEWE91uZ8rkMggLprjvMrB/G DC4bbQMj/CFR/Gt9zNtO9aO4BFgUtMvduU97AOgdXP5jKUZ5sFbWrB6JKBUcRNqt5ZLK j31sOmxvxXYc1Q3q8z5Td+2n+N9cS5pJsDOHh+QWlAYu3rUqUAYqBIOTi9aCtXwx3Sfb N/Tg== X-Gm-Message-State: AOAM532YNwdheKkraO/pYkOcd57xe2hwVxjUG73DP9Aew3/6p+XMhE3C 5maCPj8oj8X2Kvtk22qP4AjXT2VnrsAD3lKKvOQ= X-Google-Smtp-Source: ABdhPJxDQVSBAZrUnfigxVi3EHnTfxJLOfAULdWTpWzwwXDCYjVwT6/sERQQ+s19DAsJNYKI8yc/4Nf+6ISu3uExa8E= X-Received: by 2002:aca:b884:: with SMTP id i126mr7664286oif.65.1596314834577; Sat, 01 Aug 2020 13:47:14 -0700 (PDT) MIME-Version: 1.0 References: <83mvi4yvoj.fsf@gnu.org> <83tw5bo1em.fsf@gnu.org> In-Reply-To: <83tw5bo1em.fsf@gnu.org> From: Philipp Stephani Date: Sat, 1 Aug 2020 22:47:03 +0200 Message-ID: Subject: Re: bug#24706: 26.0.50; Minor mode functions should do strict argument type checking To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 24706 Cc: 24706@debbugs.gnu.org, Drew Adams 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 Mi., 26. Apr. 2017 um 13:27 Uhr schrieb Eli Zaretskii : > > > From: Philipp Stephani > > Date: Sun, 23 Apr 2017 17:51:32 +0000 > > Cc: drew.adams@oracle.com, 24706@debbugs.gnu.org > > > > Eli Zaretskii schrieb am So., 16. Okt. 2016 um 20:51 Uhr: > > > > > From: Philipp Stephani > > > Date: Sun, 16 Oct 2016 18:25:08 +0000 > > > > > > Attached a patch that uses the wording from `define-minor-mode'. > > > > The patch for the ELisp manual simply rearranges the same words, so > > it's not clear to me why we would prefer it to what's already there. > > > > I don't think there's any repetition or rearranging here. > > Here's the ELisp manual part of your proposed change: > > If the mode command is called from Lisp (i.e., non-interactively), it > -should enable the mode if the argument is omitted or @code{nil}; it > -should toggle the mode if the argument is the symbol @code{toggle}; > -otherwise it should treat the argument in the same way as for an > -interactive call with a numeric prefix argument, as described above. > +should toggle the mode if the argument is the symbol @code{toggle}; it > +should disable the mode if the argument is a non-positive integer; > +otherwise, e.g., if the argument is omitted or nil or a positive > +integer, it should enable the mode. > > Don't you agree that it does little apart of re-shuffling the same > words? It also describes what happens when the argument is neither nil nor `toggle' nor an integer. That is currently unspecified, or rather implicitly specified by the observable (but unspecified) behavior of `prefix-numeric-value'. > > > The key difference is that when called from Lisp with an > > argument that is neither nil nor an integer, the mode is also enabled. > > Why would we want to require that? This subsection describes the > conventions, it doesn't describe the effect of certain popular > implementation of those conventions, because we don't really want to > _require_ modes to behave in any way beyond the described behavior. This isn't about the implementation but the interface, i.e. the observable behavior of minor mode functions. > > > "With a prefix argument ARG, enable the mode if ARG is positive, and disable it if ARG is negative or zero. > > This is almost exactly the same as the current: > > With a prefix argument ARG, enable %s if ARG is > positive, and disable it otherwise. > > > Additionally, when called from Lisp, toggle the mode if ARG is the symbol `toggle' and interpret ARG as > > defined by `prefix-numeric-value' otherwise." > > And this is exactly what I suggested back then: > > > As for the doc string, please avoid repetition, it's confusing. I > > suggested to describe the additional features when the mode is called > > from Lisp by using the word "also". > > The wording I had in mind was similar to yours: > > When called from Lisp, also enable the mode if ARG is omitted or > nil, and toggle it if ARG is `toggle'. That again doesn't describe what happens if neither of these cases apply. (My suggestion from 2017 also wouldn't work here as-is, because the behavior of `prefix-numeric-value' isn't defined for these cases either.) From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 02 12:13:44 2020 Received: (at 24706) by debbugs.gnu.org; 2 Aug 2020 16:13:44 +0000 Received: from localhost ([127.0.0.1]:43234 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k2GcK-000403-0Z for submit@debbugs.gnu.org; Sun, 02 Aug 2020 12:13:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40766) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k2GcH-0003zq-1D for 24706@debbugs.gnu.org; Sun, 02 Aug 2020 12:13:42 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52487) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k2GcB-0003e1-8B; Sun, 02 Aug 2020 12:13:35 -0400 Received: from [176.228.60.248] (port=4309 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1k2GcA-0006fs-Cn; Sun, 02 Aug 2020 12:13:34 -0400 Date: Sun, 02 Aug 2020 19:13:19 +0300 Message-Id: <83tuxlauw0.fsf@gnu.org> From: Eli Zaretskii To: Philipp Stephani In-Reply-To: (message from Philipp Stephani on Sat, 1 Aug 2020 22:47:03 +0200) Subject: Re: bug#24706: 26.0.50; Minor mode functions should do strict argument type checking References: <83mvi4yvoj.fsf@gnu.org> <83tw5bo1em.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 24706 Cc: 24706@debbugs.gnu.org, drew.adams@oracle.com 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: Sat, 1 Aug 2020 22:47:03 +0200 > Cc: Drew Adams , 24706@debbugs.gnu.org > > Am Mi., 26. Apr. 2017 um 13:27 Uhr schrieb Eli Zaretskii : > > > > > From: Philipp Stephani > > > Date: Sun, 23 Apr 2017 17:51:32 +0000 > > > Cc: drew.adams@oracle.com, 24706@debbugs.gnu.org > > > > > > Eli Zaretskii schrieb am So., 16. Okt. 2016 um 20:51 Uhr: > > > > > > > From: Philipp Stephani > > > > Date: Sun, 16 Oct 2016 18:25:08 +0000 It's hard to have a useful discussion when messages are several months apart. > > > The patch for the ELisp manual simply rearranges the same words, so > > > it's not clear to me why we would prefer it to what's already there. > > > > > > I don't think there's any repetition or rearranging here. > > > > Here's the ELisp manual part of your proposed change: > > > > If the mode command is called from Lisp (i.e., non-interactively), it > > -should enable the mode if the argument is omitted or @code{nil}; it > > -should toggle the mode if the argument is the symbol @code{toggle}; > > -otherwise it should treat the argument in the same way as for an > > -interactive call with a numeric prefix argument, as described above. > > +should toggle the mode if the argument is the symbol @code{toggle}; it > > +should disable the mode if the argument is a non-positive integer; > > +otherwise, e.g., if the argument is omitted or nil or a positive > > +integer, it should enable the mode. > > > > Don't you agree that it does little apart of re-shuffling the same > > words? > > It also describes what happens when the argument is neither nil nor > `toggle' nor an integer. That is currently unspecified, or rather > implicitly specified by the observable (but unspecified) behavior of > `prefix-numeric-value'. I think the "otherwise" part describes that. > > > The key difference is that when called from Lisp with an > > > argument that is neither nil nor an integer, the mode is also enabled. > > > > Why would we want to require that? This subsection describes the > > conventions, it doesn't describe the effect of certain popular > > implementation of those conventions, because we don't really want to > > _require_ modes to behave in any way beyond the described behavior. > > This isn't about the implementation but the interface, i.e. the > observable behavior of minor mode functions. I don't see how making this the matter of interface changes anything. We still don't want to require modes to interpret the interface the way you'd like to see. Bottom line: I think there's nothing important left to discuss here. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 01 08:12:57 2020 Received: (at 24706-done) by debbugs.gnu.org; 1 Oct 2020 12:12:57 +0000 Received: from localhost ([127.0.0.1]:34386 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNxSD-0007Ou-FI for submit@debbugs.gnu.org; Thu, 01 Oct 2020 08:12:57 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:43996) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNxSB-0007OV-FL for 24706-done@debbugs.gnu.org; Thu, 01 Oct 2020 08:12:55 -0400 Received: by mail-ed1-f68.google.com with SMTP id dn5so1500362edb.10 for <24706-done@debbugs.gnu.org>; Thu, 01 Oct 2020 05:12:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc; bh=NHjs/BZOsrPX4ugKC9ux3yljpty9yDT56JsUcuY2QY0=; b=gf+EfgAXQnGcjxZnXwarwZx/Oj6LKhLkZCqvy1KQUW/9+SFq6oTgsM4EnxE0QB30uv hKqV9tT+Wij+FWHPLDMHkZ39Ym7N4dZ/WU1jbsVg60SYs7e7N8DLHGVJaXc75ax5fuRG ZGpu5ZdcncOW8OTSPuBUx6G806K3h6nU5NI9kxuMJmrMFHx9FRnnBIO6sJ5FPabL1ZtG 4xNnrU6pq6cJ3VvsMuO9HuWqabkmytUOM9kOYKf9viSx582vLMCknY6gq7IbYUk722Fb pmv/hqdow8iEspomFZjf4bn5OnqztjBeM/NeluVbGO9NKF3eW6+CfRoeHt7oyCbhbDCV B6sg== X-Gm-Message-State: AOAM532ngLVTBmoYAzepS/lCovMU+bjS/QMTxI3Q0Vk2cT6kvbFNVjnZ XavuBUwTLnKlf8q7+vUVb/BjGG2TKYLeuknA2Z4= X-Google-Smtp-Source: ABdhPJyUVuOwwRqpJYMcV+HpOKW9CThdRgtd55ewwQs8BZOVlpQLJFjqZ67vKuEvrdOMHRJvADtvkmgAESskXfHXE9U= X-Received: by 2002:a50:fa42:: with SMTP id c2mr1876768edq.282.1601554369957; Thu, 01 Oct 2020 05:12:49 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 1 Oct 2020 05:12:49 -0700 From: Stefan Kangas In-Reply-To: <83tuxlauw0.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 02 Aug 2020 19:13:19 +0300") References: <83mvi4yvoj.fsf@gnu.org> <83tw5bo1em.fsf@gnu.org> <83tuxlauw0.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Date: Thu, 1 Oct 2020 05:12:49 -0700 Message-ID: Subject: Re: bug#24706: 26.0.50; Minor mode functions should do strict argument type checking To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 24706-done Cc: 24706-done@debbugs.gnu.org, Philipp Stephani , drew.adams@oracle.com 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.7 (/) Eli Zaretskii writes: >> From: Philipp Stephani >> Date: Sat, 1 Aug 2020 22:47:03 +0200 >> Cc: Drew Adams , 24706@debbugs.gnu.org >> >> Am Mi., 26. Apr. 2017 um 13:27 Uhr schrieb Eli Zaretskii : >> > >> > > From: Philipp Stephani >> > > Date: Sun, 23 Apr 2017 17:51:32 +0000 >> > > Cc: drew.adams@oracle.com, 24706@debbugs.gnu.org >> > > >> > > Eli Zaretskii schrieb am So., 16. Okt. 2016 um 20:51 Uhr: >> > > >> > > > From: Philipp Stephani >> > > > Date: Sun, 16 Oct 2016 18:25:08 +0000 > > It's hard to have a useful discussion when messages are several months > apart. > >> > > The patch for the ELisp manual simply rearranges the same words, so >> > > it's not clear to me why we would prefer it to what's already there. >> > > >> > > I don't think there's any repetition or rearranging here. >> > >> > Here's the ELisp manual part of your proposed change: >> > >> > If the mode command is called from Lisp (i.e., non-interactively), it >> > -should enable the mode if the argument is omitted or @code{nil}; it >> > -should toggle the mode if the argument is the symbol @code{toggle}; >> > -otherwise it should treat the argument in the same way as for an >> > -interactive call with a numeric prefix argument, as described above. >> > +should toggle the mode if the argument is the symbol @code{toggle}; it >> > +should disable the mode if the argument is a non-positive integer; >> > +otherwise, e.g., if the argument is omitted or nil or a positive >> > +integer, it should enable the mode. >> > >> > Don't you agree that it does little apart of re-shuffling the same >> > words? >> >> It also describes what happens when the argument is neither nil nor >> `toggle' nor an integer. That is currently unspecified, or rather >> implicitly specified by the observable (but unspecified) behavior of >> `prefix-numeric-value'. > > I think the "otherwise" part describes that. > >> > > The key difference is that when called from Lisp with an >> > > argument that is neither nil nor an integer, the mode is also enabled. >> > >> > Why would we want to require that? This subsection describes the >> > conventions, it doesn't describe the effect of certain popular >> > implementation of those conventions, because we don't really want to >> > _require_ modes to behave in any way beyond the described behavior. >> >> This isn't about the implementation but the interface, i.e. the >> observable behavior of minor mode functions. > > I don't see how making this the matter of interface changes anything. > We still don't want to require modes to interpret the interface the > way you'd like to see. > > Bottom line: I think there's nothing important left to discuss here. That was 8 weeks ago, and there has been no further comments. I'm therefore closing this bug now. If there is anything more to do here, please reply to this email (use "Reply to all" in your email client) and we can reopen the bug report. Best regards, Stefan Kangas From unknown Sat Aug 16 18:09:55 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 30 Oct 2020 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator