From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Karl Fogel Newsgroups: gmane.emacs.bugs Subject: bug#21884: 25.0.50; Unexpected indentation from `open-line' due to new `electric-indent-mode' default. Date: Thu, 12 Nov 2015 01:57:34 -0600 Message-ID: <871tbvtztd.fsf@red-bean.com> Reply-To: Karl Fogel NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1447315104 20257 80.91.229.3 (12 Nov 2015 07:58:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Nov 2015 07:58:24 +0000 (UTC) To: 21884@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 12 08:58:14 2015 Return-path: Envelope-to: geb-bug-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 1Zwmlo-0004pw-Gi for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Nov 2015 08:58:12 +0100 Original-Received: from localhost ([::1]:45024 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwmln-0004SG-MY for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Nov 2015 02:58:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwmli-0004N6-9I for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2015 02:58:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zwmlf-00009u-2q for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2015 02:58:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43241) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwmle-00009q-VW for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2015 02:58:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Zwmle-0007Ii-H6 for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2015 02:58:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Karl Fogel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Nov 2015 07:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21884 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.144731506728039 (code B ref -1); Thu, 12 Nov 2015 07:58:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 12 Nov 2015 07:57:47 +0000 Original-Received: from localhost ([127.0.0.1]:33949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZwmlO-0007I9-7u for submit@debbugs.gnu.org; Thu, 12 Nov 2015 02:57:46 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:44217) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZwmlM-0007I1-9m for submit@debbugs.gnu.org; Thu, 12 Nov 2015 02:57:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwmlK-000050-NF for submit@debbugs.gnu.org; Thu, 12 Nov 2015 02:57:43 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:52617) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwmlK-00004v-JY for submit@debbugs.gnu.org; Thu, 12 Nov 2015 02:57:42 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwmlJ-0004Bt-6r for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2015 02:57:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwmlG-0008Vm-0e for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2015 02:57:41 -0500 Original-Received: from mail-ig0-x231.google.com ([2607:f8b0:4001:c05::231]:33882) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwmlF-0008Vh-Ro for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2015 02:57:37 -0500 Original-Received: by igvg19 with SMTP id g19so9581674igv.1 for ; Wed, 11 Nov 2015 23:57:37 -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:mime-version :content-type:content-transfer-encoding; bh=+QHcWRdmhfUTaJH3b6z8OiSKufv2FS4AAk5Zyh7zT/M=; b=eCBaNOthrk1dFh8joPpgxstHqxRjAyRZR2XGzEf59i64NpwfPAAnX1DJ1Vj3Re2pEE HlRHMSO5qVRR5hwK8YNr4q5MVj8/flptA/hPWi6EsSSAx4AfmH92o9gUfq6eeQmh/Yj/ 33X9dIWr12VYfn0zBHQ/TInEQpWTm3uHxDSaBNuhgxpq9GHCvibP9w90XD6wnQAsYX4P JDKbV0YuDg7B6sStfvEBeKH8DmNQ4erLSnll1pOLgxwcxxhTqqzoRtBpwWx/coUz28PI 4CiuSBGTfCcParqAL/PYkcYEVutp6pcVtPc0hSIFh/qeNetOpv7/txbqzcn9v2nAf4O+ ut+Q== X-Received: by 10.50.143.1 with SMTP id sa1mr14190876igb.8.1447315057420; Wed, 11 Nov 2015 23:57:37 -0800 (PST) Original-Received: from kdesk (24-148-35-36.c3-0.grn-ubr1.chi-grn.il.cable.rcn.com. [24.148.35.36]) by smtp.gmail.com with ESMTPSA id 184sm4649518ioe.21.2015.11.11.23.57.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Nov 2015 23:57:35 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:108641 Archived-At: Note that this bug report summarizes a discussion on the Emacs Devel mailin= g list -- please check there for updates: "Questioning the new behavior of `open-line'." https://lists.gnu.org/archive/html/emacs-devel/2015-11/threads.html#01100 The problem: Since Artur Malabarba's commits of 2015-10-24 in simple.el, `open-line' has= a new indentation behavior, because those commits made `open-line' sensiti= ve to `electric-indent-mode', which in turn is now on by default. For example, suppose you have the following text in a buffer, in just about= any mode (i.e., not necessarily a programming language mode), and 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 get removed: [...this is the new line; imagine it's blank...] A lovely haiku An example for this bug For Emacs Devel Thus one can no longer just put point in column 0 and type C-o to open a li= ne=20 right before a block of indented text while preserving the block's indentat= ion. Solutions: One solution would be to revert `open-line' to being entirely insensitive t= o `electric-indent-mode'. But Artur points out (in https://lists.gnu.org/a= rchive/html/emacs-devel/2015-11/msg01100.html) that when point is in the mi= ddle of a line, one might want electric-indent behavior from `open-line'. = For instance, in the above example, put point at the first =E2=80=98h=E2=80= =99 and do C-o. If `open-line' just ignores electric-indent, then this wou= ld be the result: A lovely haiku An example for this bug For Emacs Devel Whereas with Artur's changes, the result would be this (which at least some= people, including Artur, would desire): A lovely haiku An example for this bug For Emacs Devel John Wiegley has proposed that `open-line' just be aware of when point is i= n column 0 and not do the electric-indent behavior then. This preserves th= e common use case of C-a C-o, but also preserves Artur's "fix" (for those w= ho agree it is a fix) for when C-o is invoked in the middle of a line. Discussion is ongoing as of this writing.