help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[solved] Re: Expanding list into string within a command


From: Jean Louis
Subject: [solved] Re: Expanding list into string within a command
Date: Sun, 6 Dec 2020 22:57:57 +0300
User-agent: Mutt/2.0 (3d08634) (2020-11-07)

* Jean Louis <bugs@gnu.support> [2020-12-06 22:47]:
> (defun syogm-cs2cs (coord-string cs2cs-format)
>   (let* ((command "cs2cs")
>        (output (command-stream-in-out command coord-string `,(string-join 
> (split-string cs2cs-format) " "))))
>     output))

I have made new function to replace `command-stream-in-out' with:

(defun rcd-command-output-from-input (program input &rest args)
  "Returns output from PROGRAM INPUT with optional ARGS"
  (let* ((output (with-temp-buffer
                  (insert input)
                  (apply #'call-process-region nil nil program nil t nil args)
                  (buffer-string))))
    output))

and I have to use `apply' to get it working. I think this is solved.

I found a tip here:
https://stackoverflow.com/questions/629699/common-lisp-working-with-rest-parameters

As now I got it that `args' is a list.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]