From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: turning on minor modes from hooks Date: Tue, 01 Sep 2009 09:17:20 +0900 Message-ID: <87ljkz7c33.fsf@catnip.gol.com> References: <200908292125.n7TLPCdp005058@godzilla.ics.uci.edu> <87eiqui4yx.fsf@catnip.gol.com> <87r5ur7hpi.fsf@catnip.gol.com> Reply-To: Miles Bader NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1251764527 15427 80.91.229.12 (1 Sep 2009 00:22:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Sep 2009 00:22:07 +0000 (UTC) Cc: dann@ics.uci.edu, rms@gnu.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 01 02:21:59 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 1MiH8H-0004E4-0W for ged-emacs-devel@m.gmane.org; Tue, 01 Sep 2009 02:21:57 +0200 Original-Received: from localhost ([127.0.0.1]:40782 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MiH8G-0004mU-2f for ged-emacs-devel@m.gmane.org; Mon, 31 Aug 2009 20:21:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MiH40-0003ek-P8 for emacs-devel@gnu.org; Mon, 31 Aug 2009 20:17:32 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MiH3w-0003cy-03 for emacs-devel@gnu.org; Mon, 31 Aug 2009 20:17:32 -0400 Original-Received: from [199.232.76.173] (port=52361 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MiH3v-0003ct-Ph for emacs-devel@gnu.org; Mon, 31 Aug 2009 20:17:27 -0400 Original-Received: from smtp11.dentaku.gol.com ([203.216.5.73]:53218) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MiH3s-00060M-8y; Mon, 31 Aug 2009 20:17:24 -0400 Original-Received: from 218.231.109.79.eo.eaccess.ne.jp ([218.231.109.79] helo=catnip.gol.com) by smtp11.dentaku.gol.com with esmtpa (Dentaku) id 1MiH3o-0001xN-Vp; Tue, 01 Sep 2009 09:17:21 +0900 Original-Received: by catnip.gol.com (Postfix, from userid 1000) id 5B53DDF8D; Tue, 1 Sep 2009 09:17:20 +0900 (JST) System-Type: x86_64-unknown-linux-gnu In-Reply-To: (Stefan Monnier's message of "Mon, 31 Aug 2009 19:32:29 -0400") Original-Lines: 35 X-Virus-Scanned: ClamAV GOL (outbound) X-Abuse-Complaints: abuse@gol.com X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:114931 Archived-At: Stefan Monnier writes: >>>> A call with no arguments, as in (auto-save-mode), naturally ought to >>>> toggle the mode or turn it on. >>> Care to explain why? >> >> Note that he said "or turn it on"; I think the point was to distinguish >> those possibilities from "unconditionally turn it off". > > Toggling is just wrong for it. Right, but the second possibility, "turn it on" (and I interpreted that to mean "unconditionally turn it on"), is right, and he _did_ say "or"... > I understand why it's like this right now, but from an Lisp point of > view, it's just not the right choice, and there's no need here to > distinguish a nil arg from the absence of an arg. I agree that toggling is wrong for the elisp interface, but I disagree with the rest of that -- as a programmer, (foo) and (foo nil) _do_ look like entirely different things; the fact that they're conflated in elisp seems like an implementation detail, not a design choice; it's generally harmless, but on occasion can result in annoyingly counter-intuitive interfaces. In the case of mode functions, ideally I _could_ use (foo-mode) _or_ (foo-mode t) to turn on foo mode, and (foo-mode nil) to turn it off. Those usages seem like the natural ones to me, given no implementation constraints. -Miles -- Vote, v. The instrument and symbol of a freeman's power to make a fool of himself and a wreck of his country.