]> code.delx.au - dotemacs/commitdiff
Use default yank behaviour
authorJames Bunton <jamesbunton@delx.net.au>
Thu, 1 Jun 2017 23:00:29 +0000 (09:00 +1000)
committerJames Bunton <jamesbunton@delx.net.au>
Thu, 1 Jun 2017 23:00:29 +0000 (09:00 +1000)
lisp/my-editing-defuns.el
lisp/my-keys.el

index 7e7d70fe99263cfc265fcff2fdc6eefa0548cd3e..f05070309467b393b088ecf0c48c4c7fb55d0348 100644 (file)
       (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))
index 6f5d7328890caf83c8189d05cf63cc23db187022..2ff96692330d06da60135b815bf55714980b8320 100644 (file)
@@ -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)