From daf52c2b0a57c910fe99a28b0ad62bf443f444d9 Mon Sep 17 00:00:00 2001 From: Keyvan Hedayati Date: Mon, 22 Dec 2014 09:53:12 +0330 Subject: [PATCH] [Fix #623] Restored kill-region defadvice When no region selected `C-w` kills current line --- core/prelude-editor.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/prelude-editor.el b/core/prelude-editor.el index 89fd43a..12b47a4 100644 --- a/core/prelude-editor.el +++ b/core/prelude-editor.el @@ -189,6 +189,15 @@ The body of the advice is in BODY." (volatile-highlights-mode t) (diminish 'volatile-highlights-mode) +;; note - this should be after volatile-highlights is required +;; add the ability to cut the current line, without marking it +(defadvice kill-region (before smart-cut activate compile) + "When called interactively with no active region, kill a single line instead." + (interactive + (if mark-active (list (region-beginning) (region-end)) + (list (line-beginning-position) + (line-beginning-position 2))))) + ;; tramp, for sudo access (require 'tramp) ;; keep in mind known issues with zsh - see emacs wiki