summary refs log tree commit diff stats
path: root/tag-emacs
diff options
context:
space:
mode:
authorAlan Pearce2014-05-22 10:42:12 +0100
committerAlan Pearce2014-05-22 10:42:12 +0100
commit0704610461bf24463b4f6fcea268b60cb3236ef1 (patch)
tree79573ab9edaa12f262fa6a92eb1bca76935871d6 /tag-emacs
parent8b2c247dba335dbf63a9e386d453e95d2b568e5a (diff)
downloaddotfiles-0704610461bf24463b4f6fcea268b60cb3236ef1.tar.lz
dotfiles-0704610461bf24463b4f6fcea268b60cb3236ef1.tar.zst
dotfiles-0704610461bf24463b4f6fcea268b60cb3236ef1.zip
Emacs: Add toggle-window-dedicated command
Tells Emacs not to replace the buffer in a window.
Diffstat (limited to 'tag-emacs')
-rw-r--r--tag-emacs/emacs.d/init.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/tag-emacs/emacs.d/init.el b/tag-emacs/emacs.d/init.el
index 565def9..f403d1e 100644
--- a/tag-emacs/emacs.d/init.el
+++ b/tag-emacs/emacs.d/init.el
@@ -994,6 +994,17 @@
   (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)))