From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#1396: Idea: unify *newline(-and-indent) Date: Mon, 30 Sep 2019 09:19:10 +0200 Message-ID: <87o8z2i74h.fsf@gnus.org> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="176137"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 1396@debbugs.gnu.org To: Daniel Colascione Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 30 09:20:13 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iEpye-000jhv-PF for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Sep 2019 09:20:12 +0200 Original-Received: from localhost ([::1]:46644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iEpyd-00083n-8f for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Sep 2019 03:20:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42074) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iEpyW-00083g-8Z for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2019 03:20:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iEpyV-0004cb-1p for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2019 03:20:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47883) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iEpyU-0004cT-Ur for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2019 03:20:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iEpyU-000115-NG for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2019 03:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Sep 2019 07:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 1396 X-GNU-PR-Package: emacs Original-Received: via spool by 1396-submit@debbugs.gnu.org id=B1396.15698279573834 (code B ref 1396); Mon, 30 Sep 2019 07:20:02 +0000 Original-Received: (at 1396) by debbugs.gnu.org; 30 Sep 2019 07:19:17 +0000 Original-Received: from localhost ([127.0.0.1]:56704 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEpxk-0000zl-Rl for submit@debbugs.gnu.org; Mon, 30 Sep 2019 03:19:17 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:45888) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEpxi-0000zb-CK for 1396@debbugs.gnu.org; Mon, 30 Sep 2019 03:19:15 -0400 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iEpxe-0004Xs-B5; Mon, 30 Sep 2019 09:19:12 +0200 In-Reply-To: (Daniel Colascione's message of "Sun, 31 Aug 2008 05:37:46 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:167830 Archived-At: Daniel Colascione writes: > The newline situation has annoyed me for a long time. Before fixing > it, I figure I'll float the idea here and see what kind of reception I > get. > > In emacs CVS, I found these functions: > > ada-indent-newline-indent-conditional > align-newline-and-indent > c-context-line-break > c-newline-and-indent > electric-pascal-terminate-line > electric-verilog-terminate-and-indent > electric-verilog-terminate-line > html-paragraph > idlwave-newline > m2-newline > message-newline-and-reformat > newline > newline-and-indent > octave-reindent-then-newline-and-indent > reindent-then-newline-and-indent > table--cell-newline-and-indent > vera-electric-return > vhdl-electric-return > > I'm not even counting all the modes that aren't in CVS, or all the > (reindent-)newline(-and-indent) functions grep couldn't find. Why do > we need so many functions for essentially the same thing? I had a look at a handful, and they don't really do the same thing. For instance octave-reindent-then-newline-and-indent does some upcasing, and message-newline-and-reformat inserts four newlines. > Recently, I tried seeing whether I could make newline not kill > trailing whitespace. I'd have to rewrite the newline function quite a > few major modes, and the solution would still be brittle. They all call `newline' in the end (as far as I can see), so the fix could be done there. > Then, take all the functions above and convert them to functions that > can be plugged into interactive-newline-function. The situation we end > up with something like indent-for-tab-command and indent-line-function. > > Is it worth writing the patch? I think the use case is a bit iffy. I do see the attraction of doing something like indent-for-tab-command, but for newline, but... -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no