From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] trunk r116461: Connect electric-indent-mode up with CC Mode. Bug #15478. Date: Sun, 2 Mar 2014 11:51:18 +0000 Message-ID: <20140302115118.GA3768@acm.acm> References: <20140222182704.GA2639@acm.acm> <20140228195051.GA3446@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1393761303 5235 80.91.229.3 (2 Mar 2014 11:55:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Mar 2014 11:55:03 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 02 12:55:11 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WK4z8-00085A-8g for ged-emacs-devel@m.gmane.org; Sun, 02 Mar 2014 12:55:10 +0100 Original-Received: from localhost ([::1]:35117 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WK4z7-00089U-Q1 for ged-emacs-devel@m.gmane.org; Sun, 02 Mar 2014 06:55:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39527) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WK4yx-0007oq-Nb for emacs-devel@gnu.org; Sun, 02 Mar 2014 06:55:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WK4yq-0001E9-Dw for emacs-devel@gnu.org; Sun, 02 Mar 2014 06:54:59 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:48492 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WK4yq-0001Dy-4C for emacs-devel@gnu.org; Sun, 02 Mar 2014 06:54:52 -0500 Original-Received: (qmail 85760 invoked by uid 3782); 2 Mar 2014 11:54:49 -0000 Original-Received: from acm.muc.de (pD9518496.dip0.t-ipconnect.de [217.81.132.150]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 02 Mar 2014 12:54:48 +0100 Original-Received: (qmail 4057 invoked by uid 1000); 2 Mar 2014 11:51:18 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 8.x X-Received-From: 193.149.48.1 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:170049 Archived-At: Hello, Stefan. On Sat, Mar 01, 2014 at 10:57:34AM -0500, Stefan Monnier wrote: > >> > The other bit takes over the value of c-electric-indent-mode into CC > >> > Mode only when it has been set by the user, thus preventing > >> > electric.el's default overriding CC Mode's. > >> For that I think it's better to only obey electric-indent-mode if > >> Emacs>24.3 rather than use the electric-indent-mode-has-been-called crutch. Using version numbers to check for features is not exactly clean coding. > > That does not achieve the same effect. > Can you give a scenario where the result is different? The default for electric-indent-mode is changed in a future Emacs version. > > Please don't do this. I meant literally what I wrote. > Yes, but I hate this electric-indent-mode-has-been-called crutch, so we > need a different solution. > > A better solution would be to provide a less ugly way of checking whether > > a user has called electric-indent-mode > A different way would still be ugly, because this requirement is itself > ugly. We need to find a solution that does not depend on *how* we got > to this state. By "this state" you mean what? The minor mode electric-indent-mode can be in any of three states: (i) left at its default, (ii) set (or toggled) to t, (iii) set (or toggled) to nil. The challenge is to distinguish between (i) and ((ii) or (iii)). > Stefan -- Alan Mackenzie (Nuremberg, Germany).