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

2011-09-04 Thread Kelly Dean
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.




[O] org-ruby 0.6 released; project needs new maintainer

2011-09-04 Thread Brian Dewey
I just released version 0.6.0 of the org-ruby gem. This native Ruby gem can
convert org-mode files into HTML, which is useful in web services where you
don't want to run a version of Emacs for conversion. For example, this gem
is used on GitHub to render .org for readme files or wiki pages.

At this point, I also want to put a call out to the org community for
someone to take over maintenance of this gem. I no longer use org files
(long story), so working on this code no longer fits into my daily tasks. Is
there anybody with both Org and Ruby experience who wants to run with this
project?

Thanks,

--Brian


[O] [patch] `org-pop-to-buffer-same-window' working with Emacs24

2011-09-04 Thread Eric Schulte
Hi,

I assume this change was required due to changes in Emacs24, but I had
to remove an argument to pop-to-buffer-same-window in
org-pop-to-buffer-same-window to fix editing of source code snippets.

The patch is attached, although I'm not sure if it would break this
function for all other versions of Emacs.

Best -- Eric

>From 6ed9419b73450d6b72392bb040a7ffeacd41f542 Mon Sep 17 00:00:00 2001
From: Eric Schulte 
Date: Sat, 3 Sep 2011 14:01:49 -0600
Subject: [PATCH] remove extra argument in call to pop-to-buffer-same-window

* lisp/org-compat.el (org-pop-to-buffer-same-window): Remove extra
  argument in call to pop-to-buffer-same-window.
---
 lisp/org-compat.el |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index 3e9c202..3577db6 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -438,7 +438,7 @@ With two arguments, return floor and remainder of their quotient."
   "Pop to buffer specified by BUFFER-OR-NAME in the selected window."
   (if (fboundp 'pop-to-buffer-same-window)
   (funcall
-   'pop-to-buffer-same-window buffer-or-name norecord label)
+   'pop-to-buffer-same-window buffer-or-name norecord)
 (funcall 'switch-to-buffer buffer-or-name norecord)))
 
 (provide 'org-compat)
-- 
1.7.4.1


-- 
Eric Schulte
http://cs.unm.edu/~eschulte/


[O] [babel] Collection of code block snippets

2011-09-04 Thread Eric Schulte
Hi,

As I fix bugs and address concerns raised on the mailing list I often
write small snippets of Org-mode text to demonstrate features and
exercise specific behaviors.  I've been compiling these examples into a
single massive scraps.org file which I've finally got around to
publishing.

This is available in
| html | http://eschulte.github.com/org-scraps/ |
| rss  | http://eschulte.github.com/org-scraps/atom.xml |
| git  | https://github.com/eschulte/org-scraps |

I thought this might be useful for those who would like the occasional
Babel example to puzzle over, or as a way to find working examples of
specific behaviors -- e.g., text searching for keywords in the html file
should easily turn up related examples.

Hope this is useful and or fun, I will continue to update it as the
scraps.org file grows.

Cheers -- Eric

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/



Re: [O] [patch] `org-pop-to-buffer-same-window' working with Emacs24

2011-09-04 Thread Bastien
Hi Eric,

Eric Schulte  writes:

> I assume this change was required due to changes in Emacs24, but I had
> to remove an argument to pop-to-buffer-same-window in
> org-pop-to-buffer-same-window to fix editing of source code snippets.

Yes, I already applied this patch -- see commit 4a8634e1.  So the latest
Org version should work okay for you.

> The patch is attached, although I'm not sure if it would break this
> function for all other versions of Emacs.

I assume most people using latest Org version from git also uses latest
Emacs version...  but yes, we might have to improve compatibility in
this area.

Thanks,

-- 
 Bastien



Re: [O] [PATCH]: New Add defun org-mode-or-derived-mode-p

2011-09-04 Thread Stefan Reichör
Tassilo Horn  writes:

> Stefan Reichör  writes:
>
>> +(defun org-mode-or-derived-mode-p ()
>> +  "Check if the current buffer is in Org-mode or a derived mode."
>> +  (if (derived-mode-p 'org-mode) t nil))
>
> The if is superfluous.  And instead of a new function, I'd rather add an
> optional `derived' parameter to `org-mode-p'.

(derived-mode-p 'org-mode) returns either 'org-mode or nil

The reason for the if is, that (org-mode-p) returns either t or nil

The optional derived parameter for org-mode-p is a good idea.
Going one step further I think that using a strict parameter would be
even better.

Because I think that org-mode-p should also return t in derived modes.
Only in some rare cases (org-mode-p t) can be used to allow a strict org-mode 
check.


I'd like to preper a patch. Please tell me, if I should use the derived
or the strict parameter.

Thanks,
  Stefan.