branch: elpa/aidermacs commit e8c93aeee4f84b94d8b1fe230a6ef20c2602d4ff Author: ClarityStorm <45301623+clarityst...@users.noreply.github.com> Commit: Matthew Zeng <matthew...@posteo.net>
Fix preparing file paths containing spaces --- aidermacs.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/aidermacs.el b/aidermacs.el index 975b6e15a3..9cac2ac379 100644 --- a/aidermacs.el +++ b/aidermacs.el @@ -650,10 +650,11 @@ Otherwise, return FILE unchanged." (defun aidermacs--prepare-file-paths-for-command (command files) "Prepare FILES for use with COMMAND in aider. Handles TRAMP paths by extracting local parts and formats the command string." - (let ((localized-files (mapcar #'aidermacs--localize-tramp-path (delq nil files)))) - (if localized-files + (let* ((localized-files (mapcar #'aidermacs--localize-tramp-path (delq nil files))) + (quoted-files (mapcar (lambda (path) (format "\"%s\"" path)) localized-files))) + (if quoted-files (format "%s %s" command - (mapconcat #'identity localized-files " ")) + (mapconcat #'identity quoted-files " ")) (format "%s" command)))) (defun aidermacs--add-files-helper (files &optional read-only message)