summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien <bzg@gnu.org>2020-02-21 16:12:11 +0100
committerBastien <bzg@gnu.org>2020-02-21 16:12:28 +0100
commit450452de4b790706d187291f9f71a286f8f62004 (patch)
treee127a5f449e9500faf8739c56b938857016c33a5
parent4cd497416fe52188b8ab132a827b10e5746489ee (diff)
downloadorg-mode-450452de4b790706d187291f9f71a286f8f62004.tar.gz
org.el: Two minor fixes
* lisp/org.el (org-set-tags-command): Fix point position after setting tag at the beginning of a blank heading. (org-kill-line): Prevent from throwing an error when killing the headline while point is right after the * chars.
-rw-r--r--lisp/org.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 1f77143..507c126 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11660,7 +11660,9 @@ in Lisp code use `org-set-tags' instead."
#'org-tags-completion-function
nil nil (org-make-tag-string current-tags)
'org-tags-history)))))))
- (org-set-tags tags)))))))
+ (org-set-tags tags)))))
+ ;; `save-excursion' may not replace the point at the right position:
+ (when (looking-back "^\*+") (forward-char))))
(defun org-align-tags (&optional all)
"Align tags in current entry.
@@ -19792,7 +19794,8 @@ depending on context."
(if (<= end (point)) ;on tags part
(kill-region (point) (line-end-position))
(kill-region (point) end)))
- (org-align-tags))
+ ;; Only align tags when we are still on a heading:
+ (if (org-at-heading-p) (org-align-tags)))
(t (kill-region (point) (line-end-position)))))
(defun org-yank (&optional arg)