emacs-orgmode
[Top][All Lists]
Advanced

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

[O] Outline and org-mode don't insert text into folded sections logicall


From: Kelly Dean
Subject: [O] Outline and org-mode don't insert text into folded sections logically
Date: Sat, 3 Sep 2011 12:14:59 -0700 (PDT)

Using Emacs 23.2.1, make a buffer in outline mode and enter this:
*1A
Body of 1A
**2A
Body of 2A
***3A
Body of 3A
*1B
Body of 1B

Now, collapse all except the first item, so you have:
*1A
Body of 1A...
*1B...

Put the point at the beginning of the line "*1B...", type "test" and press 
enter. Now you have:
*1A
Body of 1A...
test
*1B...

Which item is the new line "test" part of? It looks like it should be part of 
1A, but that's impossible, due to the use of implicit item termination and the 
existence of items 2A and 3A.
Expanding the text gives:
*1A
Body of 1A
**2A
Body of 2A
***3A
Body of 3A
test
*1B
Body of 1B

So, the new line is part of 3A, which can be confirmed by hiding 3A, which will 
hide both the line "Body of 3A" and "test".

Why is this a problem? Because it's illogical for the new line to appear on 
screen but go into an item which is folded away (besides that, there's not even 
any indication on screen of which item the line is going into). If the new line 
is part of the body of 3A, then shouldn't the entirety of that body (including 
the line "Body of 3A") be shown, rather than just part of it (the line "test")? 
The problem could logically be solved by _not_ printing the line onto the 
screen as it's typed, since it's going into a body which is folded away, but of 
course this would make for a very unfriendly user interface. Alternatively, 
upon typing the first character of the new line, the body of 3A could be 
automatically unfolded (and the heading of 2A unfolded above it) to make it 
obvious where the text is going, but this is also not very friendly, because it 
modifies the folding state without the user's explicit request, and causes a 
potentially large and disorienting
 change in the on-screen display when the user was just trying to type in a 
little bit of text.
The most reasonable solution seems to be to reject the text entry attempt, and 
treat it as though the user is attempting to modify read-only text (which Emacs 
is already capable of handling); just display a message explaining that in 
order to enter text at the current position, the outline must be unfolded. This 
is reasonable (assuming implicitly terminating items by the beginning of the 
next item is even an appropriate model for the outline in the first place, as 
opposed to using an explicit termination symbol) because entering the new line 
"test" under the visual line "Body of 1A..." is most likely not an actual 
attempt by the user to enter the line into the body of 3A; it's much more 
likely a mistake, with the intended destination for the text being somewhere 
else, perhaps even the body of 1A but following the fold, due to the user 
failing to realize that implicit item termination makes that impossible, or 
forgetting that the outline mode is using
 implicit item termination.

Org-mode exhibits the same problem which outline mode does. Put spaces after 
the asterisks as org-mode requires, switch to org-mode, and cycle visibility to 
_overview_ to get:
* 1A...
* 1B...

Put the point at the beginning of the line "* 1B...", type "test2" and press 
enter. Now you have:
* 1A...
test2
* 1B...

Cycle visibility to _show all_, and you see that "test2" has been entered into 
the body of 3A.




reply via email to

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