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: Swapping of C-j and RET bindings is dependent on electric-indent-mode; it shouldn't be. Date: Sun, 9 Feb 2014 16:35:58 +0000 Message-ID: <20140209163558.GB3593@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1391963984 19454 80.91.229.3 (9 Feb 2014 16:39:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Feb 2014 16:39:44 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 09 17:39:51 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 1WCXQ6-0005Og-Gi for ged-emacs-devel@m.gmane.org; Sun, 09 Feb 2014 17:39:50 +0100 Original-Received: from localhost ([::1]:51401 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCXQ6-0002zW-0N for ged-emacs-devel@m.gmane.org; Sun, 09 Feb 2014 11:39:50 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36714) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCXPw-0002zO-PQ for emacs-devel@gnu.org; Sun, 09 Feb 2014 11:39:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WCXPp-0005oE-FZ for emacs-devel@gnu.org; Sun, 09 Feb 2014 11:39:40 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:61677 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCXPp-0005o9-6F for emacs-devel@gnu.org; Sun, 09 Feb 2014 11:39:33 -0500 Original-Received: (qmail 24034 invoked by uid 3782); 9 Feb 2014 16:39:31 -0000 Original-Received: from acm.muc.de (p5492C804.dip0.t-ipconnect.de [84.146.200.4]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 09 Feb 2014 17:39:20 +0100 Original-Received: (qmail 6916 invoked by uid 1000); 9 Feb 2014 16:35:58 -0000 Content-Disposition: inline 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:169501 Archived-At: Hello, Emacs. In the recent past, a consensus was reached that for programming modes, C-j should be bound to `newline' and RET to `newline-and-indent'. The current implementation of "this" works by changing traditional bindings in `global-map' when electric-indent-mode is enabled, and changing them back again when e-i-m is disabled. Apologies if I've misunderstood the source code. This code is in electric-indent-mode itself, in electric.el. Thus the bindings of C-j and RET appear to swap each time e-i-m is {en,dis}abled. This is surely not the Right Thing. A better way would be to put the new bindings for C-j and RET into prog-mode-map and any necessary individual modes which, e.g., don't derive from prog-mode. These binding changes are also made _globally_ when electric-indent-local-mode is enabled for a buffer. They are not restored again when that mode is disabled for the buffer. This is confusing and suboptimal. -- Alan Mackenzie (Nuremberg, Germany).