emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [POLL] Setting `org-adapt-indentation' to nil by default?


From: Tom Gillespie
Subject: Re: [POLL] Setting `org-adapt-indentation' to nil by default?
Date: Sun, 2 May 2021 11:11:19 -0700

Hi Bastien,
    Strong +1 here. Users can get the same visual effect without
materializing the whitespace into the file.

Materializing the whitespace causes many potential issues with source
blocks for languages that have significant whitespace, issues with
#+begin_src and #+end_src having different levels of indentation
(still an issue if you want a block in a plain list), weirdness with
noweb, obligatory two pass parsing to get the spacing correct in
paragraphs, etc.

There are many cases where adapting indentation requires the
specification of extremely detailed heuristics that must be followed
exactly in order to get at least a consistent parse of a source block.
The only sane way forward for a language specification would be to
avoid that leading whitespace or avoid trying to specify the
interpretation of source blocks in contexts with leading whitespace
(src blocks in plain lists may come back to haunt us here).

Setting org-adapt-indentation to nil by default would be a major step
toward resolving these issues and frankly I couldn't ask for more.

Best!
Tom

PS I have included some notes on the worg/dev/org-syntax.org
file that I wrote while working on the formal grammar. I would
qualify what I wrote slightly to state that users could in principle
have leading whitespace before source blocks but that the behavior of
org in such cases would be left unspecified in the not quite nasal
demons sense, but that it might be better to have the behavior
described below with a note that no attempt to deal with correctly
preserving leading whitespace is required, user beware. A final
aside: maybe plain lists could have the #+begin_ and #+end_
lines indented to the level of the plain list but maybe not the body?
-----------------------------

Eliminate leading whitespace in the canonical representation.

There are other ways that make it possible to have the indentation
visibility without adding massive complexity to the implementation.

The existing implementation can continue to support it, but any other
implementation SHALL convert indented sections to the canonical form
where there is NO leading whitespace. This eliminates the problem of
significant whitespace for everything except plain lists.

Users will need a migration path and this will require extensive
testing to make sure that the tooling catches as many of the issues as
possible. However, the benefits in the long run are vastly reduced
complexity without all the risks of accidentally botching an indent
somewhere.



reply via email to

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