emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Outline and org-mode don't insert text into folded sections logically
@ 2011-09-03 19:14 Kelly Dean
  2011-09-05  7:52 ` Giovanni Ridolfi
  0 siblings, 1 reply; 25+ messages in thread
From: Kelly Dean @ 2011-09-03 19:14 UTC (permalink / raw)
  To: emacs-orgmode

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.

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2011-11-03  1:29 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-03 19:14 Outline and org-mode don't insert text into folded sections logically Kelly Dean
2011-09-05  7:52 ` Giovanni Ridolfi
2011-09-05  8:01   ` suvayu ali
2011-10-22 10:13     ` Bastien
2011-10-22 10:17       ` suvayu ali
2011-10-22 10:21       ` Jambunathan K
2011-10-22 13:53         ` Bastien
2011-10-23  2:18           ` suvayu ali
2011-10-29 14:10             ` Bastien
2011-10-29 14:57               ` suvayu ali
2011-10-29 15:40                 ` Bastien
2011-10-29 15:53                   ` suvayu ali
2011-10-29 16:15                     ` Bastien
2011-10-29 16:22                       ` suvayu ali
2011-10-30  1:07                         ` Bastien
2011-10-30  6:28                           ` Carsten Dominik
2011-10-30  7:30                             ` Jambunathan K
2011-10-30  7:47                               ` Carsten Dominik
2011-10-30  9:04                             ` Bastien
2011-10-30 15:37                               ` Carsten Dominik
2011-10-31 20:58                                 ` Carsten Dominik
2011-11-02  7:12                               ` Carsten Dominik
2011-11-02 10:10                                 ` Bastien
2011-11-02 12:53                                   ` Carsten Dominik
2011-11-03  1:30                                     ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).