From unknown Sat Aug 16 00:30:19 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#4102 <4102@debbugs.gnu.org> To: bug#4102 <4102@debbugs.gnu.org> Subject: Status: 23.1.50; recentf-mode nil but toggles Reply-To: bug#4102 <4102@debbugs.gnu.org> Date: Sat, 16 Aug 2025 07:30:19 +0000 retitle 4102 23.1.50; recentf-mode nil but toggles reassign 4102 emacs submitter 4102 "Xah Lee" severity 4102 normal thanks From xah@xahlee.org Mon Aug 10 01:06:38 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 10 Aug 2009 08:06:38 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.6 required=4.0 tests=AWL,FOURLA,MURPHY_DRUGS_REL8, STOX_REPLY_TYPE autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7A86aI3017134 for ; Mon, 10 Aug 2009 01:06:37 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MaPtq-0006lV-K7 for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2009 04:06:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MaPto-0006lI-R9 for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2009 04:06:34 -0400 Received: from [199.232.76.173] (port=47881 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MaPto-0006lF-NK for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2009 04:06:32 -0400 Received: from mx20.gnu.org ([199.232.41.8]:25610) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MaPto-0005Ph-3j for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2009 04:06:32 -0400 Received: from mout.perfora.net ([74.208.4.195]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MaPtn-0008QT-4C for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2009 04:06:31 -0400 Received: from xahPC (c-76-102-12-87.hsd1.ca.comcast.net [76.102.12.87]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0MKpCa-1MaPtk0a3I-0001FY; Mon, 10 Aug 2009 04:06:29 -0400 Message-ID: <04855577A772452A99C5FBCB8078CE4D@xahPC> From: "Xah Lee" To: Subject: 23.1.50; recentf-mode nil but toggles Date: Mon, 10 Aug 2009 01:06:19 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6002.18005 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6002.18005 X-Provags-ID: V01U2FsdGVkX19wSvUH3oyFAjgRrYz5llN8qWSm6GKffPC4dmc F1UBVaixo42MJAijfR2iUiQItTa/VYvTkRh8FH/fuCFgpZSFcO WydAPE8ZcR3WDNG1ycvZQ== X-Detected-Operating-System: by mx20.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) gosh, stung by this bug. in my elisp code, i have: (recentf-mode nil) this should turn it off, but actually it toggles. here's a quote of its inline doc: « (recentf-mode &optional arg) Toggle recentf mode. With prefix argument arg, turn on if positive, otherwise off. » this is reproduciable in the following: GNU Emacs 23.1.1 (i386-mingw-nt6.0.6002) of 2009-07-29 on SOFT-MJASON GNU Emacs 23.1.50.1 (i386-mingw-nt6.0.6002) of 2009-06-30 on LENNART-69DE564 (patched) Xah ∑ http://xahlee.org/ ☄ From monnier@iro.umontreal.ca Mon Aug 10 09:40:43 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 10 Aug 2009 16:40:43 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7AGegAt004695 for ; Mon, 10 Aug 2009 09:40:43 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MaXvN-0006Yl-QS for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2009 12:40:41 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MaXvI-0006YV-En for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2009 12:40:40 -0400 Received: from [199.232.76.173] (port=43988 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MaXvI-0006YS-95 for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2009 12:40:36 -0400 Received: from tomts40.bellnexxia.net ([209.226.175.97]:58636 helo=tomts40-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MaXvH-0007o3-JS for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2009 12:40:35 -0400 Received: from toip3.srvr.bell.ca ([209.226.175.86]) by tomts40-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20090810164035.LUQG12511.tomts40-srv.bellnexxia.net@toip3.srvr.bell.ca> for ; Mon, 10 Aug 2009 12:40:35 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAGzof0pGN48s/2dsb2JhbACBUs8BhBgF Received: from bas1-montreal42-1178046252.dsl.bell.ca (HELO ceviche.home) ([70.55.143.44]) by toip3.srvr.bell.ca with ESMTP; 10 Aug 2009 12:32:58 -0400 Received: by ceviche.home (Postfix, from userid 20848) id B42A8B454F; Mon, 10 Aug 2009 12:40:34 -0400 (EDT) From: Stefan Monnier To: Xah Lee Cc: 4102@debbugs.gnu.org, Subject: Re: bug#4102: 23.1.50; recentf-mode nil but toggles Message-ID: References: <04855577A772452A99C5FBCB8078CE4D@xahPC> Date: Mon, 10 Aug 2009 12:40:34 -0400 In-Reply-To: <04855577A772452A99C5FBCB8078CE4D@xahPC> (Xah Lee's message of "Mon, 10 Aug 2009 01:06:19 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: Solaris 8 (1) > in my elisp code, i have: > (recentf-mode nil) > this should turn it off, but actually it toggles. That's indeed the standard behavior for all minor modes. Use integers to avoid such surprises. > With prefix argument arg, turn on if positive, otherwise off. It's not clear whether nil is positive or negative. Stefan From xah@xahlee.org Mon Aug 10 19:01:56 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 11 Aug 2009 02:01:57 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.2 required=4.0 tests=AWL,HAS_BUG_NUMBER, STOX_REPLY_TYPE autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7B21t9R032193 for ; Mon, 10 Aug 2009 19:01:56 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MaggV-00061o-4F for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2009 22:01:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MaggS-0005zS-Ss for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2009 22:01:54 -0400 Received: from [199.232.76.173] (port=51425 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MaggS-0005zP-Pu for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2009 22:01:52 -0400 Received: from mout.perfora.net ([74.208.4.195]:55096) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MaggS-00082i-0X for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2009 22:01:52 -0400 Received: from xahPC (c-76-102-12-87.hsd1.ca.comcast.net [76.102.12.87]) by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis) id 0MKpCa-1MaggK3x6l-0001G1; Mon, 10 Aug 2009 22:01:48 -0400 Message-ID: <2F116E10862F449E8FE250395BB55937@xahPC> From: "Xah Lee" To: "Stefan Monnier" Cc: <4102@debbugs.gnu.org>, References: <04855577A772452A99C5FBCB8078CE4D@xahPC> In-Reply-To: Subject: Re: bug#4102: 23.1.50; recentf-mode nil but toggles Date: Mon, 10 Aug 2009 19:01:37 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6002.18005 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6002.18005 X-Provags-ID: V01U2FsdGVkX19C9mAyiSqJRdInyjPgWrwcNWkLigyWPY5cMej EIjtiD5aAE8uFfycJmIvd0GHLyUx2sfaefJVSbX2vqKIHzDqkd NXPDPs492bFuIowj95fxg== X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-CrossAssassin-Score: 2 >> With prefix argument arg, turn on if positive, otherwise off. > > It's not clear whether nil is positive or negative. Thanks. That's interesting. Can the doc adds a warning like: The argument should be a integer. Do not use t or nil. ? Xah ∑ http://xahlee.org/ ☄ ----- Original Message ----- From: "Stefan Monnier" To: "Xah Lee" Cc: <4102@debbugs.gnu.org>; Sent: Monday, August 10, 2009 9:40 AM Subject: Re: bug#4102: 23.1.50; recentf-mode nil but toggles >> in my elisp code, i have: >> (recentf-mode nil) >> this should turn it off, but actually it toggles. > > That's indeed the standard behavior for all minor modes. Use integers > to avoid such surprises. > >> With prefix argument arg, turn on if positive, otherwise off. > > It's not clear whether nil is positive or negative. From geb-bug-gnu-emacs@m.gmane.org Tue Aug 11 21:06:18 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 12 Aug 2009 04:06:19 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7C46GHW010328 for ; Tue, 11 Aug 2009 21:06:18 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mb56N-0001le-Mz for bug-gnu-emacs@gnu.org; Wed, 12 Aug 2009 00:06:15 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mb56J-0001lK-EL for bug-gnu-emacs@gnu.org; Wed, 12 Aug 2009 00:06:15 -0400 Received: from [199.232.76.173] (port=34470 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mb56J-0001lH-67 for bug-gnu-emacs@gnu.org; Wed, 12 Aug 2009 00:06:11 -0400 Received: from main.gmane.org ([80.91.229.2]:49114 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mb56I-00070k-KA for bug-gnu-emacs@gnu.org; Wed, 12 Aug 2009 00:06:10 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Mb56E-0007PW-SG for bug-gnu-emacs@gnu.org; Wed, 12 Aug 2009 04:06:07 +0000 Received: from c-71-237-24-138.hsd1.co.comcast.net ([71.237.24.138]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Aug 2009 04:06:06 +0000 Received: from kevin.d.rodgers by c-71-237-24-138.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Aug 2009 04:06:06 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: Kevin Rodgers Subject: Re: bug#4102: 23.1.50; recentf-mode nil but toggles Date: Tue, 11 Aug 2009 22:05:52 -0600 Lines: 21 Message-ID: References: <04855577A772452A99C5FBCB8078CE4D@xahPC> <2F116E10862F449E8FE250395BB55937@xahPC> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-71-237-24-138.hsd1.co.comcast.net User-Agent: Thunderbird 2.0.0.22 (Macintosh/20090605) In-Reply-To: <2F116E10862F449E8FE250395BB55937@xahPC> Sender: news X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Xah Lee wrote: >>> With prefix argument arg, turn on if positive, otherwise off. >> >> It's not clear whether nil is positive or negative. It seems clear to me that nil is not positive, so the "otherwise" condition holds. > Thanks. That's interesting. > > Can the doc adds a warning like: > > The argument should be a integer. Do not use t or nil. Do not use `supercalifragilisticexpialidocious' either. How about: Use nil to toggle the mode on or off. -- Kevin Rodgers Denver, Colorado, USA From drew.adams@oracle.com Wed Aug 12 21:15:56 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 13 Aug 2009 04:15:56 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-4.1 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7D4FsTE022400 for ; Wed, 12 Aug 2009 21:15:56 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MbRjG-0007BO-Hw for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2009 00:15:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MbRjB-0007Ax-55 for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2009 00:15:53 -0400 Received: from [199.232.76.173] (port=59503 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MbRjA-0007Au-U7 for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2009 00:15:48 -0400 Received: from rcsinet11.oracle.com ([148.87.113.123]:16666 helo=rgminet11.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MbRjA-0002Ux-JE for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2009 00:15:48 -0400 Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rgminet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n7D4FqwT027464 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 13 Aug 2009 04:15:54 GMT Received: from abhmt004.oracle.com (abhmt004.oracle.com [141.146.116.13]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n7D4FjnH002635; Thu, 13 Aug 2009 04:15:45 GMT Received: from dradamslap1 (/141.144.168.24) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 12 Aug 2009 21:15:42 -0700 From: "Drew Adams" To: "'Xah Lee'" , References: <04855577A772452A99C5FBCB8078CE4D@xahPC> <2F116E10862F449E8FE250395BB55937@xahPC> <26d7a64b-c393-42b9-bacf-8a9e6c62eadd@f20g2000prn.googlegroups.com> Subject: RE: bug#4102: 23.1.50; recentf-mode nil but toggles Date: Wed, 12 Aug 2009 21:15:41 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <26d7a64b-c393-42b9-bacf-8a9e6c62eadd@f20g2000prn.googlegroups.com> Thread-Index: AcobvpfrYmaLUXvcTdCbsIXQ8JEBwAADEJbQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: abhmt004.oracle.com [141.146.116.13] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A010203.4A83936F.00D1:SCFSTAT5015188,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) > Is there somewhere in elisp manual that > explicitly explains/warns that commands that turn minor mode on/off > stick to 1 and 0 and consider t and nil not acceptable argument? (elisp) Minor Mode Conventions: * Define a command whose name is the same as the mode variable. Its job is to enable and disable the mode by setting the variable. The command should accept one optional argument. If the argument is `nil', it should toggle the mode (turn it on if it is off, and off if it is on). It should turn the mode on if the argument is a positive integer, the symbol `t', or a list whose CAR is one of those. It should turn the mode off if the argument is a negative integer or zero, the symbol `-', or a list whose CAR is a negative integer or zero. The meaning of other arguments is not specified. Here is an example taken from the definition of `transient-mark-mode'. It shows the use of `transient-mark-mode' as a variable that enables or disables the mode's behavior, and also shows the proper way to toggle, enable or disable the minor mode based on the raw prefix argument value. (setq transient-mark-mode (if (null arg) (not transient-mark-mode) (> (prefix-numeric-value arg) 0))) Any positive integer is the same as 1. Any negative integer is the same as 0. t is the same as 1. `-' is the same as 0. (4) is the same as 1. (-4) is the same as 0. (0) is the same as 0. (t) is the same as 1. (nil) and (-): behavior not conventionally defined nil always toggles. It lets you do just `M-x foo' to toggle (the most common change). You can do `C-u M-x foo' or `C-9 M-x foo' to turn it on and `C-- M-x foo' to turn it off. etc. From xahlee@gmail.com Wed Aug 12 21:53:23 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 13 Aug 2009 04:53:23 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.0 required=4.0 tests=HAS_BUG_NUMBER,MULTALT autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7D4rLSm028047 for ; Wed, 12 Aug 2009 21:53:22 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MbSJU-0005we-TO for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2009 00:53:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MbSJP-0005rN-M5 for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2009 00:53:19 -0400 Received: from [199.232.76.173] (port=41691 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MbSJP-0005r5-H1 for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2009 00:53:15 -0400 Received: from mail-px0-f193.google.com ([209.85.216.193]:51959) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MbSJO-0008Vv-A6 for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2009 00:53:14 -0400 Received: by pxi31 with SMTP id 31so83523pxi.24 for ; Wed, 12 Aug 2009 21:53:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=SNLNqSwCuRDGfNIIAdGou7UyVRg5eeRkAASL8bHPXRk=; b=BsccVIXWp7zIEBsmaAjvGmO4FJc2leQawIK0Qfu5P+FOXHuCR3bdQ5QIMva8B2gxYF s9Y40ksirGr+EMfo5XcdhCZqRUcS2wi92WhzUHb9yHD0osgGTrNZG3EUconnNdHFXFas ZfjzLaFFfsk0DCPpO8jqmW3plyS1miTP6Jay4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; b=YJ72dKj7HBJWeQE8z6GOmvM6Wo3LIIUUfBfkUc6NCBQyCbbbPIH+24EO6eLozPHGk/ 2qfFVg6iogejBdTisF3UaZze+KoY9HMoxR90nOx5GcSqaA/RW6THeDF5zeWp8RF23qme iDF01Qgk+C4PdocwQPpqPC0qKMIrbSCLBaGyk= MIME-Version: 1.0 Received: by 10.114.161.3 with SMTP id j3mr700073wae.10.1250139193312; Wed, 12 Aug 2009 21:53:13 -0700 (PDT) Reply-To: xahlee@gmail.com In-Reply-To: References: <04855577A772452A99C5FBCB8078CE4D@xahPC> <2F116E10862F449E8FE250395BB55937@xahPC> <26d7a64b-c393-42b9-bacf-8a9e6c62eadd@f20g2000prn.googlegroups.com> Date: Wed, 12 Aug 2009 21:53:13 -0700 Message-ID: Subject: Re: bug#4102: 23.1.50; recentf-mode nil but toggles From: Xah Lee To: Drew Adams Cc: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary=0016e65096ea8988150470feb678 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) --0016e65096ea8988150470feb678 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks Drew and all in this thread for the info. Xah On Wed, Aug 12, 2009 at 9:15 PM, Drew Adams wrote: > > Is there somewhere in elisp manual that > > explicitly explains/warns that commands that turn minor mode on/off > > stick to 1 and 0 and consider t and nil not acceptable argument? > > (elisp) Minor Mode Conventions: > > * Define a command whose name is the same as the mode variable. Its > job is to enable and disable the mode by setting the variable. > > The command should accept one optional argument. If the argument > is `nil', it should toggle the mode (turn it on if it is off, and > off if it is on). It should turn the mode on if the argument is a > positive integer, the symbol `t', or a list whose CAR is one of > those. It should turn the mode off if the argument is a negative > integer or zero, the symbol `-', or a list whose CAR is a negative > integer or zero. The meaning of other arguments is not specified. > > Here is an example taken from the definition of > `transient-mark-mode'. It shows the use of `transient-mark-mode' > as a variable that enables or disables the mode's behavior, and > also shows the proper way to toggle, enable or disable the minor > mode based on the raw prefix argument value. > > (setq transient-mark-mode > (if (null arg) (not transient-mark-mode) > (> (prefix-numeric-value arg) 0))) > > Any positive integer is the same as 1. > Any negative integer is the same as 0. > > t is the same as 1. > `-' is the same as 0. > > (4) is the same as 1. > (-4) is the same as 0. > (0) is the same as 0. > > (t) is the same as 1. > > (nil) and (-): behavior not conventionally defined > > nil always toggles. It lets you do just `M-x foo' to toggle (the most > common > change). > > You can do `C-u M-x foo' or `C-9 M-x foo' to turn it on and `C-- M-x foo' > to > turn it off. > > etc. > > --=20 Xah =E2=88=91 http://xahlee.org/ --0016e65096ea8988150470feb678 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks Drew and all in this thread for the info.

=C2=A0X= ah

On Wed, Aug 12, 2009 at 9:15 PM, Drew = Adams <drew.a= dams@oracle.com> wrote:
> Is there somewhere in elisp manual tha= t
> explicitly explains/warns that commands that turn minor mode on/off > stick to 1 and 0 and consider t and nil not acceptable argument?

(elisp) Minor Mode Conventions:

=C2=A0 * Define a command whose name is the same as the mode variable. =C2= =A0Its
=C2=A0 =C2=A0 job is to enable and disable the mode by setting the variabl= e.

=C2=A0 =C2=A0 The command should accept one optional argument. =C2=A0If th= e argument
=C2=A0 =C2=A0 is `nil', it should toggle the mode (turn it on if it is= off, and
=C2=A0 =C2=A0 off if it is on). =C2=A0It should turn the mode on if the ar= gument is a
=C2=A0 =C2=A0 positive integer, the symbol `t', or a list whose CAR is= one of
=C2=A0 =C2=A0 those. =C2=A0It should turn the mode off if the argument is = a negative
=C2=A0 =C2=A0 integer or zero, the symbol `-', or a list whose CAR is = a negative
=C2=A0 =C2=A0 integer or zero. =C2=A0The meaning of other arguments is not= specified.

=C2=A0 =C2=A0 Here is an example taken from the definition of
=C2=A0 =C2=A0 `transient-mark-mode'. =C2=A0It shows the use of `transi= ent-mark-mode'
=C2=A0 =C2=A0 as a variable that enables or disables the mode's behavi= or, and
=C2=A0 =C2=A0 also shows the proper way to toggle, enable or disable the m= inor
=C2=A0 =C2=A0 mode based on the raw prefix argument value.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(setq transient-mark-mode
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(if (null arg) (not= transient-mark-mode)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(> (prefi= x-numeric-value arg) 0)))

Any positive integer is the same as 1.
Any negative integer is the same as 0.

=C2=A0t =C2=A0is the same as 1.
`-' is the same as 0.

=C2=A0(4) is the same as 1.
(-4) is the same as 0.
=C2=A0(0) is the same as 0.

(t) is the same as 1.

(nil) and (-): behavior not conventionally defined

nil always toggles. It lets you do just `M-x foo' to toggle (the most c= ommon
change).

You can do `C-u M-x foo' or `C-9 M-x foo' to turn it on and `C-- M-= x foo' to
turn it off.

etc.




--
=C2=A0Xah
=E2=88=91= http://xahlee.org/
--0016e65096ea8988150470feb678-- From monnier@IRO.UMontreal.CA Thu Aug 13 10:36:44 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 13 Aug 2009 17:36:44 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-4.4 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7DHahG1004822 for ; Thu, 13 Aug 2009 10:36:44 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MbeEE-0004K9-Ok for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2009 13:36:42 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MbeE9-0004GB-TE for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2009 13:36:42 -0400 Received: from [199.232.76.173] (port=60488 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MbeE9-0004Fw-Og for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2009 13:36:37 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]:40997) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MbeE8-0006wk-W2 for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2009 13:36:37 -0400 Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id n7DHaWID001921; Thu, 13 Aug 2009 13:36:32 -0400 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 763F09015C; Thu, 13 Aug 2009 13:36:32 -0400 (EDT) From: Stefan Monnier To: Kevin Rodgers Cc: 4102@debbugs.gnu.org, bug-gnu-emacs@gnu.org Subject: Re: bug#4102: 23.1.50; recentf-mode nil but toggles Message-ID: References: <04855577A772452A99C5FBCB8078CE4D@xahPC> <2F116E10862F449E8FE250395BB55937@xahPC> Date: Thu, 13 Aug 2009 13:36:32 -0400 In-Reply-To: (Kevin Rodgers's message of "Tue, 11 Aug 2009 22:05:52 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3340=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) > Do not use `supercalifragilisticexpialidocious' either. > How about: Use nil to toggle the mode on or off. Actually, the docstring already says that nil toggles. If you remember that the docstring is written here to describe the command rather than the function, then you'll immediately conclude that With prefix argument arg, turn on if positive, otherwise off. only applies when there's a prefix argument, so when there isn't, arg is necessarily nil and the normal behavior (described on the previous line: Toggle recentf mode. ) applies. Stefan From cyd@stupidchicken.com Sat Aug 15 16:14:56 2009 Received: (at control) by emacsbugs.donarmstrong.com; 15 Aug 2009 23:14:57 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-1.6 required=4.0 tests=AWL autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7FNEtVq004798 for ; Sat, 15 Aug 2009 16:14:56 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id 5A3A557E21C; Sat, 15 Aug 2009 19:15:54 -0400 (EDT) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 4102 Date: Sat, 15 Aug 2009 19:15:54 -0400 Message-ID: <87ab20llcl.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii close 4102 thanks From unknown Sat Aug 16 00:30:19 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 13 Sep 2009 14:24:11 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A long time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator