When you switch a buffer in GNU/Emacs it could reuse any of opened windows to place new buffer content. Sometimes this behavior is annoying. The extension just pins buffer to current window in GNU/Emacs. It will omited during switching buffers and not used for popups until you unpin it (or close it).
- toggles buffer state between dedicated/normal
- displays 📌 in modeline for dedicated mode
- it's all
(use-package pin-buffer
:bind ("<f11>" . 'pin-buffer)
:straight (pin-buffer :type git :host github :repo "grafov/pin-buffer"))
Just call M-x pin-buffer
to toglle current buffer.
The code uses "dedicated window" feature of Emacs. You could do it in your manner without this extension. Just check this code for idea:
(let (window (get-buffer-window (current-buffer)))
(if (set-window-dedicated-p window
(not (window-dedicated-p window)))))
Under terms of GPL v3. See LICENSE file.