summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus <rasmus@gmx.us>2015-05-21 00:44:06 +0200
committerRasmus <rasmus@gmx.us>2015-05-21 00:45:24 +0200
commit8ddb844d277e5b5e59745e4151443be2019f26f4 (patch)
treedaedd365f8ac2899064d0a74493b8266490df459
parent248266e560e60559c72e1817747880ea36da1040 (diff)
downloadorg-mode-8ddb844d277e5b5e59745e4151443be2019f26f4.tar.gz
org.el: Fix bug in af6fdf30718158f
* org.el (org-return): Fix bug when headline title is empty.
-rwxr-xr-xlisp/org.el19
1 files changed, 10 insertions, 9 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 5c54125..f10412f 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -21227,15 +21227,16 @@ object (e.g., within a comment). In these case, you need to use
(save-excursion (goto-char (match-beginning 5))
(current-column))))
;; Test if before or after headline title.
- (string (when (not (or (< (point)
- (or (match-end 3)
- (match-end 2)
- (save-excursion
- (goto-char (match-beginning 4))
- (skip-chars-backward " \t")
- (point))))
- (and (match-beginning 5)
- (>= (point) (match-beginning 5)))))
+ (string (when (and (match-end 4)
+ (not (or (< (point)
+ (or (match-end 3)
+ (match-end 2)
+ (save-excursion
+ (goto-char (match-beginning 4))
+ (skip-chars-backward " \t")
+ (point))))
+ (and (match-beginning 5)
+ (>= (point) (match-beginning 5))))))
;; Point is on headline keywords, tags or cookies. Do not break
;; them: add a newline after the headline instead.
(org-string-nw-p