diff options
author | Bastien <bzg@gnu.org> | 2020-02-21 16:12:11 +0100 |
---|---|---|
committer | Bastien <bzg@gnu.org> | 2020-02-21 16:12:11 +0100 |
commit | 05f294ec5b77e059bd09137d5ca7d1cfb3529e99 (patch) | |
tree | f2ccfc4f75249beafdb527f79ae6486a32ba3bd8 | |
parent | 88d218a5a085a2c0484141b3b39e1fc2bc8cce44 (diff) | |
download | org-mode-05f294ec5b77e059bd09137d5ca7d1cfb3529e99.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.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/org.el b/lisp/org.el index 81a0bf7..3d841df 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -12345,7 +12345,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. @@ -20394,7 +20396,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) |