From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.devel Subject: Re: turn-on-*-mode Date: Tue, 16 May 2006 10:02:44 -0600 Organization: IHS Message-ID: References: <4469D3B6.2040904@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1147796069 18175 80.91.229.2 (16 May 2006 16:14:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 16 May 2006 16:14:29 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 16 18:14:28 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 1Fg2Am-0007AR-9W for ged-emacs-devel@m.gmane.org; Tue, 16 May 2006 18:13:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fg2Al-0003Pe-Bc for ged-emacs-devel@m.gmane.org; Tue, 16 May 2006 12:13:23 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fg28c-0002Qq-S0 for emacs-devel@gnu.org; Tue, 16 May 2006 12:11:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fg28b-0002Q5-SW for emacs-devel@gnu.org; Tue, 16 May 2006 12:11:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fg28b-0002Pt-Nf for emacs-devel@gnu.org; Tue, 16 May 2006 12:11:09 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1Fg2BH-00029v-5F for emacs-devel@gnu.org; Tue, 16 May 2006 12:13:55 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Fg24w-0005hP-Op for emacs-devel@gnu.org; Tue, 16 May 2006 18:07:23 +0200 Original-Received: from 207.167.42.206 ([207.167.42.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 16 May 2006 18:07:22 +0200 Original-Received: from ihs_4664 by 207.167.42.206 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 16 May 2006 18:07:22 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 69 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.206 User-Agent: Thunderbird 1.5.0.2 (Windows/20060308) In-Reply-To: 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:54590 Archived-At: Kim F. Storm wrote: > Lennart Borgman writes: > >> Sam Steingold wrote: >>>> * Richard Stallman [2006-05-16 00:28:34 -0400]: >>>> >>>> What is the policy on the turn-on-*-mode and turn-off-*-mode functions? >>>> Which modes get it and which don't? >>>> >>>> We don't need to have a general policy. > > We could have a general policy to _discurage_ having such functions! We do: neither define-minor-mode nor define-global-minor-mode define turn-on-MODE-mode and turn-off-MODE-mode functions, or even provide an option to do so. >>> OK, so if I want turn-on-flyspell-mode, do I just add it? > > You are free to add whatever you like to your own .emacs file :-) > >> I think that even if Richard says that we do not need a general policy >> there are some advantages (and some drawbacks too of course) with >> having similar structures. The main advantage in my opinion is >> usability. Similar structures reduces unnecessary complexity. It is >> therefore more easy to remember for a user if things works in a >> similar way. >> >> At least I want people using this software to be able to do things >> easily. That way I hope they are doing more of the things I like. > > There are only three "turn-on-" and on "turn-off-" functions defined > in my Emacs with my normal .emacs. Loading more packages may define > more of them, but I really don't want more of them, as this is still > an inconsistent interactive interface! And for non-interactive use, > doing (*-mode 1) and (*-mode -1) is the preferred interface. The reason the turn-on-*-mode and turn-off-*-mode functions exist in the first place is that the (*-mode 1) and (*-mode -1) calls have to be wrapped in a function definition (either a lambda form or a user-defined function) in order to be added to a hook. I think the turn-on-*-mode and turn-off-*-mode functions should be provided for all local minor modes to provide a simpler idiom for that. Global minor modes aren't used that way, are they? > There are also a number of "toggle-" functions, which IMO is a much > better interface (just one function, with a simple common prefix). > > We could even make a M-x toggle command which could toggle any mode > (it should provide a list of known modes as completion choices). > That would also be a good way to learn about new modes. There was a long discussion recently about how to programmatically determine the minor-mode functions and/or variables, partly for the purpose of presenting them to the user... > It might even toggle any boolean variable given a C-u prefix... I had such a command in my .emacs many years ago, but never used it much. `M-x toggle-truncate-lines' is a lot more convenient than `M-x set-variable RET truncate-lines RET ... RET' though! > .. after the release! I hope I live to see it! -- Kevin