From unknown Sun Jun 22 00:18:42 2025 X-Loop: don@donarmstrong.com Subject: bug#1396: Idea: unify *newline(-and-indent) Reply-To: Daniel Colascione , 1396-quiet@debbugs.gnu.org Resent-From: Daniel Colascione Original-Sender: Glenn Morris Resent-To: Resent-Date: Thu, 20 Nov 2008 21:30:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1396 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by quiet@emacsbugs.donarmstrong.com id=Q.122721620816008 (code Q ref -1); Thu, 20 Nov 2008 21:30:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-10.9 required=4.0 tests=BAYES_00,FOURLA, MURPHY_DRUGS_REL8,RCVD_IN_DNSWL_MED,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at quiet) by emacsbugs.donarmstrong.com; 20 Nov 2008 21:23:28 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mAKLNOrK016001 for ; Thu, 20 Nov 2008 13:23:25 -0800 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1L3GzZ-00013K-Iy for quiet@emacsbugs.donarmstrong.com; Thu, 20 Nov 2008 16:23:13 -0500 From: Daniel Colascione To: quiet@debbugs.gnu.org Date: Sun, 31 Aug 2008 05:37:46 -0400 Lines: 81 X-From-Line: emacs-devel-bounces+rgm=gnu.org@gnu.org Sun Aug 31 05:37:15 2008 Received: from mx10.gnu.org ([199.232.76.166]:53305) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KZjMw-0002Vj-8T for rgm@gnu.org; Sun, 31 Aug 2008 05:37:14 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KZjOL-0002x1-Q5 for rgm@gnu.org; Sun, 31 Aug 2008 05:38:47 -0400 Received: from lists.gnu.org ([199.232.76.165]:37849) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KZjOL-0002wp-Aa for rgm@gnu.org; Sun, 31 Aug 2008 05:38:41 -0400 Received: from localhost ([127.0.0.1]:51269 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KZjOL-0003tN-Ay for rgm@gnu.org; Sun, 31 Aug 2008 05:38:41 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KZjNa-0003qt-Vx for emacs-devel@gnu.org; Sun, 31 Aug 2008 05:37:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KZjNY-0003pl-St for emacs-devel@gnu.org; Sun, 31 Aug 2008 05:37:54 -0400 Received: from [199.232.76.173] (port=34833 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KZjNY-0003pg-Lj for emacs-devel@gnu.org; Sun, 31 Aug 2008 05:37:52 -0400 Received: from vpn.merrillpress.com ([64.61.107.78]:35879) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KZjNY-0002g7-4P for emacs-devel@gnu.org; Sun, 31 Aug 2008 05:37:52 -0400 Received: from cpe-76-180-38-217.buffalo.res.rr.com ([76.180.38.217] helo=[192.168.1.103]) by mars.merrillpress.net with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1KZjNW-0007ye-D0 for emacs-devel@gnu.org; Sun, 31 Aug 2008 05:37:50 -0400 X-Mailer: Apple Mail (2.926) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+rgm=gnu.org@gnu.org X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sender: Glenn Morris Severity: wishlist [ resent from http://lists.gnu.org/archive/html/emacs-devel/2008-08/msg01461.html ] The newline situation has annoyed me for a long time. Before fixing=20=20 it, I figure I'll float the idea here and see what kind of reception I=20=20 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=20=20 (reindent-)newline(-and-indent) functions grep couldn't find. Why do=20=20 we need so many functions for essentially the same thing? Recently, I=20=20 tried seeing whether I could make newline not kill trailing=20=20 whitespace. I'd have to rewrite the newline function quite a few major=20=20 modes, and the solution would still be brittle. Why not unify all the newline-and-friends functions? - Cull the above list to three functions interactive-newline (new function) newline-and-indent reindent-then-newline-and-indent - Change the C-m binding in bindings.el to interactive-newline. - Define a new variable, interactive-newline-function, which defaults=20=20 to #'newline. (The existing #'newline would stay the same for backward=20=20 compatibility. I see 122 direct calls to (newline) in current CVS, and=20=20 I bet the callers wouldn't like new behavior.) Change newline-and-indent and reindent-then-newline-and-indent to call=20=20 interactive-newline instead of newline. Have interactive-newline call=20=20 interactive-newline-function. (Which is plain old #'newline by=20=20 default, remember.) Then, take all the functions above and convert them to functions that=20=20 can be plugged into interactive-newline-function. The situation we end=20=20 up with something like indent-for-tab-command and indent-line-function. Is it worth writing the patch? Thanks, Dan (Also =E2=80=93 any objections to making cc-mode and lisp-mode use indent-f= or-=20 tab-command? The lisp tab command has an indent-whole-sexp feature, but that be handled by passing the=20=20 prefix argument to indent-line-function. The cc-mode indent function=20=20 has some tab-or-indent DWIM feature, but isn't it better to put that=20=20 in indent-for-tab-command by extending tab-always-indent?) From unknown Sun Jun 22 00:18:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#1396: Idea: unify *newline(-and-indent) 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 X-GNU-PR-Keywords: To: Daniel Colascione Cc: 1396@debbugs.gnu.org Received: via spool by 1396-submit@debbugs.gnu.org id=B1396.15698279573834 (code B ref 1396); Mon, 30 Sep 2019 07:20:02 +0000 Received: (at 1396) by debbugs.gnu.org; 30 Sep 2019 07:19:17 +0000 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 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 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 From: Lars Ingebrigtsen References: Date: Mon, 30 Sep 2019 09:19:10 +0200 In-Reply-To: (Daniel Colascione's message of "Sun, 31 Aug 2008 05:37:46 -0400") Message-ID: <87o8z2i74h.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: 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 [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 From unknown Sun Jun 22 00:18:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#1396: Idea: unify *newline(-and-indent) Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 Jun 2021 10:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 1396 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Daniel Colascione Cc: 1396@debbugs.gnu.org Received: via spool by 1396-submit@debbugs.gnu.org id=B1396.162271501310383 (code B ref 1396); Thu, 03 Jun 2021 10:11:01 +0000 Received: (at 1396) by debbugs.gnu.org; 3 Jun 2021 10:10:13 +0000 Received: from localhost ([127.0.0.1]:42605 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lokIn-0002hP-6y for submit@debbugs.gnu.org; Thu, 03 Jun 2021 06:10:13 -0400 Received: from quimby.gnus.org ([95.216.78.240]:41812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lokIl-0002h2-R7 for 1396@debbugs.gnu.org; Thu, 03 Jun 2021 06:10:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Kvrc4K11ZuYxTErcQIpq6NGETQJXtdRbv/8E/W6Er48=; b=E1ozxk2ZL4KeZgt8b/R8jJF3YC oQCCI0c4nCdpXO7KN6jNa82U+W/15k+f4/hlPYzo8iwUfCeNiAuVZJ0oi5fMO0nhGqps9dcx3sxqk MMKkDL/9JAMNQs1p7F6lsDkNMs6VCSBqFtiejkZWTH5bKQLzwXa89waqLd9JCJpuCm70=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lokId-0000nX-Qm; Thu, 03 Jun 2021 12:10:06 +0200 From: Lars Ingebrigtsen References: <87o8z2i74h.fsf@gnus.org> X-Now-Playing: Little Simz's _Grey Area_: "Offence" Date: Thu, 03 Jun 2021 12:10:03 +0200 In-Reply-To: <87o8z2i74h.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 30 Sep 2019 09:19:10 +0200") Message-ID: <87bl8n45tw.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Lars Ingebrigtsen writes: >> 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 thin [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Lars Ingebrigtsen writes: >> 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. So I'm closing this bug report. It may be that some of these functions should be unified, but that has to be done on a case-to-case basis. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 03 06:10:17 2021 Received: (at control) by debbugs.gnu.org; 3 Jun 2021 10:10:17 +0000 Received: from localhost ([127.0.0.1]:42608 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lokIr-0002hg-DT for submit@debbugs.gnu.org; Thu, 03 Jun 2021 06:10:17 -0400 Received: from quimby.gnus.org ([95.216.78.240]:41830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lokIq-0002hE-9F for control@debbugs.gnu.org; Thu, 03 Jun 2021 06:10:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=f2UpKGSTlDMG9rCcrOsthok15f6YN1NeOwcvpxIVe0s=; b=sKpUuUd5SaoF31GcOjFs64ZYtW 3VgerbbGhhKFs0mmcsXtv4sQvaR1C1vhrkjdOP5FlpKZfcazQTMogNg58OW0awsW4aaGiGkgG/qz9 FLmwAZrWr9/EbpDbK9BeqqK7587AWULTe5pp6JGaPQ8o2F493YaY0lm4L+yMJRZL8BIo=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lokIi-0000nf-Uw for control@debbugs.gnu.org; Thu, 03 Jun 2021 12:10:10 +0200 Date: Thu, 03 Jun 2021 12:10:08 +0200 Message-Id: <87a6o745tr.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #1396 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 1396 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) close 1396 quit