diff --git a/.emacs.d/lisp/patch-helm-file-name-completion.el b/.emacs.d/lisp/patch-helm-file-name-completion.el index 83b85b28..ad68cc34 100644 --- a/.emacs.d/lisp/patch-helm-file-name-completion.el +++ b/.emacs.d/lisp/patch-helm-file-name-completion.el @@ -25,9 +25,24 @@ of the full, abbreviated or relative paths to insert." (string-match-p "\\`\\(/\\|[[:lower:][:upper:]]:/\\)" guess)))) - (escape-fn (if (memq major-mode - helm-modes-using-escaped-strings) - #'shell-quote-argument #'identity)) + (escape-fn (cond + ((derived-mode-p 'sly-mrepl-mode) + ;; TODO: Inserting the path as is does not work with + ;; #p if the file has a wildcard, so we must escape it. + ;; Or output uiop:ensure-pathname? + ;; + ;; In sbcl-ambrevar, we have FOF and we can use #f instead. + ;; + ;; (lambda (s) + ;; (if (string-match-p (regexp-opt '("[" "]" "*") ) + ;; s) + ;; (concat "(uiop:ensure-pathname \"" s "\")") + ;; (concat "#p\"" s "\""))) + #'prin1-to-string) + ((memq major-mode + helm-modes-using-escaped-strings) + #'shell-quote-argument) + (t #'identity))) (fname-formats '(:full nil :abbreviated (4) :relative (16)