From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Frozenlock Newsgroups: gmane.emacs.devel Subject: Re: New minor mode toggling in V24 Date: Fri, 20 Jan 2012 13:01:24 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1327082506 19141 80.91.229.12 (20 Jan 2012 18:01:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 20 Jan 2012 18:01:46 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 20 19:01:42 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RoImR-0004sx-LV for ged-emacs-devel@m.gmane.org; Fri, 20 Jan 2012 19:01:39 +0100 Original-Received: from localhost ([::1]:57346 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RoImQ-0006R8-Vb for ged-emacs-devel@m.gmane.org; Fri, 20 Jan 2012 13:01:38 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:37751) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RoImK-0006Pt-SU for emacs-devel@gnu.org; Fri, 20 Jan 2012 13:01:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RoImE-00023U-68 for emacs-devel@gnu.org; Fri, 20 Jan 2012 13:01:32 -0500 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:53418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RoImD-00023F-R8 for emacs-devel@gnu.org; Fri, 20 Jan 2012 13:01:25 -0500 Original-Received: by iadj38 with SMTP id j38so1491484iad.0 for ; Fri, 20 Jan 2012 10:01:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=g5dSifNkIELurfu9L32QC0YCSleb5zDjpMyU2NgOeo8=; b=ior525OJkMyhOhsRXaYS3HadZz/q35LPdNegzYb0uevg5tQBhIn8WsOpeU2bVFz0RL 0BGAUs3TKlwUYVCRa/BFwGhtlIr269smPC7nuSm+o5h4lvOv19sfhXQhG25e8rrLRZ6w uJXWbKPjmGyHHET7WdgwI8XPOWjAHVZAQcn3Y= Original-Received: by 10.50.186.226 with SMTP id fn2mr33710644igc.25.1327082484645; Fri, 20 Jan 2012 10:01:24 -0800 (PST) Original-Received: by 10.42.166.70 with HTTP; Fri, 20 Jan 2012 10:01:24 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.210.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:147783 Archived-At: Thank you for the answer. I do prefer to use (foo-mode 'toggle), thanks for the suggestion! Alas, this precious info isn't in the foo-mode documentation (C-h f). Unless it's somewhere else and I simply missed it, could it be added in the mode documentation? Christian On Fri, Jan 20, 2012 at 8:55 AM, Stefan Monnier wrote: >> ARG nil --> toggle >> ARG 1 =A0 --> on >> ARG -1 =A0--> off > > That's what happened in the past and we changed it, so clearly we're not > going back there. > Toggling non-interactively is a very rare need. =A0But you can do it with > (foo-mode 'toggle) if you don't like (foo-mode (if foo-mode -1 1)). > > > =A0 =A0 =A0 =A0Stefan > > > PS: In case you wonder about the reason for the change, it's for > (add-hook 'foo-mode-hook 'bar-mode), eliminating the "need" for those > otherwise redundant turn-on-foo-mode.