1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-12-03 08:30:03 +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:
Nicolas Goaziou 2011-03-02 21:56:02 +00:00 committed by Bastien Guerry
parent df7f2bf3d9
commit 1e59039f8c

View File

@ -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."