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

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

[elpa] externals/transient 042f37aa66 21/23: transient-copy-menu-text: N


From: Jonas Bernoulli
Subject: [elpa] externals/transient 042f37aa66 21/23: transient-copy-menu-text: New command
Date: Sun, 22 Dec 2024 08:44:41 -0500 (EST)

branch: externals/transient
commit 042f37aa66e1b43afab8d0cf751da8b5c52f5282
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    transient-copy-menu-text: New command
---
 docs/transient.org  | 8 ++++++++
 docs/transient.texi | 8 ++++++++
 lisp/transient.el   | 9 +++++++++
 3 files changed, 25 insertions(+)

diff --git a/docs/transient.org b/docs/transient.org
index b5fe66ff35..907d268d3b 100644
--- a/docs/transient.org
+++ b/docs/transient.org
@@ -428,6 +428,14 @@ window, and the key bindings are the same as for 
~scroll-up-command~ and
   lines.  If {{{var(ARG)}}} is ~nil~, then it scrolls near full screen.  This
   is a wrapper around ~scroll-down-command~ (which see).
 
+The following commands are not available by default.  If you would
+like to use them for all menus, bind them in ~transient-map~.
+
+- Command: transient-copy-menu-text ::
+
+  This command copies the contents of the menu buffer to the kill
+  ring.
+
 ** Configuration
 
 More options are described in [[* Common Suffix Commands]], in [[* Saving
diff --git a/docs/transient.texi b/docs/transient.texi
index 48bd3af992..52259d1cc7 100644
--- a/docs/transient.texi
+++ b/docs/transient.texi
@@ -586,6 +586,14 @@ lines.  If @var{ARG} is @code{nil}, then it scrolls near 
full screen.  This
 is a wrapper around @code{scroll-down-command} (which see).
 @end deffn
 
+The following commands are not available by default.  If you would
+like to use them for all menus, bind them in @code{transient-map}.
+
+@deffn Command transient-copy-menu-text
+This command copies the contents of the menu buffer to the kill
+ring.
+@end deffn
+
 @node Configuration
 @section Configuration
 
diff --git a/lisp/transient.el b/lisp/transient.el
index 3aca297f1b..45b5f2b04c 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1971,6 +1971,7 @@ of the corresponding object."
   "<transient-forward-button>"    #'transient--do-move
   "<transient-isearch-backward>"  #'transient--do-move
   "<transient-isearch-forward>"   #'transient--do-move
+  "<transient-copy-menu-text>"    #'transient--do-stay
   ;; If a valid but incomplete prefix sequence is followed by
   ;; an unbound key, then Emacs calls the `undefined' command
   ;; but does not set `this-command', `this-original-command'
@@ -3273,6 +3274,14 @@ transient is active."
   (message "Debugging transient %s"
            (if transient--debug "enabled" "disabled")))
 
+(defun transient-copy-menu-text ()
+  "Copy the contents of the menu buffer to the kill ring.
+To make this available in all menus, bind it in `transient-map'"
+  (interactive)
+  (transient--show)
+  (with-current-buffer (get-buffer transient--buffer-name)
+    (copy-region-as-kill (point-min) (point-max))))
+
 (transient-define-suffix transient-echo-arguments (arguments)
   "Show the transient's active ARGUMENTS in the echo area.
 Intended for use in prefixes used for demonstration purposes,



reply via email to

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