Skip to content

Instantly share code, notes, and snippets.

@ieure
Created January 27, 2020 16:47
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 ieure/1ac6f5e2c612d3c164073c27406099bf to your computer and use it in GitHub Desktop.
Save ieure/1ac6f5e2c612d3c164073c27406099bf to your computer and use it in GitHub Desktop.
(defun window-toggle-dedicated (&optional window)
"Toggle the dedicated flag on a window."
(interactive)
(let* ((window (or window (selected-window)))
(dedicated (not (window-dedicated-p window))))
(when (called-interactively-p)
(message (format "%s %sdedicated"
(buffer-name (window-buffer window))
(if dedicated "" "un"))))
(set-window-dedicated-p window dedicated)
dedicated))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment