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

Buffer management & controlling presentation from source buffer #5

Open
psionic-k opened this issue Jun 26, 2024 · 1 comment
Open

Comments

@psionic-k
Copy link
Member

psionic-k commented Jun 26, 2024

Currently controlling the slide buffer from the source buffer exposes weakness of the global minor mode approach. I did initially start with an ephemeral minor mode in buffers that were switched into. This was going to require a lot of work to do right, so I think I switched back to a global minor mode.

As a result, if you switch tasks away from a presentation, it's still possible to stumble across your presentation bindings in some random buffer.

I'm considering switching back to a local minor mode to only create bindings in "related" buffers. The issue here is when the user switches to a buffer inside a babel block, how should the new buffer become related? We can detect the change after the fact. How should unbinding occur when that buffer is no longer in use? Again, we can detect the change as long as we store the current buffer when starting commands and then manage this mostly automatically.

When controlling from source, we want to change to the slide-buffer window during the command. This will cause image display etc to happen in the presentation window. Deciding which window this is could become somewhat ambiguous if the user mutates the window configuration sufficiently, but reasonable decisions exist. Complex cases such as a two-window presentation should likely be juggled by the user since only they know what buffers they are attempting to control.

I think all that needs to be done is make some of these states first class and then manage and track them appropriately.

@psionic-k
Copy link
Member Author

#+begin_src elisp :exports none :results none :direction final
  (when-let ((buff (get-buffer "*MoC Focus*")))
    (kill-buffer buff))
#+end_src

This is an example of the problem that needs solving.. and maybe a clue on how to solve it. When a slide "dies", it could dismiss buffers created within its stateful sequence. There will obviously be escape hatches, but the idea is simple. It shouldn't be necessary to kill a spawned buffer in every single case. The Image action already does this. Users may want to integrate a padding step when dismissing a buffer.

I'll think of something nice. This usage pattern feels very natural.

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

No branches or pull requests

1 participant