From fc62c54bc368c3ac2c5d84ca0000b3184175ebd5 Mon Sep 17 00:00:00 2001 From: Gerard Vermeulen Date: Sun, 13 Feb 2022 15:09:26 +0100 Subject: [PATCH] Start a sub-section for process utilities --- README.org | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.org b/README.org index 03070c6..08e618b 100644 --- a/README.org +++ b/README.org @@ -449,6 +449,28 @@ by experienced Emacs users. ;; Finally, switch to that window. (other-window 1))))) #+end_src + +** [[info:elisp#Processes][Processes (info)]] +:PROPERTIES: +:CUSTOM_ID: sec:processes +:END: + +Listing [[lst:process-utilities]] defines a function to run a (command-line) program +with arguments and to obtain a list with its numeric exit status as well as its +output to =stdout=. + +#+caption[Process utilities]: +#+caption: Process utilities. +#+name: lst:process-utilities +#+begin_src emacs-lisp + ;; https://gitlab.com/howardabrams/spacemacs.d/blob/master/layers/ha-org/funcs.el#L418 + (defun shell-command-with-exit-code (program &rest args) + "Run PROGRAM with ARGS and return exit-code and output in a list." + (with-temp-buffer + (list (apply 'call-process program nil (current-buffer) nil args) + (buffer-string)))) +#+end_src + * [[info:emacs#Package Installation][Install the selected packages (info)]] :PROPERTIES: :CUSTOM_ID: sec:install-selected-packages