org-indent-drawer, org-indent-block: Remove unnecessary checks

* lisp/org.el:
(org-indent-block):
(org-indent-drawer): Do not try to check drawer/block twice.
This commit is contained in:
Ihor Radchenko 2023-05-09 16:22:10 +02:00
parent f63000cca8
commit 1c7c67b3c6
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 2 additions and 11 deletions

View File

@ -19179,11 +19179,7 @@ assumed to be significant there."
(defun org-indent-drawer ()
"Indent the drawer at point."
(interactive)
(unless (save-excursion
(beginning-of-line)
(looking-at-p org-drawer-regexp))
(user-error "Not at a drawer"))
(let ((element (org-element-at-point-no-context)))
(let ((element (org-element-at-point)))
(unless (org-element-type-p element '(drawer property-drawer))
(user-error "Not at a drawer"))
(org-with-wide-buffer
@ -19194,12 +19190,7 @@ assumed to be significant there."
(defun org-indent-block ()
"Indent the block at point."
(interactive)
(unless (save-excursion
(beginning-of-line)
(let ((case-fold-search t))
(looking-at-p "[ \t]*#\\+\\(begin\\|end\\)_")))
(user-error "Not at a block"))
(let ((element (org-element-at-point-no-context)))
(let ((element (org-element-at-point)))
(unless (org-element-type-p
element
'(comment-block center-block dynamic-block example-block