From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: turning on minor modes from hooks Date: Tue, 01 Sep 2009 19:23:56 -0400 Message-ID: References: <200908292125.n7TLPCdp005058@godzilla.ics.uci.edu> <87eiqui4yx.fsf@catnip.gol.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1251847464 24324 80.91.229.12 (1 Sep 2009 23:24:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Sep 2009 23:24:24 +0000 (UTC) Cc: dann@ics.uci.edu, emacs-devel@gnu.org, miles@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 02 01:24:17 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 1Mici0-0005pd-Pf for ged-emacs-devel@m.gmane.org; Wed, 02 Sep 2009 01:24:17 +0200 Original-Received: from localhost ([127.0.0.1]:56379 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Michz-0003o1-O2 for ged-emacs-devel@m.gmane.org; Tue, 01 Sep 2009 19:24:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Michq-0003kV-Jd for emacs-devel@gnu.org; Tue, 01 Sep 2009 19:24:06 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Michm-0003Xj-8g for emacs-devel@gnu.org; Tue, 01 Sep 2009 19:24:05 -0400 Original-Received: from [199.232.76.173] (port=54723 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Michk-0003XU-G2 for emacs-devel@gnu.org; Tue, 01 Sep 2009 19:24:00 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:36569) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Michh-0000Bc-3O; Tue, 01 Sep 2009 19:23:57 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArcEAHlJnUpFpYuS/2dsb2JhbACBU9lshBsFh28 X-IronPort-AV: E=Sophos;i="4.44,314,1249272000"; d="scan'208";a="44845887" Original-Received: from 69-165-139-146.dsl.teksavvy.com (HELO pastel.home) ([69.165.139.146]) by ironport2-out.teksavvy.com with ESMTP; 01 Sep 2009 19:22:48 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 39A8B7F24; Tue, 1 Sep 2009 19:23:56 -0400 (EDT) In-Reply-To: (Richard Stallman's message of "Tue, 01 Sep 2009 17:20:23 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:114971 Archived-At: > One design that occurs to me is (foo-mode) turns it on, (foo-mode t) > turns it on, (foo-mode nil) turns it off, and the way you toggle is > (foo-mode (not foo-mode)). (foo-mode 'toggle) toggles it. I'm not necessarily opposed to (foo-mode (not foo-mode)) but it can't be used in the interactive spec, because we want the command-history to say "toogle" rather than "turn on" or "turn off", in case the user wants to repeat it. > Another is (foo-mode) toggles, That's what we have and it sucks, because it means that (add-hook 'bar-hook foo-mode) doesn't do what the user usually intends to do. Same thing with -*- mode: foo -*-. That's why (foo-mode) needs to unconditionally turn the mode on. > The current convention for interactive calls seems clear and natural > so I think it should be preserved, whatever we do with calls from Lisp. Agreed. Stefan