summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--tag-emacs/emacs.d/init.el18
1 files changed, 11 insertions, 7 deletions
diff --git a/tag-emacs/emacs.d/init.el b/tag-emacs/emacs.d/init.el
index 3b36f8a..a5649fb 100644
--- a/tag-emacs/emacs.d/init.el
+++ b/tag-emacs/emacs.d/init.el
@@ -126,12 +126,6 @@
 
 ;;;; 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
@@ -327,6 +321,16 @@
         (kill-this-buffer)
         (message "File '%s' successfully removed" filename)))))
 
+(defun kill-or-delete-this-buffer-dwim (&optional arg)
+  "Kills current buffer. With prefix arg, delete it."
+  (interactive "P")
+  (message "%s" arg)
+  (if (equal arg '(4))
+      (delete-current-buffer-file)
+    (if server-buffer-clients
+        (server-edit)
+      (kill-this-buffer))))
+
 (req-package ws-butler
   :if window-system
   :config (ws-butler-global-mode 1))
@@ -444,7 +448,7 @@
 (unbind-key "s-n")
 (unbind-key "s-p")
 (unbind-key "s-w")
-(bind-key "s-k" #'kill-this-buffer-dwim)
+(bind-key "s-k" #'kill-or-delete-this-buffer-dwim)
 
 (bind-key "s-x" (define-prefix-command 'super-x-map))