Skip to content

Instantly share code, notes, and snippets.

@mccraigmccraig
Created July 11, 2012 21:14
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 mccraigmccraig/3093582 to your computer and use it in GitHub Desktop.
Save mccraigmccraig/3093582 to your computer and use it in GitHub Desktop.
mark an emacs window as unavailable for other content
;; pin windows
(defun toggle-window-dedicated ()
"Toggle whether the current active window is dedicated or not"
(interactive)
(message
(if (let (window (get-buffer-window (current-buffer)))
(set-window-dedicated-p window
(not (window-dedicated-p window))))
"Window '%s' is dedicated"
"Window '%s' is normal")
(current-buffer)))
(global-set-key (kbd "C-c w d") 'toggle-window-dedicated)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment