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

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

[elpa] externals/tmr 5a8527ee01 3/3: Register tmr-action-map in Embark


From: ELPA Syncer
Subject: [elpa] externals/tmr 5a8527ee01 3/3: Register tmr-action-map in Embark
Date: Mon, 26 Dec 2022 11:58:39 -0500 (EST)

branch: externals/tmr
commit 5a8527ee01b59ce55ecdb3d3ce3e2110e8b87a3d
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Register tmr-action-map in Embark
---
 README.org | 17 +++--------------
 tmr.el     |  9 +++++++++
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/README.org b/README.org
index abc59fcf2f..886859fcb5 100644
--- a/README.org
+++ b/README.org
@@ -356,20 +356,9 @@ Everything is in place to set up the package.
 :END:
 
 The =embark= package provides standards-compliant infrastructure to run
-context-dependent actions on all sorts of targets (symbol at point,
-current completion candidate, etc.).  TMR is set up to make its timer
-objects recognisable by Embark.  All the user needs is something like
-the following glue code:
-
-#+begin_src emacs-lisp
-  (with-eval-after-load 'tmr
-    (with-eval-after-load 'embark
-      (add-to-list 'embark-keymap-alist '(tmr-timer . tmr-action-map))
-      (cl-loop
-       for cmd the key-bindings of tmr-action-map
-       if (commandp cmd) do
-       (add-to-list 'embark-post-action-hooks (list cmd 'embark--restart)))))
-#+end_src
+context-dependent actions on all sorts of targets (symbol at point, current
+completion candidate, etc.). TMR is set up to make its timer objects
+recognisable by Embark and registers the ~tmr-action-map~ in Embark.
 
 * Acknowledgements
 :PROPERTIES:
diff --git a/tmr.el b/tmr.el
index 58792b6402..bd1dc7eb7d 100644
--- a/tmr.el
+++ b/tmr.el
@@ -509,5 +509,14 @@ This map should be bound to a global prefix.")
         (mapcar (lambda (ev) (cons t ev))
                 (listify-key-sequence (this-command-keys-vector)))))
 
+(defvar embark-keymap-alist)
+(defvar embark-post-action-hooks)
+(with-eval-after-load 'embark
+  (add-to-list 'embark-keymap-alist '(tmr-timer . tmr-action-map))
+  (cl-loop
+   for cmd the key-bindings of tmr-action-map
+   if (commandp cmd) do
+   (add-to-list 'embark-post-action-hooks (list cmd 'embark--restart))))
+
 (provide 'tmr)
 ;;; tmr.el ends here



reply via email to

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