summary refs log tree commit diff stats
path: root/tag-emacs
diff options
context:
space:
mode:
authorAlan Pearce2014-07-03 11:35:43 +0100
committerAlan Pearce2014-07-03 11:35:43 +0100
commit1b2ac613e3ee291ddf37b16f01d82343906e5d39 (patch)
tree48f20fab28cce80d678e55cfc673515dad7175ec /tag-emacs
parent4c534ec12b614acc3317f21d42193839074f4a23 (diff)
downloaddotfiles-1b2ac613e3ee291ddf37b16f01d82343906e5d39.tar.lz
dotfiles-1b2ac613e3ee291ddf37b16f01d82343906e5d39.tar.zst
dotfiles-1b2ac613e3ee291ddf37b16f01d82343906e5d39.zip
Emacs: add kill-this-buffer-dwim for server edits
Diffstat (limited to 'tag-emacs')
-rw-r--r--tag-emacs/emacs.d/init.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/tag-emacs/emacs.d/init.el b/tag-emacs/emacs.d/init.el
index 442c1b2..4305625 100644
--- a/tag-emacs/emacs.d/init.el
+++ b/tag-emacs/emacs.d/init.el
@@ -126,6 +126,12 @@
 
 ;;;; Buffers
 
+(defun kill-this-buffer-dwim ()
+  (interactive)
+  (if server-buffer-clients
+      (server-edit)
+    (kill-this-buffer)))
+
 (req-package ibuffer
   :bind (("C-x C-b" . ibuffer))
   :config (progn
@@ -411,7 +417,7 @@
 (unbind-key "s-n")
 (unbind-key "s-p")
 (unbind-key "s-w")
-(bind-key "s-k" #'kill-this-buffer)
+(bind-key "s-k" #'kill-this-buffer-dwim)
 
 (bind-key "s-x" (define-prefix-command 'super-x-map))