]> git.eshelyaron.com Git - emacs.git/commitdiff
kubed.el: New command 'kubed-namespaces-set'
authorEshel Yaron <me@eshelyaron.com>
Wed, 24 Jul 2024 05:31:13 +0000 (07:31 +0200)
committerEshel Yaron <me@eshelyaron.com>
Wed, 24 Jul 2024 05:31:13 +0000 (07:31 +0200)
lisp/net/kubed.el

index 86a173f0b8d3a4b1f205baff0a4a98c3ba44a83f..7cce3c0106a4a964bbfa9abe2bb8595ec7aae4e0 100644 (file)
@@ -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)