emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [BUG] defaults make it hard to edit Elisp blocks in org buffers


From: Sébastien Miquel
Subject: Re: [BUG] defaults make it hard to edit Elisp blocks in org buffers
Date: Wed, 17 Jan 2024 20:04:57 +0000

Hi,

The issue is that when you press return, you insert a newline, with no
indentation, then call =org-indent-line= which edits the block in a
native buffer. This is supposed to remove any common indentation, but
there is now none. Then it reinserts the code in the org-buffer,
adding a new common indentation to the block.

If I recall correctly, in order to fix this, in =org-indent-line=,
before calling =TAB= in the native buffer, one should check the
current line indentation and if it is less than =block-content-ind=,
start by adding this much indentation to the current line.

This could be a bit fragile, and in particular it assumes that the
rest of the block has this =block-content-ind=, which might not be the
case. One could possibly at least check that the first line of the
block does have this much indentation. If it doesn't, just do
whatever.

--
Sébastien Miquel



reply via email to

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