unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#1396: Idea: unify *newline(-and-indent)
       [not found] <pmmyfu8532.fsf@fencepost.gnu.org>
@ 2019-09-30  7:19 ` Lars Ingebrigtsen
  2021-06-03 10:10   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Lars Ingebrigtsen @ 2019-09-30  7:19 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: 1396

Daniel Colascione <danc@merrillpress.com> 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





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#1396: Idea: unify *newline(-and-indent)
  2019-09-30  7:19 ` bug#1396: Idea: unify *newline(-and-indent) Lars Ingebrigtsen
@ 2021-06-03 10:10   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2021-06-03 10:10 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: 1396

Lars Ingebrigtsen <larsi@gnus.org> 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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-03 10:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <pmmyfu8532.fsf@fencepost.gnu.org>
2019-09-30  7:19 ` bug#1396: Idea: unify *newline(-and-indent) Lars Ingebrigtsen
2021-06-03 10:10   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).