1

I create a window with the following

  (setq ook-window (display-buffer-in-side-window buffer '((side . bottom))))
  (set-window-dedicated-p ook-window t)

But then when I go to the main window and press C-X 1, it closes my ook-window. What can I do to prevent this from happening so the window will only close when I choose?

From the documentation I would have thought setting it as dedicated should have done the trick, but it seems I am still missing something. I can see neo-tree does something similar, it only closes when I run neotree-toggle.

EDIT, to clarify

I want to bind a key (f9), so when I press f9 it will make the window appear and then the only way to make it dissappear is by pressing f9 again.

5
  • 1
    As far as I understand it means that the buffer is dedicated to the window, not that the window is not closable.
    – andrej
    May 14, 2019 at 11:45
  • Perhaps what you want is more this Side-Windows ?
    – rpluim
    May 14, 2019 at 11:56
  • @rpluim I am creating the window as a side window, but this doesn't seem to be all that is necessary. May 14, 2019 at 12:41
  • 1
    Please specify just what you mean by "so the window will only close when I choose". It's not clear what actions by you constitute choosing and what actions do not.
    – Drew
    May 14, 2019 at 13:43
  • I want to bind a key (f9), so when I press f9 it will make the window appear and then the only way to make it dissappear is by pressing f9 again. May 14, 2019 at 14:09

1 Answer 1

2

Ok, I have figured it out. I need to add this line :

(set-window-parameter ook-window 'no-delete-other-windows t)

As referenced in this issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.