From 46d39475de3d618901325c4f3cbeb3035777f6a8 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Fri, 19 Oct 2012 14:48:31 +0300 Subject: [PATCH] fixed #220 - load volatile-highlights after advising kill-line and kill-region --- prelude/prelude-core.el | 16 ---------------- prelude/prelude-editor.el | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/prelude/prelude-core.el b/prelude/prelude-core.el index 08aa72e..046580b 100644 --- a/prelude/prelude-core.el +++ b/prelude/prelude-core.el @@ -119,22 +119,6 @@ the curson at its beginning, according to the current mode." (transpose-lines 1) (forward-line -1)) -;; add the ability to copy and cut the current line, without marking it -(defadvice kill-ring-save (before slick-copy activate compile) - "When called interactively with no active region, copy a single line instead." - (interactive - (if mark-active (list (region-beginning) (region-end)) - (message "Copied line") - (list (line-beginning-position) - (line-beginning-position 2))))) - -(defadvice kill-region (before slick-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))))) - (defun prelude-indent-buffer () "Indents the entire buffer." (interactive) diff --git a/prelude/prelude-editor.el b/prelude/prelude-editor.el index 8beccd8..60401ff 100644 --- a/prelude/prelude-editor.el +++ b/prelude/prelude-editor.el @@ -143,6 +143,23 @@ (require 'volatile-highlights) (volatile-highlights-mode t) +;; note - this should be after volatile-highlights is required +;; add the ability to copy and cut the current line, without marking it +(defadvice kill-ring-save (before slick-copy activate compile) + "When called interactively with no active region, copy a single line instead." + (interactive + (if mark-active (list (region-beginning) (region-end)) + (message "Copied line") + (list (line-beginning-position) + (line-beginning-position 2))))) + +(defadvice kill-region (before slick-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