branch: elpa/org-tree-slide commit a0a03e75f4d283388237c8dd14deac02beb6eb08 Author: bennati <st.benn...@gmail.com> Commit: bennati <st.benn...@gmail.com>
Show content after last slide Last slide is defined as the last visible heading --- org-tree-slide.el | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/org-tree-slide.el b/org-tree-slide.el index 78fa7d63ab..c8a88f735b 100644 --- a/org-tree-slide.el +++ b/org-tree-slide.el @@ -408,19 +408,23 @@ Profiles: (unless (equal org-tree-slide-modeline-display 'outside) (message " Next >>")) (cond + ((and (org-tree-slide--narrowing-p) ;displaying a slide, not the contents + (org-tree-slide--last-tree-p (progn (beginning-of-line) (point)))) ;the last subtree + (org-tree-slide-content)) ((or (or (and (org-tree-slide--before-first-heading-p) (not (org-at-heading-p))) (and (= (point-at-bol) 1) (not (org-tree-slide--narrowing-p)))) (or (org-tree-slide--first-heading-with-narrow-p) (not (org-at-heading-p)))) - (run-hooks 'org-tree-slide-before-move-next-hook) + (run-hooks 'org-tree-slide-before-move-next-hook) (widen) - (org-tree-slide--outline-next-heading)) + (org-tree-slide--outline-next-heading) + (org-tree-slide--display-tree-with-narrow)) ;; stay the same slide (for CONTENT MODE, on the subtrees) - (t nil)) + (t nil (org-tree-slide--display-tree-with-narrow))) ;; (when (and org-tree-slide-skip-done (looking-at (concat "^\\*+ " org-not-done-regexp))) (org-clock-in) ) - (org-tree-slide--display-tree-with-narrow))) + )) (defun org-tree-slide-move-previous-tree () "Display the previous slide" @@ -795,9 +799,13 @@ Profiles: (defun org-tree-slide--beginning-of-tree () "Return beginning point of the line, or t. If the position does not exist in the buffer, then return nil." (beginning-of-line) - (if (org-at-heading-p) - (point) - (outline-previous-heading))) ; return position or nil. + (if (org-tree-slide--heading-level-skip-p) ;if the header has to be skipped + (progn + (outline-previous-heading) ;go to previous heading + (org-tree-slide--beginning-of-tree)) ;recursion until a visible heading is found + (if (org-at-heading-p) + (point) + (outline-previous-heading)))) ; return position or nil. (provide 'org-tree-slide)