Solo tengo mode-compile.el v2.29 disponible, pero en esa versión el problema es exactamente como usted lo describe, los argumentos para el comando de compilación no se escapan correctamente, y no hay ninguna opción para habilitarlo.
Es un poco de truco, pero usted debería ser capaz de redefinir la función correspondiente con la correcta escape para el nombre de archivo con esto en su .emacs
archivo:
(eval-after-load 'mode-compile
'(progn
(defun mc--shell-compile (shell dbgflags &optional errors-regexp-alist)
;; Run SHELL with debug flags DBGFLAGS on current-buffer
(let* ((shcmd (or (mc--which shell)
(error "Compilation abort: command %s not found" shell)))
(shfile (or mc--remote-pathname (buffer-file-name)
(error "Compilation abort: Buffer %s has no filename"
(buffer-name))))
(run-cmd (concat shcmd " " dbgflags " " (shell-quote-argument shfile) " "
(setq mc--shell-args
(read-string (if mode-compile-expert-p
"Argv: "
(format "Arguments to %s %s script: "
shfile shell))
mc--shell-args)))))
;; Modify compilation-error-regexp-alist if needed
(if errors-regexp-alist
(progn
;; Set compilation-error-regexp-alist from compile
(or (listp errors-regexp-alist)
(error "Compilation abort: In mc--shell-compile errors-regexp-alist not a list."))
;; Add new regexp alist to compilation-error-regexp-alist
(mapcar '(lambda(x)
(if (mc--member x compilation-error-regexp-alist) nil
(setq compilation-error-regexp-alist
(append (list x)
compilation-error-regexp-alist))))
errors-regexp-alist)))
;; Run compile with run-cmd
(mc--compile run-cmd)))))
La línea cambié estaba cambiando
(run-cmd (concat shcmd " " dbgflags " " shfile " "
a
(run-cmd (concat shcmd " " dbgflags " " (shell-quote-argument shfile) " "
Una solución más completa sería también Escape del dbgflags
(donde sea que estén configurados, solo escapando toda la variable no estará bien) y mc--shell-args
cuando están configurados también.
'C-c c' parece ser una unión no estándar. ¿Qué obtienes si escribes 'C-h c C-c c'? – legoscia
'mode-compile.el' no es estándar. ¿Estás usando http://perso.tls.cena.fr/boubaker/distrib/mode-compile.el o algo más? – phils
@phils No estoy usando intencionalmente 'mode-compile.el' - No recuerdo haber intentado instalarlo ni habría necesidad de hacerlo directamente ya que los únicos idiomas que uso son interpretados (R, Perl) . Tal vez es algo que se instaló con ESS ...? Cuando una secuencia de comandos de Perl está en el búfer, el modo principal es CPerl y el modo secundario es Abrev. No hay nada más obviamente diferente. – SlowLearner