Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Presentation doesn't narrow focus correctly #53

Open
Lownin opened this issue Jul 15, 2022 · 3 comments
Open

Presentation doesn't narrow focus correctly #53

Lownin opened this issue Jul 15, 2022 · 3 comments
Labels

Comments

@Lownin
Copy link

Lownin commented Jul 15, 2022

The gif in the README over at https://github.com/takaxp/org-tree-slide shows the focus narrowing on subheadings, but currently all subheadings appear to be displayed on the parent slide. Similarly, the parent slide appears even after stepping to the sub-slides. Is there a way to activate the behavior from the gif where each slide, including subslides, are the only slides in view?
Screen Shot 2022-07-14 at 5 04 40 PM

Using Doom on macOS via railwaycat/emacsmacport/emacs-mac

@takaxp takaxp added the Doom label Jul 15, 2022
@takaxp
Copy link
Owner

takaxp commented Jul 15, 2022

(...I will post again...)

@takaxp
Copy link
Owner

takaxp commented Jul 15, 2022

Note: before applying a change described below, please resolve #54.

So, this is happen because of an advice for +org-present--hide-first-heading-maybe-a configured in ~/doom.d/modules/lang/org/contrib/present.el. Regarding updates on org-narrow-to-subtree at 68a44eadac00d07e2b45b10da60e0e3cd6300d6f and 004ac14a5bacf311e3d0f14a7cd8345a49980bef of org.el, the advice should be updated accordingly. I'm not sure the code below is correct in terms of omitting the first heading, but it will resolve the issue on not narrowing at this moment. Please try to replace the original code with the following.

(defadvice! +org-present--hide-first-heading-maybe-a (fn &rest args)
                "Omit the first heading if `+org-present-hide-first-heading' is non-nil."
                :around #'org-tree-slide--display-tree-with-narrow
                (letf!
                 (defun org-narrow-to-subtree (&optional element)
                   "Narrow buffer to the current subtree."
                   (interactive)
                   (save-excursion
                     (save-match-data
                       (org-with-limited-levels
                        (narrow-to-region
                         (progn
                           (when (org-before-first-heading-p)
                             (org-next-visible-heading 1))
                           (org-back-to-heading t)
                           (when +org-present-hide-first-heading
                             (forward-line 1))
                           (point))
                         (progn
                           (org-end-of-subtree t t)
                           (when (and (org-at-heading-p) (not (eobp)))
                             (backward-char 1))
                           (point)))))))
                 (apply fn args)))

@Lownin
Copy link
Author

Lownin commented Jul 20, 2022

The code above works when applied in modules/lang/org/autoload/contrib-present.el

There is an unexpected behavior when using the org-tree-slide-presentation-profile that is indenting the slide header when the current heading is a subheading. It seems to match the indentation level of the subheading though it doesn't affect me in practice since I prefer the simple profile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants