From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Karl Fogel Newsgroups: gmane.emacs.devel Subject: Questioning the new behavior of `open-line'. Date: Wed, 11 Nov 2015 12:08:06 -0600 Message-ID: <87vb98csu1.fsf@red-bean.com> Reply-To: Karl Fogel NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1447265304 2590 80.91.229.3 (11 Nov 2015 18:08:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Nov 2015 18:08:24 +0000 (UTC) To: Emacs Development Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 11 19:08:19 2015 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 1ZwZog-0001Xl-AF for ged-emacs-devel@m.gmane.org; Wed, 11 Nov 2015 19:08:18 +0100 Original-Received: from localhost ([::1]:42286 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwZof-0007T8-Om for ged-emacs-devel@m.gmane.org; Wed, 11 Nov 2015 13:08:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwZob-0007Se-4D for emacs-devel@gnu.org; Wed, 11 Nov 2015 13:08:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwZoX-0007Xr-TN for emacs-devel@gnu.org; Wed, 11 Nov 2015 13:08:13 -0500 Original-Received: from mail-yk0-x232.google.com ([2607:f8b0:4002:c07::232]:33829) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwZoX-0007Xd-OX for emacs-devel@gnu.org; Wed, 11 Nov 2015 13:08:09 -0500 Original-Received: by ykfs79 with SMTP id s79so62291443ykf.1 for ; Wed, 11 Nov 2015 10:08:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:reply-to:date:message-id:user-agent :mime-version:content-type; bh=RF9PqeIF09Z75qvaBf8yJaSU5JhxkkN17+OqBqdj2qA=; b=tVGyKR7GkCmzz7zvRvlW3sah0IpFZJF0vTuNRi1Dsz4c2Rc+XpS8+mnZTK5TqdtZAl wkP2Jj3VD0E2g3UpynTYv7vXI8UC7oijf8/ba5gSbQmoXWCP2Jt2vF7UTwKQpQIKFDHk 89N1g/62RLdwU5C0l4oYEkuUS7lp4DIPCwYGGA4qW1zLBbSFRE6aDciHuJ2IodC8zkTP pSy2CfF705BAQSs7M1ofLXVO2aks8n5F1BZg80OZvuTLO0BUJVQNbtKif4RtUR/3WR7w CPwoQ0Ir0kFYkdHja99E3OD3w0OX4HWRPLtXZOcOHP1lgsoUjg7nEECdXbbKtSdX1kE8 JMlQ== X-Received: by 10.13.251.193 with SMTP id l184mr11028955ywf.342.1447265288746; Wed, 11 Nov 2015 10:08:08 -0800 (PST) Original-Received: from floss (74-92-190-114-Illinois.hfc.comcastbusiness.net. [74.92.190.114]) by smtp.gmail.com with ESMTPSA id c5sm11894166ywf.12.2015.11.11.10.08.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Nov 2015 10:08:06 -0800 (PST) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4002:c07::232 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:194115 Archived-At: Recently, `open-line' has started behaving in a new way due to Arthur Malabarba's recent commits [1]. Here is how `open-line' behaves before and after the changes. Suppose you have this text in a buffer, in just about any mode (i.e., not necessarily a programming language mode), and it is indented by two spaces as below: A lovely haiku An example for this bug For Emacs Devel Now place point where the imaginary "X" is below and do C-o (`open-line'): X A lovely haiku An example for this bug For Emacs Devel Formerly, that would literally insert a newline, but not remove the the two spaces of indendation that come *after* the new newline (the two spaces right before "A lovely haiku"). So this would be the result: [...this is the new line; imagine it's blank...] A lovely haiku An example for this bug For Emacs Devel But after the recent commits, those two spaces are removed: [...this is the new line; imagine it's blank...] A lovely haiku An example for this bug For Emacs Devel So now one can no longer just put point in column 0 and type C-o to open a line right before a block of indented text while preserving the block's indentation. This is just a result of `electric-indent-mode' being on by default and `open-line' now being sensitive to `electric-indent-mode', I think. But one of the things I always thought was good about `open-line' was that it *wasn't* sensitive that way -- that you could just put point in a column of your choice and insert a newline, and everything to the right of that column would be preserved after the newline. Arthur was well aware of this change, and even asked about it in his first post in the thread "A few questions about open-line" [2]: > 3. I think, when electric-indent-mode is on, open-line should indent > the line that was created below if it isn't empty. May I go ahead? Had I seen that question at the time, I would have answered "Oh, please don't" :-). But maybe mine is a minority opinion? I encounter the new behavior several times a day, and don't like it; turning off `electric-indent-mode' seems like a drastic solution. But if people generally like this new behavior, I'll certainly live with being in the minority and figure out the appropritae local customization. So do we think this new behavior is the right one? (If it stays, then I'll add an item to NEWS about it.) Best regards, -Karl [1] These two commits (note you have to take them together, as the earlier one accidentally leaves open-line in a syntactically invalid state, and the later one corrects that): commit bd4f04f86cea893e3369decdda074a4898491518 Author: Artur Malabarba Date: Sat Oct 24 22:26:27 2015 +0100 * lisp/simple.el (open-line): Integrate with electric-indent-mode Also run `post-self-insert-hook' when called interactively. M lisp/simple.el commit 6939896e2ffe2e742954c14bba6129af456f0857 Author: Artur Malabarba Date: Sat Oct 24 22:24:09 2015 +0100 * lisp/simple.el (open-line): Fix docstring Also explain apparently redundant line. M lisp/simple.el [2] https://lists.gnu.org/archive/html/emacs-devel/2015-10/threads.html#02107