From: Michael Albinus Date: Thu, 20 Dec 2012 11:15:38 +0000 (+0100) Subject: * progmodes/grep.el (rgrep): Escape command line. Sometimes, it X-Git-Tag: emacs-24.3.90~173^2~7^2~546 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=91b982a0355d6eff74f7d9df56d5b321b13d2f8a;p=emacs.git * progmodes/grep.el (rgrep): Escape command line. Sometimes, it is too long for Tramp. See discussion in . * progmodes/compile.el (compilation-start): Remove line escape template. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c5ad40f5b15..342308c335d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2012-12-20 Michael Albinus + + * progmodes/grep.el (rgrep): Escape command line. Sometimes, it + is too long for Tramp. See discussion in + . + + * progmodes/compile.el (compilation-start): Remove line escape + template. + 2012-12-20 Dmitry Antipov * vc/ediff-ptch.el (ediff-map-patch-buffer): Use `point-min-marker'. diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 06525b354b1..1b70402004c 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1611,7 +1611,11 @@ Returns the compilation buffer created." (format "%s started at %s\n\n" mode-name (substring (current-time-string) 0 19)) - command "\n") + ;; The command could be split into several lines, see + ;; `rgrep' for example. We want to display it as one + ;; line. + (apply 'concat (split-string command (regexp-quote "\\\n") t)) + "\n") (setq thisdir default-directory)) (set-buffer-modified-p nil)) ;; Pop up the compilation buffer. diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index b448b7b3032..721c125a57b 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -992,14 +992,17 @@ to specify a command to run." (compilation-start regexp 'grep-mode)) (setq dir (file-name-as-directory (expand-file-name dir))) (require 'find-dired) ; for `find-name-arg' + ;; In Tramp, there could be problems if the command line is too + ;; long. We escape it, therefore. (let ((command (grep-expand-template grep-find-template regexp (concat (shell-quote-argument "(") " " find-name-arg " " - (mapconcat #'shell-quote-argument - (split-string files) - (concat " -o " find-name-arg " ")) + (mapconcat + #'shell-quote-argument + (split-string files) + (concat "\\\n" " -o " find-name-arg " ")) " " (shell-quote-argument ")")) dir @@ -1020,7 +1023,7 @@ to specify a command to run." (concat "*/" (cdr ignore))))))) grep-find-ignored-directories - " -o -path ") + "\\\n -o -path ") " " (shell-quote-argument ")") " -prune -o ")) @@ -1038,7 +1041,7 @@ to specify a command to run." (shell-quote-argument (cdr ignore)))))) grep-find-ignored-files - " -o -name ") + "\\\n -o -name ") " " (shell-quote-argument ")") " -prune -o "))))))