emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/speedrect a472d721c2 04/16: wrap: alias wrapped functio


From: ELPA Syncer
Subject: [elpa] externals/speedrect a472d721c2 04/16: wrap: alias wrapped functions (with --speedrect_wrap) for keycast
Date: Tue, 17 Dec 2024 18:59:38 -0500 (EST)

branch: externals/speedrect
commit a472d721c2ad5d5e16e9c27139f47e0d1449c63e
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: JD Smith <93749+jdtsmith@users.noreply.github.com>

    wrap: alias wrapped functions (with --speedrect_wrap) for keycast
---
 speedrect.el | 30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)

diff --git a/speedrect.el b/speedrect.el
index fade279dda..5bdcd5dcfb 100644
--- a/speedrect.el
+++ b/speedrect.el
@@ -443,19 +443,23 @@ Many/most rectangle commands deactivate mark and exit
 commands, and, if custom option `speedrect-continue' is non-nil,
 restarts with the same rectangle.  If AFTER is non-nil, stash the
 rectangle after the command runs, otherwise, stash it before."
-  (lambda ()
-    (interactive)
-    (unless after (speedrect-stash))
-    (call-interactively command)
-    (when after (speedrect-stash))
-    (when speedrect-continue
-      (run-at-time 0 nil
-                  (lambda (buf)
-                    (with-current-buffer buf
-                      (activate-mark)
-                      (rectangle-mark-mode 1)
-                      (speedrect-recall-last)))
-                  (current-buffer)))))
+  (let ((func
+        (lambda ()
+          (interactive)
+          (unless after (speedrect-stash))
+          (call-interactively command)
+          (when after (speedrect-stash))
+          (when speedrect-continue
+            (run-at-time 0 nil
+                         (lambda (buf)
+                           (with-current-buffer buf
+                             (activate-mark)
+                             (rectangle-mark-mode 1)
+                             (speedrect-recall-last)))
+                         (current-buffer)))))
+       (name (intern (concat (symbol-name command) "--speedrect_wrap"))))
+    (defalias name func)
+    name))
 
 (defun speedrect-create-bindings ()
   "Create the bindings for speedrect."



reply via email to

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