Dostępna jest tylko wersja mode-compile.el v2.29, ale w tej wersji problem jest dokładnie taki, jak opisujesz, argumenty polecenia kompilacji nie są poprawnie wymazywane i nie ma opcji, aby je włączyć.
To trochę Hack ale powinieneś być w stanie na nowo zdefiniować odpowiednią funkcję z poprawna ucieczce do nazwy pliku w pliku .emacs
:
(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)))))
Linia Zmieniłem zmieniał
(run-cmd (concat shcmd " " dbgflags " " shfile " "
do
(run-cmd (concat shcmd " " dbgflags " " (shell-quote-argument shfile) " "
pełniejszy fix byłoby również uciec od dbgflags
(gdziekolwiek są ustawione, po prostu ucieka cała zmienna nie będzie w porządku) i mc--shell-args
, gdy są ustawione.
'C-c c' wydaje się być niestandardowym wiązaniem. Co otrzymasz, jeśli wpiszesz 'C-h c C-c c'? – legoscia
'mode-compile.el' nie jest standardem. Używasz http://perso.tls.cena.fr/boubaker/distrib/mode-compile.el lub czegoś innego? – phils
@phils Nie celowo używam 'mode-compile.el' - nie pamiętam, żeby go zainstalować, ani nie byłoby mi potrzebne, aby to zrobić bezpośrednio, ponieważ używane są tylko te języki, których używam (R, Perl) . Być może jest to coś, co zostało zainstalowane z ESS ...? Kiedy skrypt Perla znajduje się w buforze, trybem głównym jest CPerl, a trybem podrzędnym jest Abbrev. Nie ma oczywiście nic innego. – SlowLearner