[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/kubed fe844378f0 53/70: ; Add 'kubed-list-copy-as-kill'
From: |
ELPA Syncer |
Subject: |
[elpa] externals/kubed fe844378f0 53/70: ; Add 'kubed-list-copy-as-kill' to context menus |
Date: |
Tue, 6 Aug 2024 06:58:40 -0400 (EDT) |
branch: externals/kubed
commit fe844378f0d6c202a663300660d27e46e83c8bc1
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>
; Add 'kubed-list-copy-as-kill' to context menus
* kubed.el (kubed-list-copy-as-kill): Fix typo.
(kubed-list-context-menu): New function.
(kubed-list-mode): Add it to 'context-menu-functions'.
* kubed.texi (Browsing Resources): Mention
'kubed-list-copy-as-kill'.
---
kubed.el | 15 ++++++++++++---
kubed.texi | 5 +++++
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/kubed.el b/kubed.el
index c2d4586169..110475dee7 100644
--- a/kubed.el
+++ b/kubed.el
@@ -369,7 +369,7 @@ to 1."
(goto-char next)))
(defun kubed-list-copy-as-kill (click)
- "Copy name of Kubernetes resource at CLICK to into the kill ring."
+ "Copy name of Kubernetes resource at CLICK into the kill ring."
(interactive (list last-nonmenu-event) kubed-list-mode)
(if-let ((ent (tabulated-list-get-entry (mouse-set-point click)))
(new (aref ent 0)))
@@ -378,6 +378,13 @@ to 1."
(message "Copied resource name `%s'" new))
(user-error "No Kubernetes resource at point")))
+(defun kubed-list-context-menu (menu click)
+ "Extend MENU with common actions on Kubernetes resource at CLICK."
+ (when (tabulated-list-get-entry (posn-point (event-start click)))
+ (define-key menu [kubed-list-copy-as-kill]
+ '(menu-item "Copy name" kubed-list-copy-as-kill)))
+ menu)
+
(defvar-keymap kubed-list-mode-map
:doc "Common keymap for Kubernetes resource list buffers."
"/" #'kubed-list-set-filter
@@ -413,11 +420,13 @@ mode as their parent."
(save-excursion
(goto-char (point-min))
(while (not (eobp))
- (when-let ((mark (alist-get (tabulated-list-get-id)
marks nil nil #'equal)))
+ (when-let ((mark (alist-get (tabulated-list-get-id)
+ marks nil nil #'equal)))
(tabulated-list-put-tag mark))
(forward-line))))))
nil t)
- (setq-local truncate-string-ellipsis (propertize ">" 'face 'shadow)))
+ (setq-local truncate-string-ellipsis (propertize ">" 'face 'shadow))
+ (add-hook 'context-menu-functions #'kubed-list-context-menu nil t))
;;;###autoload
(defmacro kubed-define-resource (resource &optional properties &rest commands)
diff --git a/kubed.texi b/kubed.texi
index c11768a014..9b1e33c45f 100644
--- a/kubed.texi
+++ b/kubed.texi
@@ -231,6 +231,11 @@ Unmark from resource at point (@code{kubed-list-unmark}).
Toggle @code{kubed-all-namespaces-mode}. When enabled, resource lists
for namespaced resource types show resources from all namespaces, not
just the current namespace.
+@kindex w
+@findex kubed-list-copy-as-kill
+@item w
+Copy name of resource at point into the kill ring
+(@code{kubed-list-copy-as-kill}).
@kindex n
@findex next-line
@item n
- [elpa] externals/kubed 88937ea900 17/70: Add general resource-reading functions, (continued)
- [elpa] externals/kubed 88937ea900 17/70: Add general resource-reading functions, ELPA Syncer, 2024/08/06
- [elpa] externals/kubed 3cc3d54e75 19/70: New commands for patching resources, ELPA Syncer, 2024/08/06
- [elpa] externals/kubed fd653d0458 22/70: ; README.md: Adjust figure., ELPA Syncer, 2024/08/06
- [elpa] externals/kubed 932b0b2e88 24/70: ; * kubed.el (kubed-define-resource): Fix typos, ELPA Syncer, 2024/08/06
- [elpa] externals/kubed 377bcbcbb9 29/70: New command 'kubed-restart-deployment', ELPA Syncer, 2024/08/06
- [elpa] externals/kubed 0c8e314d6f 31/70: ; Fix 'restart' command name in deployments list buffer, ELPA Syncer, 2024/08/06
- [elpa] externals/kubed 9dcc880950 40/70: ; * kubed.el (kubed-list-read-filter): Also complete operators., ELPA Syncer, 2024/08/06
- [elpa] externals/kubed 7bc92fb116 43/70: Document resource lists and their filters, ELPA Syncer, 2024/08/06
- [elpa] externals/kubed 96dc9b821c 46/70: ; * kubed.texi (Browsing Resources): Tweak wording., ELPA Syncer, 2024/08/06
- [elpa] externals/kubed 999ca10c35 50/70: (cobra-read-command-line): Fix handling of cons INITIAL arg, ELPA Syncer, 2024/08/06
- [elpa] externals/kubed fe844378f0 53/70: ; Add 'kubed-list-copy-as-kill' to context menus,
ELPA Syncer <=
- [elpa] externals/kubed 0e2c7c7dd9 54/70: Support bookmarking Kubernetes resource buffers, ELPA Syncer, 2024/08/06
- [elpa] externals/kubed e73a4ee0a4 55/70: Always display message when done updating resources, ELPA Syncer, 2024/08/06
- [elpa] externals/kubed 7a14c155d5 68/70: (Browse Resources): Update common commands table., ELPA Syncer, 2024/08/06
- [elpa] externals/kubed 485eae8409 23/70: Add global menu bar menu, ELPA Syncer, 2024/08/06
- [elpa] externals/kubed 1ee8a943f6 25/70: ; * kubed.texi (Usage): Mention 'kubed-menu-bar-mode'., ELPA Syncer, 2024/08/06
- [elpa] externals/kubed 0923d8031a 28/70: ; * kubed.el (kubed-define-resource): Remove extraneous quote., ELPA Syncer, 2024/08/06
- [elpa] externals/kubed 645845fcac 36/70: Add common parent mode for resource lists mode, ELPA Syncer, 2024/08/06
- [elpa] externals/kubed 9e1b34f139 45/70: ; * kubed.texi (Browsing Resources): Fix markup., ELPA Syncer, 2024/08/06
- [elpa] externals/kubed 847bc985d0 59/70: New manual section about displaying resources, ELPA Syncer, 2024/08/06
- [elpa] externals/kubed fd3f899d7b 69/70: ; Exclude README.md from ELPA tarball, ELPA Syncer, 2024/08/06