From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] trunk r116461: Connect electric-indent-mode up with CC Mode. Bug #15478. Date: Mon, 31 Mar 2014 20:11:58 +0300 Message-ID: <5339A1DE.8030807@yandex.ru> References: <20140319224231.GB4783@acm.acm> <20140322131350.GA3163@acm.acm> <20140322223454.GA3562@acm.acm> <20140324224055.GB3825@acm.acm> <87d2hb9hys.fsf@yandex.ru> <20140326205330.GA3787@acm.acm> <5333DB29.7030403@yandex.ru> <20140330145717.GB3338@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1396285945 10251 80.91.229.3 (31 Mar 2014 17:12:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 31 Mar 2014 17:12:25 +0000 (UTC) Cc: Stefan , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 31 19:12:20 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 1WUfkw-0002wW-KV for ged-emacs-devel@m.gmane.org; Mon, 31 Mar 2014 19:12:18 +0200 Original-Received: from localhost ([::1]:50338 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUfkw-0005dt-5Z for ged-emacs-devel@m.gmane.org; Mon, 31 Mar 2014 13:12:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUfkn-0005Vd-54 for emacs-devel@gnu.org; Mon, 31 Mar 2014 13:12:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WUfkh-0002BX-NN for emacs-devel@gnu.org; Mon, 31 Mar 2014 13:12:09 -0400 Original-Received: from mail-wg0-x22b.google.com ([2a00:1450:400c:c00::22b]:62863) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUfkh-0002BR-Fw for emacs-devel@gnu.org; Mon, 31 Mar 2014 13:12:03 -0400 Original-Received: by mail-wg0-f43.google.com with SMTP id x13so6297180wgg.14 for ; Mon, 31 Mar 2014 10:12:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=soDoS7YXC/GERB2dBTf/KKsQlE2wNs12SW3lFfz1D7Q=; b=dRCc/ybMK6KnC7UU7lImf/rybrGhtAGuZLI8/g1xriIvzZXzB6JPxCVKc7Mr0Xx5Ji Xge/3/AiljjaVi/hV0IwlDofvMqakwPwvHeicSgetjJ0bJ1eI2uhs3X65CYjeuEUQHOG PF3SowQg3FRhez9mJn4CjotU8dG1bsCLvGJL8KZ8hzX85l0S5UxJF7vFrRTfla2hYMmn xf/GQFdw1TZ9yk1VCKb7HEChHxViQpklNWZ1fg4Dgs+hCgcaFzND3XCysipjBuSjRqFC wdyYZgJ1MXxwSo+TBfTcIZPN6os1Nb0vLCrOcJWigeQ/VWIRplfjkBIPb/CscmoZ9r7z FQ6A== X-Received: by 10.180.205.130 with SMTP id lg2mr13721882wic.59.1396285922005; Mon, 31 Mar 2014 10:12:02 -0700 (PDT) Original-Received: from [192.168.0.94] (static-nbl2-118.cytanet.com.cy. [212.31.107.118]) by mx.google.com with ESMTPSA id 4sm34313617eeq.33.2014.03.31.10.11.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 31 Mar 2014 10:12:00 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 In-Reply-To: <20140330145717.GB3338@acm.acm> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::22b 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:171220 Archived-At: On 30.03.2014 17:57, Alan Mackenzie wrote: >> This could be considered a reason to improve the indent-line-function in >> text-mode. `indent-relative' offers behavior that's pretty close. Maybe >> it could be made to follow the behavior of auto-fill even closer. > > Notice, here, how we're no longer talking about electric indentation, but > rather about newline-and-indent. The two topics are distinct. Yes, but I think we're discussing both in this thread. FWIW, I think we're in agreement about electric indentation on RET. See my message here, and also Stefan's reply: http://lists.gnu.org/archive/html/emacs-devel/2014-03/msg00936.html http://lists.gnu.org/archive/html/emacs-devel/2014-03/msg00957.html > Yes, but how? fundamental-mode is a non-programming mode, so the global > key map needs RET set up for newline, C-j for newline-and-indent. That > leaves lots of mode key maps to be set up. At this point, your > suggestion and mine become the same. Maybe. > I usually think of html, markdown, and such like, as the "etc." in > "programming modes (etc.)". Yeah, okay. Which other modes exactly need newline-and-indent on RET could be a matter of debate, but one possible criteria is "mode has a meaningful/specialized indentation function". > If you edit the non-code blocks a lot in text mode, `fill-paragraph' is > _exactly_ what's wanted to restore the filling. If the filling algorithm is perfect, then yes, it could be what's wanted. > I think RET should do the most natural sort of newline, and C-j the > subsidiary one, whatever they may happen to be for a particular mode. Sounds okay, I guess. >> As long as this new mode is divorced from electric-indent-mode, I'd be >> happy. > > This is a key point. It could be something called like `old-newline-keys-mode'. Appropriate major modes would swap RET and C-j bindings, and the above minor mode would force them all back to (RET C-j) -> (newline newline-and-indent). >> This specific behavior is a consequence of using `newline-and-indent'. > > No, not at all. It's a consequence of electric behaviour getting > entangled with newline-and-indent. It's the same if I disable `electric-indent-mode' but bind RET to `newline-and-indent'. And if `electric-indent-mode' didn't do `-and-indent' but retained the electric indent on RET, a similar example is easy to demonstrate: foo bar| Press RET, see the same result. IOW, text-mode could be considered in trouble if RET triggers call to indentation at any line. > The two are completely non-competing situations. RMS's happened because > electric indentation was active where it shouldn't be. AFAICT it's the opposite, but see the scenario above. To quote the bug report: "and point is at the start of the second line" > Your situation is > a matter of binding (RET C-j) to ('newline 'newline-and-indent) the > appropriate way round. Don't confuse these. Indeed, for my usage the above binding is sufficient.