aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2022-12-08 06:27:22 +0100
committerStefan Kangas2022-12-08 06:28:17 +0100
commitc65e08706812553b4f8dc55e8d2df2cde0d26b39 (patch)
treef225a44bb92adc95160beaae34d0b7d8a2178675
parent141fe8b827399057e2f854cd5e6b0c148c5fe12b (diff)
downloademacs-c65e08706812553b4f8dc55e8d2df2cde0d26b39.tar.gz
emacs-c65e08706812553b4f8dc55e8d2df2cde0d26b39.zip
; use-package: Improve :ensure-system-package docstrings
* lisp/use-package/use-package-ensure-system-package.el (use-package-ensure-system-package--custom-packages) (use-package-ensure-system-package-consify) (use-package-ensure-system-package-update-custom-packages) (use-package-normalize/:ensure-system-package) (use-package-ensure-system-package-exists?): Improve docstrings.
-rw-r--r--lisp/use-package/use-package-ensure-system-package.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/use-package/use-package-ensure-system-package.el b/lisp/use-package/use-package-ensure-system-package.el
index 9c9f0797a05..c55bacaf817 100644
--- a/lisp/use-package/use-package-ensure-system-package.el
+++ b/lisp/use-package/use-package-ensure-system-package.el
@@ -37,10 +37,10 @@
37 (declare-function system-packages-get-command "system-packages")) 37 (declare-function system-packages-get-command "system-packages"))
38 38
39(defvar use-package-ensure-system-package--custom-packages '() 39(defvar use-package-ensure-system-package--custom-packages '()
40 "List of custom packages installed.") 40 "List of commands used to install custom packages.")
41 41
42(defun use-package-ensure-system-package-consify (arg) 42(defun use-package-ensure-system-package-consify (arg)
43 "Turn ARG into a cons of (`package-name' . `install-command')." 43 "Turn ARG into a cons of the form (PACKAGE-NAME . INSTALL-COMMAND')."
44 (cond 44 (cond
45 ((stringp arg) 45 ((stringp arg)
46 (cons arg `(system-packages-install ,arg))) 46 (cons arg `(system-packages-install ,arg)))
@@ -59,13 +59,15 @@
59 `(system-packages-install ,(symbol-name (cdr arg))))))))) 59 `(system-packages-install ,(symbol-name (cdr arg)))))))))
60 60
61(defun use-package-ensure-system-package-update-custom-packages () 61(defun use-package-ensure-system-package-update-custom-packages ()
62 "Update custom packages (not installed by system package manager).
63Run the same commands used for installing them."
62 (interactive) 64 (interactive)
63 (dolist (cmd use-package-ensure-system-package--custom-packages) 65 (dolist (cmd use-package-ensure-system-package--custom-packages)
64 (async-shell-command cmd))) 66 (async-shell-command cmd)))
65 67
66;;;###autoload 68;;;###autoload
67(defun use-package-normalize/:ensure-system-package (_name-symbol keyword args) 69(defun use-package-normalize/:ensure-system-package (_name-symbol keyword args)
68 "Turn ARGS into a list of conses of (`package-name' . `install-command')." 70 "Turn ARGS into a list of conses of the form (PACKAGE-NAME . INSTALL-COMMAND)."
69 (use-package-as-one (symbol-name keyword) args 71 (use-package-as-one (symbol-name keyword) args
70 (lambda (_label arg) 72 (lambda (_label arg)
71 (cond 73 (cond
@@ -75,7 +77,7 @@
75 (list (use-package-ensure-system-package-consify arg))))))) 77 (list (use-package-ensure-system-package-consify arg)))))))
76 78
77(defun use-package-ensure-system-package-exists? (file-or-exe) 79(defun use-package-ensure-system-package-exists? (file-or-exe)
78 "If variable is a string, ensure the file path exists. 80 "If FILE-OR-EXE is a string, ensure the file path exists.
79If it is a symbol, ensure the binary exist." 81If it is a symbol, ensure the binary exist."
80 (if (stringp file-or-exe) 82 (if (stringp file-or-exe)
81 (file-exists-p file-or-exe) 83 (file-exists-p file-or-exe)