Start a sub-section for process utilities

This commit is contained in:
Gerard Vermeulen 2022-02-13 15:09:26 +01:00
parent b445074c16
commit fc62c54bc3

View File

@ -449,6 +449,28 @@ by experienced Emacs users.
;; Finally, switch to that window. ;; Finally, switch to that window.
(other-window 1))))) (other-window 1)))))
#+end_src #+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)]] * [[info:emacs#Package Installation][Install the selected packages (info)]]
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: sec:install-selected-packages :CUSTOM_ID: sec:install-selected-packages