From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.bugs Subject: bug#4102: 23.1.50; recentf-mode nil but toggles Date: Wed, 12 Aug 2009 21:53:13 -0700 Message-ID: References: <04855577A772452A99C5FBCB8078CE4D@xahPC> <2F116E10862F449E8FE250395BB55937@xahPC> <26d7a64b-c393-42b9-bacf-8a9e6c62eadd@f20g2000prn.googlegroups.com> Reply-To: xahlee@gmail.com, 4102@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0016e65096ea8988150470feb678 X-Trace: ger.gmane.org 1250146982 27063 80.91.229.12 (13 Aug 2009 07:03:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Aug 2009 07:03:02 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 13 09:02:55 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MbUKs-0007KS-6y for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Aug 2009 09:02:54 +0200 Original-Received: from localhost ([127.0.0.1]:42718 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MbUKp-0000ah-Oj for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Aug 2009 03:02:51 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MbSWg-000496-PO for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2009 01:06:58 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MbSWc-00045U-8v for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2009 01:06:58 -0400 Original-Received: from [199.232.76.173] (port=49607 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MbSWb-00044i-6Y for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2009 01:06:53 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:34075) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MbSWZ-0001kM-7n for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2009 01:06:52 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7D56ncn030682; Wed, 12 Aug 2009 22:06:49 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n7D503Hd028878; Wed, 12 Aug 2009 22:00:03 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Xah Lee Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 13 Aug 2009 05:00:03 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4102 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125013920328050 (code B ref -1); Thu, 13 Aug 2009 05:00:03 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 13 Aug 2009 04:53:23 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-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 Original-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 Original-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 Original-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 Original-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 Original-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= Original-Received: by 10.114.161.3 with SMTP id j3mr700073wae.10.1250139193312; Wed, 12 Aug 2009 21:53:13 -0700 (PDT) In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Thu, 13 Aug 2009 01:06:58 -0400 X-Mailman-Approved-At: Thu, 13 Aug 2009 03:02:47 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:30147 Archived-At: --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--