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: turn-on-*-mode Date: Wed, 17 May 2006 17:24:49 -0400 Message-ID: References: <4469D3B6.2040904@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1147901132 22693 80.91.229.2 (17 May 2006 21:25:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 17 May 2006 21:25:32 +0000 (UTC) Cc: emacs-devel@gnu.org, Miles Bader Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 17 23:25:31 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FgTWB-00033L-4U for ged-emacs-devel@m.gmane.org; Wed, 17 May 2006 23:25:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FgTWA-0006fJ-Gk for ged-emacs-devel@m.gmane.org; Wed, 17 May 2006 17:25:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FgTVw-0006eC-Ee for emacs-devel@gnu.org; Wed, 17 May 2006 17:25:04 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FgTVu-0006dj-TH for emacs-devel@gnu.org; Wed, 17 May 2006 17:25:03 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FgTVu-0006dZ-NG for emacs-devel@gnu.org; Wed, 17 May 2006 17:25:02 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FgTYo-0007SF-Of; Wed, 17 May 2006 17:28:02 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 720692CF42A; Wed, 17 May 2006 17:24:58 -0400 (EDT) Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 8A261445C; Wed, 17 May 2006 17:24:49 -0400 (EDT) Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 6E59F6C80F; Wed, 17 May 2006 17:24:49 -0400 (EDT) Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Wed, 17 May 2006 16:08:11 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca 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:54665 Archived-At: > Stefan had a (what I thought was) clever suggestion to deal with this: > Make "...-mode" functions toggle only when used interactively (just as > they only print a message when used interactively), and otherwise have > them just enable the state unconditionally. > This is an interesting idea. > It would mean that there is no longer an argument you could use, > noninteractively, to toggle the mode. Actually there is: the symbol `toggle' does it. > Another drawback is simply that the interactive and noninteractive > behavior of these commands will be different. Not really. It just means that the argument passed to the minor mode function in the absence of a prefix-arg won't be nil but will be `toggle'. As a matter of fact, this is already the case. The current code already emits a warning when the minor mode is called with a nil argument and the minor mode is already enabled (i.e. when a nil argument is used to toggle the mode off). Stefan