branch: externals/objed
commit 23005a3bd0ad2865a71f82a92d1d2ebe5b1ae049
Author: Clemens Radermacher <clem...@posteo.net>
Commit: Clemens Radermacher <clem...@posteo.net>

    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 
`objed--current-obj'."
   "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."
   (interactive)
   (when (and objed-append-mode
              objed--append-do-append)
@@ -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
                       objed--append-do-append)
                  "Appended to `kill-ring'"

Reply via email to