From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: turn-on-*-mode Date: Tue, 16 May 2006 17:31:58 +0200 Message-ID: <85odxyugsx.fsf@lola.goethe.zz> 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 1147794145 9500 80.91.229.2 (16 May 2006 15:42:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 16 May 2006 15:42:25 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 16 17:42:18 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 1Fg1XN-0005Tr-NM for ged-emacs-devel@m.gmane.org; Tue, 16 May 2006 17:32:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fg1XN-0007kl-1R for ged-emacs-devel@m.gmane.org; Tue, 16 May 2006 11:32:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fg1X7-0007jb-Mw for emacs-devel@gnu.org; Tue, 16 May 2006 11:32:25 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fg1X6-0007it-2f for emacs-devel@gnu.org; Tue, 16 May 2006 11:32:24 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fg1X6-0007ii-0B for emacs-devel@gnu.org; Tue, 16 May 2006 11:32:24 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fg1Zk-0007ef-Qe for emacs-devel@gnu.org; Tue, 16 May 2006 11:35:09 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1Fg1X3-00051q-DX for emacs-devel@gnu.org; Tue, 16 May 2006 11:32:23 -0400 Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id 6329C1D1AC87; Tue, 16 May 2006 17:31:59 +0200 (CEST) Original-To: emacs-devel@gnu.org In-Reply-To: (Sam Steingold's message of "Tue, 16 May 2006 11:04:59 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:54584 Archived-At: Sam Steingold writes: >> * Kim F. Storm [2006-05-16 16:52:51 +0200]: >> >> And for non-interactive use, doing (*-mode 1) and (*-mode -1) is the >> preferred interface. >> There are also a number of "toggle-" functions, which IMO is a much >> better interface (just one function, with a simple common prefix). > > I think I should have been more clear about the background. > Yes, in a program, (*-mode *) is better. > Yes, interactively, M-x *-mode is better. > > The only situation where the turn-on-*-mode functions are really needed > is hooks: > (add-hook 'text-mode-hook 'turn-on-auto-fill) > is much better than > (add-hook 'text-mode-hook (lambda () (auto-fill-mode 1))) > > Maybe minor modes that are commonly enabled from hooks should have their > turn-on-* versions? Or maybe we should have something like (defun add-hook-turn-on (hook mode) (add-hook hook `(lambda nil (,mode 1)))) So that one can write (add-hook-turn-on 'text-mode-hook 'auto-fill-mode) -- David Kastrup, Kriemhildstr. 15, 44793 Bochum