howardabrams / demo-it

An Emacs package for running demonstrations, screencasts and presentations from within Emacs.
GNU General Public License v2.0
324 stars 32 forks source link

demo-it--presentation-section cannot find section when buffer is narrowed by ord-tree-slide #22

Open cdmojoli opened 1 month ago

cdmojoli commented 1 month ago

I call (demo-it-presentation) repeatedly during a presentation, to navigate to arbitrary headers. (I chose not use (demo-it-presentation-advance).) org-tree-slide leaves the buffer narrowed, so demo-it-presentation-section fails.

This solves my problem:

--- /home/cdmojoli/.emacs.d/elpa/demo-it-20211221.2152/demo-it-present.el
+++ #<buffer demo-it-present.el>
@@ -166,6 +166,7 @@
     (when (fboundp 'org-tree-slide-mode)
       (org-tree-slide-content))

+    (widen)
     (goto-char (point-min))
     (re-search-forward (format "^\*+ +%s" section))

It works for me, but I have not tested for side effects.

cdmojoli commented 1 month ago

Not a good solution, it breaks other features. Reworked to use demo-it-presentation-advance.