From: James Bunton Date: Thu, 1 Jun 2017 23:00:29 +0000 (+1000) Subject: Use default yank behaviour X-Git-Url: https://code.delx.au/dotemacs/commitdiff_plain/61d155c728d2d498a86c7a94b9215e1c5b1e48b7 Use default yank behaviour --- diff --git a/lisp/my-editing-defuns.el b/lisp/my-editing-defuns.el index 7e7d70f..f050703 100644 --- a/lisp/my-editing-defuns.el +++ b/lisp/my-editing-defuns.el @@ -46,16 +46,3 @@ (kill-line arg)) (if (not (string-equal major-mode "fundamental-mode")) (indent-for-tab-command))) - -(defun my/yank (arg) - "If the text to be yanked has a newline then move to beginning of line before yanking. Otherwise same as normal `yank'." - (interactive "*P") - (advice-add 'insert-for-yank :around #'my/yank/advice) - (unwind-protect - (yank arg) - (advice-remove 'insert-for-yank #'my/yank/advice))) - -(defun my/yank/advice (original-function string) - (if (string-match-p "\n" string) - (beginning-of-line)) - (funcall original-function string)) diff --git a/lisp/my-keys.el b/lisp/my-keys.el index 6f5d732..2ff9669 100644 --- a/lisp/my-keys.el +++ b/lisp/my-keys.el @@ -54,7 +54,6 @@ (global-set-key (kbd "C-c m") 'mc/mark-more-like-this-extended) ;; Killing and deleting -(global-set-key (kbd "C-y") 'my/yank) (global-set-key (kbd "M-y") 'counsel-yank-pop) (global-set-key (kbd "M-z") 'zap-up-to-char) (global-set-key (kbd "C-c k") 'kill-whole-line)