From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] trunk r116461: Connect electric-indent-mode up with CC Mode. Bug #15478. Date: Sun, 23 Mar 2014 21:37:09 -0400 Message-ID: References: <20140308225820.GB2726@acm.acm> <20140309123711.GA2615@acm.acm> <20140316223509.GD3854@acm.acm> <20140319224231.GB4783@acm.acm> <20140322131350.GA3163@acm.acm> <20140322223454.GA3562@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1395625043 21978 80.91.229.3 (24 Mar 2014 01:37:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 24 Mar 2014 01:37:23 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 24 02:37:32 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 1WRtpQ-0002SB-Lp for ged-emacs-devel@m.gmane.org; Mon, 24 Mar 2014 02:37:28 +0100 Original-Received: from localhost ([::1]:34095 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WRtpQ-0002o4-1n for ged-emacs-devel@m.gmane.org; Sun, 23 Mar 2014 21:37:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WRtpH-0002nw-7n for emacs-devel@gnu.org; Sun, 23 Mar 2014 21:37:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WRtp9-0005ls-UL for emacs-devel@gnu.org; Sun, 23 Mar 2014 21:37:19 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:46638) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WRtp9-0005le-OY for emacs-devel@gnu.org; Sun, 23 Mar 2014 21:37:11 -0400 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id s2O1b9tD018839; Sun, 23 Mar 2014 21:37:10 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id ADF2F6017C; Sun, 23 Mar 2014 21:37:09 -0400 (EDT) In-Reply-To: <20140322223454.GA3562@acm.acm> (Alan Mackenzie's message of "Sat, 22 Mar 2014 22:34:55 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.2 X-NAI-Spam-Rules: 2 Rules triggered SUBJ_END_HASH_PTRN=0.2, RV4890=0 X-NAI-Spam-Version: 2.3.0.9362 : core <4890> : inlines <634> : streams <1143615> : uri <1708051> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 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:170890 Archived-At: > The actual definition of "electricity" is found in the Emacs manual, page Use in other packages shows that people have understood the notion of "electric" to mean many other things beside the very restricted semantics you point to. >> In Elisp, without electric-indent you have to use C-j or TAB if you >> want your code indented. So whether the user hits C-j or RET is >> relevant. > No. To keep Elisp properly indented, you merely have to depress > whichever key is bound to `newline-and-indent', whether that be RET, or > C-j, or whatever. "whichever key is bound to `newline-and-indent'" would be C-j and not RET in all Emacsen released so far, so I see we violently agree. > Electric indentation doesn't come into it. Of course it does because electric-indent changes the behavior such that RET can be (or has to be in 24.4) used instead of C-j. But you knew that, obviously. > Yes, but the point still stands. You open up a fresh line, by RET, and > type code into it, but don't want to type RET/C-j at the end of it. Fine. Feel free to provide a patch to make split-line auto-indent when electric-indent is enabled. > You'll want electric indentation on some other character you've just > typed. Indeed that's also good. But I don't know of any such character we could use globally in electric-indent-chars, so it's up to each major mode to specify which chars to use. > No. If electric indentation has already happened after typing the > semicolon/comma/brace, the alignment of the subsequent comment will > remain undisturbed. If RET puts the alignment out, you're cursing it. Then I misunderstood and don't know what you're talking about. Can you give a scenario? >> What would be more optimal? > A mode-dependent or buffer-local dependent setting, as well as, rather > than instead of. We have that: electric-indent-local-mode and electric-indent-inhibit. > Why can't we simply have RET bound to `newline-and-indent' and C-j > bound to `newline' in programming modes, as discussed and, pretty much > agreed on, in emacs-devel last autumn? Lack of patch implementing this (supposed) simple change? > Incidentally, in Emacs -Q, Text Mode and Fundamental Mode have gone back > to the unwanted state of RET doing `newline-and-indent'. Should I raise > another bug report? You can, but it's not a bug. It's a feature (not sure what you mean by "back" since it's been this way ever since I enabled electric-indent-mode by default, AFAIK). So make this bug report specific about a particular circumstance where the behavior is undesirable, or about how hard it is to disable it. Stefan