org-set-tags-command: Provide more useful error when before first heading

* lisp/org.el (org-set-tags-command): Produce more useful error
message when point is before first heading.
This commit is contained in:
Ihor Radchenko 2023-04-28 12:58:20 +02:00
parent f067a4bd43
commit 52d9961f50
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 3 additions and 0 deletions

View File

@ -11662,6 +11662,9 @@ in Lisp code use `org-set-tags' instead."
(lambda () (when (org-invisible-p) (org-end-of-subtree nil t))))))
(t
(save-excursion
;; FIXME: We need to add support setting #+FILETAGS.
(when (org-before-first-heading-p)
(user-error "Setting file tags is not supported yet"))
(org-back-to-heading)
(let* ((all-tags (org-get-tags))
(local-table (or org-current-tag-alist (org-get-buffer-tags)))