From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Frozenlock Newsgroups: gmane.emacs.devel Subject: New minor mode toggling in V24 Date: Thu, 19 Jan 2012 19:49:53 -0500 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1327027343 8900 80.91.229.12 (20 Jan 2012 02:42:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 20 Jan 2012 02:42:23 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 20 03:42:20 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 1Ro4Ql-0001e2-Go for ged-emacs-devel@m.gmane.org; Fri, 20 Jan 2012 03:42:19 +0100 Original-Received: from localhost ([::1]:45968 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ro4Ql-00088e-0z for ged-emacs-devel@m.gmane.org; Thu, 19 Jan 2012 21:42:19 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:39876) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ro2fz-0005JD-VT for emacs-devel@gnu.org; Thu, 19 Jan 2012 19:49:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ro2fy-0006va-Ps for emacs-devel@gnu.org; Thu, 19 Jan 2012 19:49:55 -0500 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:49397) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ro2fy-0006vO-Ll for emacs-devel@gnu.org; Thu, 19 Jan 2012 19:49:54 -0500 Original-Received: by iadj38 with SMTP id j38so88095iad.0 for ; Thu, 19 Jan 2012 16:49:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=1BfbK+NM36t8eH8R0s7tmc4LZjJ0FgFcm4Nkiy4r9tY=; b=XcbEfU6hK0a38fa12hB3w19NApIca7qIa+n3Bulj+SsD/rBZLn5GGtMSgtu88qUB3B GmFFPALxxHRTtlR95rJMBr8NjaLungIWJbPWkfw7g3YlBpnygHfTRMR4Ubl0x/com4mt ggxwrOoGqFWq1fxSCq7Ao5/qxbxH4iksGMP84= Original-Received: by 10.50.10.199 with SMTP id k7mr23847530igb.25.1327020593302; Thu, 19 Jan 2012 16:49:53 -0800 (PST) Original-Received: by 10.42.166.70 with HTTP; Thu, 19 Jan 2012 16:49:53 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.210.169 X-Mailman-Approved-At: Thu, 19 Jan 2012 21:42:16 -0500 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:147752 Archived-At: Dear GNU Emacs developers, I've noticed that I can no longer use the form (some-minor-mode) to toggle a minor mode on and off in a function. The function's documentation now says "If called from Lisp, enable the mode if ARG is omitted or nil." My understanding of Lisp would have led me into thinking that a mode is on when true and off when nil. Of course, I'm sure there's a good reason for this, such as the "toggling" behavior. However, that a function could behave differently when called interactively violates the principle of least astonishment. _Especially_ for functions used as often as modes. If only it was that... Now to toggle a mode inside a function, I do something like this: (some-minor-mode (when some-minor-mode-variable) -1) Yet, some modes do not name the some-minor-mode-variable the same as the mode itself, making the action of toggling a mode a one of a kind, built only for this mode. Could minor-modes function behave the same when called by a function as they would if called interactively? I believe The toggling would be easier to understand for everyone (at least for myself). ARG nil --> toggle ARG 1 --> on ARG -1 --> off Thank you for your time, Christian Fortin