mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-25 02:02:52 +00:00
Fix bug when narrowing to subtree with point at an inline task
* lisp/org.el (org-narrow-to-subtree): ensure `org-back-to-heading' will move point to a real heading and not an inline task by wraping function into a org-with-limited-levels macro.
This commit is contained in:
parent
df7f2bf3d9
commit
1e59039f8c
11
lisp/org.el
11
lisp/org.el
|
@ -7579,11 +7579,12 @@ If yes, remember the marker and the distance to BEG."
|
|||
(interactive)
|
||||
(save-excursion
|
||||
(save-match-data
|
||||
(narrow-to-region
|
||||
(progn (org-back-to-heading t) (point))
|
||||
(progn (org-end-of-subtree t t)
|
||||
(if (and (org-on-heading-p) (not (eobp))) (backward-char 1))
|
||||
(point))))))
|
||||
(org-with-limited-levels
|
||||
(narrow-to-region
|
||||
(progn (org-back-to-heading t) (point))
|
||||
(progn (org-end-of-subtree t t)
|
||||
(if (and (org-on-heading-p) (not (eobp))) (backward-char 1))
|
||||
(point)))))))
|
||||
|
||||
(defun org-narrow-to-block ()
|
||||
"Narrow buffer to the current block."
|
||||
|
|
Loading…
Reference in a new issue