aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2012-12-20 15:06:16 +0100
committerJoakim Verona2012-12-20 15:06:16 +0100
commit396061b73767cefb250a838f509e3427c1ebe296 (patch)
treee92624fad3d12b9ddafc06ae216b08a4ce62e563
parent944f8e8077205b6d82a6f4ef0e6916a5b6287b7f (diff)
parent006faa4118a335844583d73d9fbd2a844e908b2f (diff)
downloademacs-396061b73767cefb250a838f509e3427c1ebe296.tar.gz
emacs-396061b73767cefb250a838f509e3427c1ebe296.zip
auto upstream
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/org/ChangeLog9
-rw-r--r--lisp/org/ob-eval.el54
-rw-r--r--lisp/org/ob.el14
-rw-r--r--lisp/progmodes/compile.el6
-rw-r--r--lisp/progmodes/grep.el13
6 files changed, 65 insertions, 40 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c5ad40f5b15..342308c335d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12012-12-20 Michael Albinus <michael.albinus@gmx.de>
2
3 * progmodes/grep.el (rgrep): Escape command line. Sometimes, it
4 is too long for Tramp. See discussion in
5 <http://thread.gmane.org/gmane.emacs.tramp/8233/focus=8244>.
6
7 * progmodes/compile.el (compilation-start): Remove line escape
8 template.
9
12012-12-20 Dmitry Antipov <dmantipov@yandex.ru> 102012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2 11
3 * vc/ediff-ptch.el (ediff-map-patch-buffer): Use `point-min-marker'. 12 * vc/ediff-ptch.el (ediff-map-patch-buffer): Use `point-min-marker'.
diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog
index f7715198464..ce3fd523b88 100644
--- a/lisp/org/ChangeLog
+++ b/lisp/org/ChangeLog
@@ -1,3 +1,12 @@
12012-12-20 Michael Albinus <michael.albinus@gmx.de>
2
3 * ob.el (org-babel-temp-file): Fix setting of
4 `temporary-file-directory' on remote hosts.
5
6 * ob-eval.el (org-babel-shell-command-on-region): Use
7 `process-file' instead of `call-process-region'. The latter one
8 does not work on remote hosts.
9
12012-12-13 Bastien Guerry <bzg@gnu.org> 102012-12-13 Bastien Guerry <bzg@gnu.org>
2 11
3 * org-latex.el (org-export-latex-links): Escape raw path when 12 * org-latex.el (org-export-latex-links): Escape raw path when
diff --git a/lisp/org/ob-eval.el b/lisp/org/ob-eval.el
index ddad067a560..5489c080669 100644
--- a/lisp/org/ob-eval.el
+++ b/lisp/org/ob-eval.el
@@ -134,14 +134,13 @@ specifies the value of ERROR-BUFFER."
134 current-prefix-arg 134 current-prefix-arg
135 shell-command-default-error-buffer 135 shell-command-default-error-buffer
136 t))) 136 t)))
137 (let ((error-file 137 (let ((input-file (org-babel-temp-file "input-"))
138 (if error-buffer 138 (error-file (if error-buffer (org-babel-temp-file "scor-") nil))
139 (make-temp-file 139 (shell-file-name
140 (expand-file-name "scor" 140 (if (file-executable-p
141 (if (featurep 'xemacs) 141 (concat (file-remote-p default-directory) shell-file-name))
142 (temp-directory) 142 shell-file-name
143 temporary-file-directory))) 143 "/bin/sh"))
144 nil))
145 exit-status) 144 exit-status)
146 (if (or replace 145 (if (or replace
147 (and output-buffer 146 (and output-buffer
@@ -151,12 +150,14 @@ specifies the value of ERROR-BUFFER."
151 ;; Don't muck with mark unless REPLACE says we should. 150 ;; Don't muck with mark unless REPLACE says we should.
152 (goto-char start) 151 (goto-char start)
153 (and replace (push-mark (point) 'nomsg)) 152 (and replace (push-mark (point) 'nomsg))
153 (write-region start end input-file)
154 (delete-region start end)
154 (setq exit-status 155 (setq exit-status
155 (call-process-region start end shell-file-name t 156 (process-file shell-file-name input-file
156 (if error-file 157 (if error-file
157 (list output-buffer error-file) 158 (list output-buffer error-file)
158 t) 159 t)
159 nil shell-command-switch command)) 160 nil shell-command-switch command))
160 ;; It is rude to delete a buffer which the command is not using. 161 ;; It is rude to delete a buffer which the command is not using.
161 ;; (let ((shell-buffer (get-buffer "*Shell Command Output*"))) 162 ;; (let ((shell-buffer (get-buffer "*Shell Command Output*")))
162 ;; (and shell-buffer (not (eq shell-buffer (current-buffer))) 163 ;; (and shell-buffer (not (eq shell-buffer (current-buffer)))
@@ -175,14 +176,14 @@ specifies the value of ERROR-BUFFER."
175 (progn (setq buffer-read-only nil) 176 (progn (setq buffer-read-only nil)
176 (delete-region (max start end) (point-max)) 177 (delete-region (max start end) (point-max))
177 (delete-region (point-min) (min start end)) 178 (delete-region (point-min) (min start end))
179 (write-region (point-min) (point-max) input-file)
180 (delete-region (point-min) (point-max))
178 (setq exit-status 181 (setq exit-status
179 (call-process-region (point-min) (point-max) 182 (process-file shell-file-name input-file
180 shell-file-name t 183 (if error-file
181 (if error-file 184 (list t error-file)
182 (list t error-file) 185 t)
183 t) 186 nil shell-command-switch command)))
184 nil shell-command-switch
185 command)))
186 ;; Clear the output buffer, then run the command with 187 ;; Clear the output buffer, then run the command with
187 ;; output there. 188 ;; output there.
188 (let ((directory default-directory)) 189 (let ((directory default-directory))
@@ -192,11 +193,11 @@ specifies the value of ERROR-BUFFER."
192 (setq default-directory directory)) 193 (setq default-directory directory))
193 (erase-buffer))) 194 (erase-buffer)))
194 (setq exit-status 195 (setq exit-status
195 (call-process-region start end shell-file-name nil 196 (process-file shell-file-name nil
196 (if error-file 197 (if error-file
197 (list buffer error-file) 198 (list buffer error-file)
198 buffer) 199 buffer)
199 nil shell-command-switch command))) 200 nil shell-command-switch command)))
200 ;; Report the output. 201 ;; Report the output.
201 (with-current-buffer buffer 202 (with-current-buffer buffer
202 (setq mode-line-process 203 (setq mode-line-process
@@ -230,6 +231,9 @@ specifies the value of ERROR-BUFFER."
230 ;; (kill-buffer buffer) 231 ;; (kill-buffer buffer)
231 )))) 232 ))))
232 233
234 (when (and input-file (file-exists-p input-file))
235 (delete-file input-file))
236
233 (when (and error-file (file-exists-p error-file)) 237 (when (and error-file (file-exists-p error-file))
234 (if (< 0 (nth 7 (file-attributes error-file))) 238 (if (< 0 (nth 7 (file-attributes error-file)))
235 (with-current-buffer (get-buffer-create error-buffer) 239 (with-current-buffer (get-buffer-create error-buffer)
diff --git a/lisp/org/ob.el b/lisp/org/ob.el
index b06aac11f69..32ca7c6ca9e 100644
--- a/lisp/org/ob.el
+++ b/lisp/org/ob.el
@@ -2547,18 +2547,14 @@ Emacs shutdown."))
2547Passes PREFIX and SUFFIX directly to `make-temp-file' with the 2547Passes PREFIX and SUFFIX directly to `make-temp-file' with the
2548value of `temporary-file-directory' temporarily set to the value 2548value of `temporary-file-directory' temporarily set to the value
2549of `org-babel-temporary-directory'." 2549of `org-babel-temporary-directory'."
2550 (if (file-remote-p default-directory) 2550 (let ((temporary-file-directory
2551 (make-temp-file 2551 (if (file-remote-p default-directory)
2552 (concat (file-remote-p default-directory) 2552 (concat (file-remote-p default-directory) "/tmp")
2553 (expand-file-name
2554 prefix temporary-file-directory)
2555 nil suffix))
2556 (let ((temporary-file-directory
2557 (or (and (boundp 'org-babel-temporary-directory) 2553 (or (and (boundp 'org-babel-temporary-directory)
2558 (file-exists-p org-babel-temporary-directory) 2554 (file-exists-p org-babel-temporary-directory)
2559 org-babel-temporary-directory) 2555 org-babel-temporary-directory)
2560 temporary-file-directory))) 2556 temporary-file-directory))))
2561 (make-temp-file prefix nil suffix)))) 2557 (make-temp-file prefix nil suffix)))
2562 2558
2563(defun org-babel-remove-temporary-directory () 2559(defun org-babel-remove-temporary-directory ()
2564 "Remove `org-babel-temporary-directory' on Emacs shutdown." 2560 "Remove `org-babel-temporary-directory' on Emacs shutdown."
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."
1611 (format "%s started at %s\n\n" 1611 (format "%s started at %s\n\n"
1612 mode-name 1612 mode-name
1613 (substring (current-time-string) 0 19)) 1613 (substring (current-time-string) 0 19))
1614 command "\n") 1614 ;; The command could be split into several lines, see
1615 ;; `rgrep' for example. We want to display it as one
1616 ;; line.
1617 (apply 'concat (split-string command (regexp-quote "\\\n") t))
1618 "\n")
1615 (setq thisdir default-directory)) 1619 (setq thisdir default-directory))
1616 (set-buffer-modified-p nil)) 1620 (set-buffer-modified-p nil))
1617 ;; Pop up the compilation buffer. 1621 ;; 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."
992 (compilation-start regexp 'grep-mode)) 992 (compilation-start regexp 'grep-mode))
993 (setq dir (file-name-as-directory (expand-file-name dir))) 993 (setq dir (file-name-as-directory (expand-file-name dir)))
994 (require 'find-dired) ; for `find-name-arg' 994 (require 'find-dired) ; for `find-name-arg'
995 ;; In Tramp, there could be problems if the command line is too
996 ;; long. We escape it, therefore.
995 (let ((command (grep-expand-template 997 (let ((command (grep-expand-template
996 grep-find-template 998 grep-find-template
997 regexp 999 regexp
998 (concat (shell-quote-argument "(") 1000 (concat (shell-quote-argument "(")
999 " " find-name-arg " " 1001 " " find-name-arg " "
1000 (mapconcat #'shell-quote-argument 1002 (mapconcat
1001 (split-string files) 1003 #'shell-quote-argument
1002 (concat " -o " find-name-arg " ")) 1004 (split-string files)
1005 (concat "\\\n" " -o " find-name-arg " "))
1003 " " 1006 " "
1004 (shell-quote-argument ")")) 1007 (shell-quote-argument ")"))
1005 dir 1008 dir
@@ -1020,7 +1023,7 @@ to specify a command to run."
1020 (concat "*/" 1023 (concat "*/"
1021 (cdr ignore))))))) 1024 (cdr ignore)))))))
1022 grep-find-ignored-directories 1025 grep-find-ignored-directories
1023 " -o -path ") 1026 "\\\n -o -path ")
1024 " " 1027 " "
1025 (shell-quote-argument ")") 1028 (shell-quote-argument ")")
1026 " -prune -o ")) 1029 " -prune -o "))
@@ -1038,7 +1041,7 @@ to specify a command to run."
1038 (shell-quote-argument 1041 (shell-quote-argument
1039 (cdr ignore)))))) 1042 (cdr ignore))))))
1040 grep-find-ignored-files 1043 grep-find-ignored-files
1041 " -o -name ") 1044 "\\\n -o -name ")
1042 " " 1045 " "
1043 (shell-quote-argument ")") 1046 (shell-quote-argument ")")
1044 " -prune -o ")))))) 1047 " -prune -o "))))))