[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Why is this not working (apply + call-process + list of string args)?
From: |
Arthur Miller |
Subject: |
Why is this not working (apply + call-process + list of string args)? |
Date: |
Thu, 15 Sep 2022 15:56:11 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
I just wonder if someone can explain exact what is going on here:
I have a list of strings of arruments I try to pass to configure script. It
looks something like this:
#+begin_src emacs-lisp
(defvar args
'("--with-native-compilation "
"--with-x "
"--with-x-toolkit=no "
"--without-gconf "
"--without-gsettings "
"--with-cairo "
"--without-toolkit-scroll-bars "
"--with-xinput2 "
"--without-included-regex "
"--without-compress-install "))
(defun configure (&rest args)
(apply #'call-process
(expand-file-name "./configure")
nil build-log nil args))
(apply #'configure args)
#end_src
However it does not work, configure script seems to see wrong arguments.
I have snitched solution from call-process-shell-command:
(defun configure (&rest args)
(call-process shell-file-name nil build-log nil shell-command-switch
(mapconcat #'identity (cons "./configure" args) " ")))
which works fine, but I don't really understand what is going "behind the
scenes"; why do I need to start an extra shell process? I guess it has something
with how arguments are quoted and passed to call-process, but I am not
sure. Clarification appreciated. Thanks in advance.
- Why is this not working (apply + call-process + list of string args)?,
Arthur Miller <=
- Message not available