forked from mirrors/org-mode
org-narrow-to-block: Use element API and handle all the block types
* lisp/org.el (org-narrow-to-block): Narrow to any block type, including dynamic blocks. Use org-element API. Reported-by: pva-outdoor@yandex.ru Link: https://orgmode.org/list/87a5wij05o.fsf@yandex.ru
This commit is contained in:
parent
dc70878fc0
commit
85aa3c1850
|
@ -7303,10 +7303,9 @@ Use the command `\\[widen]' to see the whole buffer again."
|
||||||
Use the command `\\[widen]' to see the whole buffer again."
|
Use the command `\\[widen]' to see the whole buffer again."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let* ((case-fold-search t)
|
(let* ((case-fold-search t)
|
||||||
(blockp (org-between-regexps-p "^[ \t]*#\\+begin_.*"
|
(element (org-element-at-point)))
|
||||||
"^[ \t]*#\\+end_.*")))
|
(if (string-match-p "block" (symbol-name (org-element-type element)))
|
||||||
(if blockp
|
(org-narrow-to-element)
|
||||||
(narrow-to-region (car blockp) (cdr blockp))
|
|
||||||
(user-error "Not in a block"))))
|
(user-error "Not in a block"))))
|
||||||
|
|
||||||
(defun org-clone-subtree-with-time-shift (n &optional shift)
|
(defun org-clone-subtree-with-time-shift (n &optional shift)
|
||||||
|
|
Loading…
Reference in New Issue