From: Eshel Yaron Date: Wed, 24 Jul 2024 05:31:13 +0000 (+0200) Subject: kubed.el: New command 'kubed-namespaces-set' X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b5bc189fad5f0e7d92ae4c7c844c1a20e77bd80e;p=emacs.git kubed.el: New command 'kubed-namespaces-set' --- diff --git a/lisp/net/kubed.el b/lisp/net/kubed.el index 86a173f0b8d..7cce3c0106a 100644 --- a/lisp/net/kubed.el +++ b/lisp/net/kubed.el @@ -741,14 +741,17 @@ Optional argument DEFAULT is the minibuffer default argument." resource) (goto-char (point-min)) (while (not (eobp)) (unless (eq (char-after) ?\s) - (push (cons (tabulated-list-get-id) (char-after)) marks)) + (push (cons (tabulated-list-get-id) + ;; Preserve mark properties. + (buffer-substring (point) (1+ (point)))) + marks)) (forward-line))) (lambda () (save-excursion (goto-char (point-min)) (while (not (eobp)) (when-let ((mark (alist-get (tabulated-list-get-id) marks nil nil #'equal))) - (tabulated-list-put-tag (char-to-string mark))) + (tabulated-list-put-tag mark)) (forward-line)))))) nil t) (setq tabulated-list-format (,frmt-fun)) @@ -833,7 +836,17 @@ Optional argument DEFAULT is the minibuffer default argument." resource) "create" "namespace" name)) (user-error "Failed to create Kubernetes namespace with name `%s'" name)) (message "Created Kubernetes namespace with name `%s'." name) - (kubed-update-namespaces))) + (kubed-update-namespaces)) + (set "s" "Set current namespace to" + (save-excursion + (goto-char (point-min)) + (while (not (eobp)) + (when (eq (char-after) ?*) + (tabulated-list-put-tag " ")) + (forward-line))) + (kubed-set-namespace namespace) + (tabulated-list-put-tag + (propertize "*" 'help-echo "Current namespace")))) ;;;###autoload (autoload 'kubed-display-persistentvolume "kubed" nil t) ;;;###autoload (autoload 'kubed-edit-persistentvolume "kubed" nil t)