all repos — archive/dotfiles @ 0704610461bf24463b4f6fcea268b60cb3236ef1

Superseded by nixfiles

Emacs: Add toggle-window-dedicated command

Tells Emacs not to replace the buffer in a window.
Alan Pearce alan@alanpearce.co.uk
Thu, 22 May 2014 10:42:12 +0100
commit

0704610461bf24463b4f6fcea268b60cb3236ef1

parent

8b2c247dba335dbf63a9e386d453e95d2b568e5a

1 files changed, 11 insertions(+), 0 deletions(-)

jump to
M tag-emacs/emacs.d/init.eltag-emacs/emacs.d/init.el
@@ -994,6 +994,17 @@ (scroll-bar-mode -1)   (tooltip-mode -1)
   (tool-bar-mode -1))
 
+(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)))
+
 (req-package popwin
   :config (progn
             (popwin-mode 1)))