From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: bug#3688: Also need (auto-fill-mode nil) to trigger this bug Date: Mon, 29 Jun 2009 21:37:11 +0000 Message-ID: <20090629213711.GB2072@muc.de> References: <200906261356.48352.kees.bakker@altium.nl> <200906291001.56093.kees.bakker@altium.nl> <200906291118.10568.kees.bakker@altium.nl> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1246311351 32693 80.91.229.12 (29 Jun 2009 21:35:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Jun 2009 21:35:51 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: Kees Bakker Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 29 23:35:44 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MLOVq-0004F5-AM for ged-emacs-devel@m.gmane.org; Mon, 29 Jun 2009 23:35:42 +0200 Original-Received: from localhost ([127.0.0.1]:43749 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MLOVp-0008Uj-Fd for ged-emacs-devel@m.gmane.org; Mon, 29 Jun 2009 17:35:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MLOVk-0008Ue-4F for emacs-devel@gnu.org; Mon, 29 Jun 2009 17:35:36 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MLOVf-0008UL-IX for emacs-devel@gnu.org; Mon, 29 Jun 2009 17:35:35 -0400 Original-Received: from [199.232.76.173] (port=48352 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MLOVf-0008UI-Am for emacs-devel@gnu.org; Mon, 29 Jun 2009 17:35:31 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:3395 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MLOVe-0002xa-Mv for emacs-devel@gnu.org; Mon, 29 Jun 2009 17:35:31 -0400 Original-Received: (qmail 3387 invoked by uid 3782); 29 Jun 2009 21:35:28 -0000 Original-Received: from acm.muc.de (pD9E5204E.dip.t-dialin.net [217.229.32.78]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Mon, 29 Jun 2009 23:35:27 +0200 Original-Received: (qmail 11218 invoked by uid 1000); 29 Jun 2009 21:37:12 -0000 Content-Disposition: inline In-Reply-To: <200906291118.10568.kees.bakker@altium.nl> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:111816 Archived-At: Hi, Kees! On Mon, Jun 29, 2009 at 11:18:10AM +0200, Kees Bakker wrote: > On Monday 29 June 2009, Stefan Monnier wrote: > > > (auto-fill-mode nil) > > All minor modes are turned on with a positive arg and turned off with > > a negative arg. A nil argument may toggle it, but that might change > > in the future. A `toggle' argument toggles most (but not all) minor > > modes. > OK. I didn't know that (and I'm using emacs for almost two decades > now). Still I want to express my dislike about the way a "nil" arg is > handled. OK, but look on the bright side - your confusion led directly to a bug being fixed. Your discomfort for everybody's gain. Think of yourself as a hero, not a victim. ;-) > First, is 0 a positive arg? Some people might think so (I do). I don't think so, and I'm a graduate mathematician. But I still remember long unresolved discussions amongst maths people about whether zero is positive, and sometimes terms like "strictly positive" and "non-negative" were used. Trouble is, "strictly positive" is a bit of a mouthful, and "non-negative" is a bit, well, negative - do we really want to describe something by what it isn't rather than what it is? > It is a bit confusing. (auto-fill-mode 0) will turn the mode off, so > in that sense a zero is not a positive arg. To summarize > (auto-fill-mode) ;;; toggles > (auto-fill-mode 0) ;;; turn off > (auto-fill-mode nil) ;;; toggles > (auto-fill-mode -1) ;;; turn off > (auto-fill-mode 1) ;;; turn on > (auto-fill-mode t) ;;; turn on (auto-fill-mode 0) shouldn't be troublesome to a C hacker. :-) > Toggling for a "nil" argument does not make sense to me. `auto-fill-mode' is also an interactive command, and as such it has an &optional argument. The Right Thing to do with "M-x auto-fill-mode" is to toggle. The omitted argument becomes nil, hence the the above is (auto-fill-mode nil) in lisp. It does make sense, sort of. But I admit, I sometimes find it confusing too. Actually, looking at the doc string for this command: Toggle Auto Fill mode. With ARG, turn Auto Fill mode on if and only if ARG is positive. In Auto Fill mode, inserting a space at a column beyond `current-fill-column' automatically breaks the line at a previous space. , it is incomplete in that it doesn't specify what happens when ARG isn't positive. Maybe this would be better: Turn AutoFill mode on if ARG is positive, turn it off if ARG is zero or negative, toggle it if ARG is nil (or absent). > Kees -- Alan Mackenzie (Nuremberg, Germany).