Closed stardiviner closed 6 years ago
Hi, sorry for the late response, your function requires an argument and the interactive declaration does not define that argument, you can rewrite you function as:
@@ -1,10 +1,7 @@
(defun docker-tramp-insert-running-container (container)
"A helper function to insert the running `CONTAINER' name.
For Org-babel header argument :dir /docker:<name>:."
- (interactive)
+ (interactive (let ((containers (docker-tramp--running-containers)))
+ (list (completing-read "Docker container name: " containers))))
;; FIXME:
- (let ((containers (docker-tramp--running-containers)))
- (insert
- (completing-read "Docker container name: "
- containers)))
)
Also, remember docker-tramp--running-containers
return a list of the form (ID NAME)
:
'(("24dbb476cdd8" "container_name")
("bbd4f62e9f1d" "other_name"))
I think completing-read
will recognize it as collection
, but if you want to use the container names, you need to use (mapcar 'cdr (docker-tramp--running-containers))
Thanks a lot.
I try to write a helper function like this:
But I got an error "wrong number argument".