help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Disabling automatic reindentation of the current line after a newlin


From: Jean Abou Samra
Subject: Re: Disabling automatic reindentation of the current line after a newline
Date: Mon, 24 Oct 2022 17:29:08 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1

Hi,

Thanks for replying.


Le 24/10/2022 à 04:44, Emanuel Berg a écrit :
Emacs doesn't make mistakes, it is always 100% accurate
according to the programming which defines it's bahvior.

If there is a mistake, it's on the behalf of the programmers
and they will be delighted to fix all such bugs.

If they think the behavior is good, and you disagree, you can
change the code or don't use it, or don't use it temporarily
perhaps, also on your own computer where you are unrestricted
to do whatever you want.

If you describe the exact situation we can help you with
that ...

Is this possible?
Can you show an example what you want should happen ...



I have found myself wanting this in several different contexts.

a) When writing Scheme code, sometimes I define a custom macro
that should be indented specially. I know I could look up
how to define a custom indentation format for that macro and
use it in the local variables, but for just one call site
it's handier to just redo it manually.

b) LilyPond contains a C++ file formatted like this:


namespace Lily
{
extern Scm_module module;
typedef Module_variable<module> Variable;

extern Variable all_music_font_encodings;
extern Variable alterations_in_key;
extern Variable backend_testing;
extern Variable bar_glyph_alist;
extern Variable bar_line_calc_glyph_name_for_direction;
extern Variable base_length;


When I press RET to add an entry in that list, Emacs
inserts two spaces, according to the style it has learnt,
so I remove them ... until I remember that the moment
I insert the ending semicolon, the spaces are back.
This annoys me a bit because I removed the spaces manually,
I don't want Emacs to stand in the way.


c) At some point, the Coq mode provided by Proof General
completely removed all indentation on the previous line when
inserting a newline, at least in recent Emacs versions, but
I see that it seems to have been fixed now.


In summary, while the major mode tries to do its best,
sometimes it has a glitch or doesn't exactly do what I want,
and I'd like a handier way to correct those mistakes.

Best,
Jean




reply via email to

[Prev in Thread] Current Thread [Next in Thread]