[Top][All Lists]

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

[elpa] externals/objed 23005a3 23/59: Add object to register functionali

From: Clemens Radermacher
Subject: [elpa] externals/objed 23005a3 23/59: Add object to register functionality
Date: Sun, 24 Mar 2019 06:06:37 -0400 (EDT)

branch: externals/objed
commit 23005a3bd0ad2865a71f82a92d1d2ebe5b1ae049
Author: Clemens Radermacher <address@hidden>
Commit: Clemens Radermacher <address@hidden>

    Add object to register functionality
 objed-objects.el | 5 +++++
 objed.el         | 6 +++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/objed-objects.el b/objed-objects.el
index 498c462..1138909 100644
--- a/objed-objects.el
+++ b/objed-objects.el
@@ -506,6 +506,11 @@ OBJ is the object to use and defaults to 
   "Get right boundary of current object."
   (buffer-substring (objed--iend) (objed--oend)))
+(defun objed--object-string ()
+  "Return object string content."
+  (filter-buffer-substring (objed--beg)
+                           (objed--end)))
 (defun objed--goto-char (pos)
   "Move to position POS possibly skipping leading whitespace."
diff --git a/objed.el b/objed.el
index 5da926c..98b8e1c 100644
--- a/objed.el
+++ b/objed.el
@@ -2408,11 +2408,10 @@ to the `kill-ring'."
   (if objed-append-mode
       (setq objed--append-do-append nil)))
 (defun objed-copy ()
   "Copy objects.
-On repeat activate `objed-append-mode'"
+On repeat ask for copy object text to register."
   (when (and objed-append-mode
@@ -2420,7 +2419,8 @@ On repeat activate `objed-append-mode'"
     (setq last-command 'kill-region))
   (objed--do #'copy-region-as-kill)
   (if (eq real-last-command real-this-command)
-      (ignore "implement register")
+      (set-register (register-read-with-preview "Copy object to register: ")
+                    (objed--object-string))
     (message (if (and objed-append-mode
                  "Appended to `kill-ring'"

reply via email to

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