Skip to content

Instantly share code, notes, and snippets.

@mccraigmccraig
Created July 11, 2012 21:14
Show Gist options
  • 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