org.el (org-add-planning-info): Remove spurious blank line

* org.el (org-add-planning-info): Remove spurious blank line
left after "unclosing" an entry.
This commit is contained in:
Bastien Guerry 2014-12-01 15:36:40 +01:00
parent 25a974a231
commit 92e823c43d
1 changed files with 8 additions and 3 deletions

View File

@ -13532,9 +13532,14 @@ WHAT entry will also be removed."
(otherwise (error "Invalid planning type: %s" type))) (otherwise (error "Invalid planning type: %s" type)))
(line-end-position) t)) (line-end-position) t))
(replace-match "") (replace-match "")
(when (looking-at "--+<[^>]+>") (replace-match "")))) (when (looking-at "--+<[^>]+>") (replace-match ""))
(when (and (not what) (eq type 'closed))
(save-excursion
(beginning-of-line)
(if (looking-at "[ \t]*$")
(delete-region (point) (1+ (point-at-eol)))))))
;; Remove leading white spaces. ;; Remove leading white spaces.
(when (looking-at "[ \t]+") (replace-match ""))) (when (and (not (bolp)) (looking-at "[ \t]+")) (replace-match ""))))
((not what) (throw 'exit nil)) ; Nothing to do. ((not what) (throw 'exit nil)) ; Nothing to do.
(t (insert-before-markers "\n") (t (insert-before-markers "\n")
(backward-char 1) (backward-char 1)