unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jean Abou Samra <jean@abou-samra.fr>
To: help-gnu-emacs@gnu.org
Cc: incal@dataswamp.org
Subject: Re: Disabling automatic reindentation of the current line after a newline
Date: Mon, 24 Oct 2022 17:29:08 +0200	[thread overview]
Message-ID: <8918cffd-3e23-2e25-37b4-5307ce45489c@abou-samra.fr> (raw)
In-Reply-To: <875ygakkix.fsf@dataswamp.org>

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	other threads:[~2022-10-24 15:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-22 15:18 Disabling automatic reindentation of the current line after a newline Jean Abou Samra
2022-10-24  2:44 ` Emanuel Berg
2022-10-24 15:29   ` Jean Abou Samra [this message]
2022-10-24 21:12     ` Emanuel Berg
  -- strict thread matches above, loose matches on Subject: below --
2022-10-24  9:16 Jean Abou Samra
2022-10-24 17:58 ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-10-25 10:23   ` Anders Munch
2022-10-25 13:03     ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-10-25 13:39       ` Anders Munch
2022-10-26  2:59         ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-10-26  6:04           ` Emanuel Berg
2022-10-26 21:55   ` Jean Abou Samra
2022-10-27  5:44     ` Eli Zaretskii
2022-10-27 16:46     ` Stefan Monnier via Users list for the GNU Emacs text editor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8918cffd-3e23-2e25-37b4-5307ce45489c@abou-samra.fr \
    --to=jean@abou-samra.fr \
    --cc=help-gnu-emacs@gnu.org \
    --cc=incal@dataswamp.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).