[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/objed ebf09b0 018/216: Change yank semantics

From: Stefan Monnier
Subject: [elpa] externals/objed ebf09b0 018/216: Change yank semantics
Date: Tue, 8 Jan 2019 12:29:01 -0500 (EST)

branch: externals/objed
commit ebf09b001dba63259415c3aa4628210ccbc9c0aa
Author: Clemera <address@hidden>
Commit: Clemera <address@hidden>

    Change yank semantics
    yank will activate objed with region command and on repeat yank-pop
    will be used.
 objed.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/objed.el b/objed.el
index f72022e..567f53c 100644
--- a/objed.el
+++ b/objed.el
@@ -365,6 +365,8 @@ See also `objed-disabled-p'"
     ;; editing entry commands
     (delete-char . char)
     (kill-line . char)
+    (yank . region)
+    (yank-pop . region)
   "Entry commands and associated objects.
@@ -2009,10 +2011,13 @@ EVENT is used for wrapping according to
 (defun objed-yank (arg)
   "Yank and indent.
-ARG is passed to `yank'."
+ARG is passed to `yank'. On repreat `yank-pop'."
   (interactive "*P")
   (let ((start (point)))
-    (yank arg)
+    (if (eq last-command 'yank)
+       (yank-pop arg)
+      (yank arg)
+      (objed--switch-to 'region))
     (indent-region start (point))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]