Hi Leo,
feel free to fix this in Emacs - I will update Emacs only after the
next Emacs release - it is too much work for me to make partial fixes.
- Carsten
On Mar 3, 2010, at 5:41 PM, Leo wrote:
Only if debian fixed this bug.
I can reproduce this bug on Gnu/Linux with these steps.
1. git clone --depth 1 git://repo.or.cz/org-mode.git
2. go into the lisp dir and start emacs like this: emacs -q -L .
3. goto the scratch buffer and 'M-x org-mode' and then 'C-RET'
The following patch from the master branch should fix this bug.
Carsten,
would you be able to fix it in Emacs upstream? Many thanks. Leo.
--- a/org.el 2010-03-03 16:36:22.000000000 +0000
+++ b/org.el 2010-03-03 16:37:09.000000000 +0000
@@ -5965,21 +5965,26 @@
(save-match-data
(looking-at "[ \t]*$")))))
-(defun org-insert-heading (&optional force-heading)
+(defun org-insert-heading (&optional force-heading invisible-ok)
"Insert a new heading or item with same depth at point.
If point is in a plain list and FORCE-HEADING is nil, create a new
list item.
If point is at the beginning of a headline, insert a sibling before
the
current headline. If point is not at the beginning, do not split
the line,
-but create the new headline after the current line."
- (interactive "P")
- (if (= (buffer-size) 0)
+but create the new headline after the current line.
+When INVISIBLE-OK is set, stop at invisible headlines when going
back.
+This is important for non-interactive uses of the command."
+ (interactive "P")
+ (if (or (= (buffer-size) 0)
+ (and (not (save-excursion (and (ignore-errors (org-back-to-
heading invisible-ok))
+ (org-on-heading-p))))
+ (not (org-in-item-p))))
(insert "\n* ")
(when (or force-heading (not (org-insert-item)))
(let* ((empty-line-p nil)
(head (save-excursion
(condition-case nil
(progn
- (org-back-to-heading)
+ (org-back-to-heading invisible-ok)
(setq empty-line-p (org-previous-line-empty-p))
(match-string 0))
(error "*"))))
Diff finished. Wed Mar 3 16:37:49 2010
--
H A P P Y H O L I D A Y S!
- Carsten
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode