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: Thu, 18 Jan 2024 16:45:25 +0000


Ihor Radchenko writes:
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.
What about a simpler approach - indent the line at point to block's
expected indentation (if it is not yet there) and then rely upon the
code block's major mode to do the right thing?

I cannot think of any common use where the two approches differ, and
it is indeed simpler. The possibility that the block does not have the
common indentation still stands.

--
Sébastien Miquel



reply via email to

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