From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Proulx Newsgroups: gmane.emacs.help Subject: Why flip RET and C-j with electric-indent-mode? Date: Fri, 28 Nov 2014 15:56:30 -0700 Message-ID: <20141128153825244895059@bob.proulx.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1417215424 32743 80.91.229.3 (28 Nov 2014 22:57:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Nov 2014 22:57:04 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 28 23:56:58 2014 Return-path: Envelope-to: geh-help-gnu-emacs@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 1XuUTB-0008No-Ew for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Nov 2014 23:56:57 +0100 Original-Received: from localhost ([::1]:46259 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuUTA-0002MD-En for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Nov 2014 17:56:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuUSt-0002M5-Nb for help-gnu-emacs@gnu.org; Fri, 28 Nov 2014 17:56:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XuUSn-0006Cr-IQ for help-gnu-emacs@gnu.org; Fri, 28 Nov 2014 17:56:39 -0500 Original-Received: from joseki.proulx.com ([216.17.153.58]:38454) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuUSn-0006Cn-A5 for help-gnu-emacs@gnu.org; Fri, 28 Nov 2014 17:56:33 -0500 Original-Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 6104D21835 for ; Fri, 28 Nov 2014 15:56:31 -0700 (MST) Original-Received: by hysteria.proulx.com (Postfix, from userid 1000) id 106F32DC2E; Fri, 28 Nov 2014 15:56:30 -0700 (MST) Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 216.17.153.58 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:101283 Archived-At: So why did emacs flip RET and C-j with electric-indent-mode? It has always been that typing RET in fundamental mode would insert a newline. C-j would insert a newline and indent. This is now broken in emacs24.4 and later. Now those two actions are reversed! Aaarrrgghh! Here is the news entry. * Editing Changes in Emacs 24.4 ** Indentation *** `electric-indent-mode' is now enabled by default. Typing RET reindents the current line and indents the new line. `C-j' inserts a newline but does not indent. In some programming modes, additional characters are electric (eg `{'). *** New buffer-local `electric-indent-local-mode'. The change is to set electric-indent-mode all of the time. Even in fundamental-mode? That is a terrible thing to do to users. Rug. Standing on rug? Yank rug! Bob The previous online help for RET: RET (translated from ) runs the command newline, which is an interactive compiled Lisp function in `simple.el'. It is bound to RET. (newline &optional ARG) Insert a newline, and move to left margin of the new line if it's blank. If `use-hard-newlines' is non-nil, the newline is marked with the text-property `hard'. With ARG, insert that many newlines. Call `auto-fill-function' if the current column number is greater than the value of `fill-column' and ARG is nil. In the latest emacs24 RET now does: RET runs the command newline, which is an interactive compiled Lisp function in `simple.el'. It is bound to RET. (newline &optional ARG INTERACTIVE) Insert a newline, and move to left margin of the new line if it's blank. If option `use-hard-newlines' is non-nil, the newline is marked with the text-property `hard'. With ARG, insert that many newlines. If `electric-indent-mode' is enabled, this indents the final new line that it adds, and reindents the preceding line. To just insert a newline, use M-x electric-indent-just-newline. Calls `auto-fill-function' if the current column number is greater than the value of `fill-column' and ARG is nil. A non-nil INTERACTIVE argument means to run the `post-self-insert-hook'.