Skip to content

Instantly share code, notes, and snippets.

@HeinrichHartmann
Created June 15, 2016 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HeinrichHartmann/c4401ff0347cea975380e221c7e24f42 to your computer and use it in GitHub Desktop.
Save HeinrichHartmann/c4401ff0347cea975380e221c7e24f42 to your computer and use it in GitHub Desktop.
Pin an buffer to a window in #emacs
;; Similar to: http://stackoverflow.com/questions/43765/pin-emacs-buffers-to-windows-for-cscope/65992#65992
(defun pin-buffer ()
"Pin buffer to current window."
(interactive)
(message
(if (let (window (get-buffer-window (current-buffer)))
(set-window-dedicated-p window (not (window-dedicated-p window))))
"pinned buffer" "un-pinned buffer")
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment