From 483aa1312dde03b01b0a2c19869ef412251b7d93 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Fri, 21 Dec 2012 08:50:26 +0100 Subject: [PATCH 1/2] Revert "Backport revno 111277 from Emacs trunk." This reverts commit 27bcf9a70b1137c88cf856719ab6fd74297286ef. --- lisp/ob-eval.el | 54 +++++++++++++++++++++++-------------------------- lisp/ob.el | 14 ++++++++----- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/lisp/ob-eval.el b/lisp/ob-eval.el index 23e71433d..976b7b4d4 100644 --- a/lisp/ob-eval.el +++ b/lisp/ob-eval.el @@ -135,13 +135,14 @@ specifies the value of ERROR-BUFFER." current-prefix-arg shell-command-default-error-buffer t))) - (let ((input-file (org-babel-temp-file "input-")) - (error-file (if error-buffer (org-babel-temp-file "scor-") nil)) - (shell-file-name - (if (file-executable-p - (concat (file-remote-p default-directory) shell-file-name)) - shell-file-name - "/bin/sh")) + (let ((error-file + (if error-buffer + (make-temp-file + (expand-file-name "scor" + (if (featurep 'xemacs) + (temp-directory) + temporary-file-directory))) + nil)) exit-status) (if (or replace (and output-buffer @@ -151,14 +152,12 @@ specifies the value of ERROR-BUFFER." ;; Don't muck with mark unless REPLACE says we should. (goto-char start) (and replace (push-mark (point) 'nomsg)) - (write-region start end input-file) - (delete-region start end) (setq exit-status - (process-file shell-file-name input-file - (if error-file - (list output-buffer error-file) - t) - nil shell-command-switch command)) + (call-process-region start end shell-file-name t + (if error-file + (list output-buffer error-file) + t) + nil shell-command-switch command)) ;; It is rude to delete a buffer which the command is not using. ;; (let ((shell-buffer (get-buffer "*Shell Command Output*"))) ;; (and shell-buffer (not (eq shell-buffer (current-buffer))) @@ -177,14 +176,14 @@ specifies the value of ERROR-BUFFER." (progn (setq buffer-read-only nil) (delete-region (max start end) (point-max)) (delete-region (point-min) (min start end)) - (write-region (point-min) (point-max) input-file) - (delete-region (point-min) (point-max)) (setq exit-status - (process-file shell-file-name input-file - (if error-file - (list t error-file) - t) - nil shell-command-switch command))) + (call-process-region (point-min) (point-max) + shell-file-name t + (if error-file + (list t error-file) + t) + nil shell-command-switch + command))) ;; Clear the output buffer, then run the command with ;; output there. (let ((directory default-directory)) @@ -194,11 +193,11 @@ specifies the value of ERROR-BUFFER." (setq default-directory directory)) (erase-buffer))) (setq exit-status - (process-file shell-file-name nil - (if error-file - (list buffer error-file) - buffer) - nil shell-command-switch command))) + (call-process-region start end shell-file-name nil + (if error-file + (list buffer error-file) + buffer) + nil shell-command-switch command))) ;; Report the output. (with-current-buffer buffer (setq mode-line-process @@ -232,9 +231,6 @@ specifies the value of ERROR-BUFFER." ;; (kill-buffer buffer) )))) - (when (and input-file (file-exists-p input-file)) - (delete-file input-file)) - (when (and error-file (file-exists-p error-file)) (if (< 0 (nth 7 (file-attributes error-file))) (with-current-buffer (get-buffer-create error-buffer) diff --git a/lisp/ob.el b/lisp/ob.el index 32ca7c6ca..b06aac11f 100644 --- a/lisp/ob.el +++ b/lisp/ob.el @@ -2547,14 +2547,18 @@ Emacs shutdown.")) Passes PREFIX and SUFFIX directly to `make-temp-file' with the value of `temporary-file-directory' temporarily set to the value of `org-babel-temporary-directory'." - (let ((temporary-file-directory - (if (file-remote-p default-directory) - (concat (file-remote-p default-directory) "/tmp") + (if (file-remote-p default-directory) + (make-temp-file + (concat (file-remote-p default-directory) + (expand-file-name + prefix temporary-file-directory) + nil suffix)) + (let ((temporary-file-directory (or (and (boundp 'org-babel-temporary-directory) (file-exists-p org-babel-temporary-directory) org-babel-temporary-directory) - temporary-file-directory)))) - (make-temp-file prefix nil suffix))) + temporary-file-directory))) + (make-temp-file prefix nil suffix)))) (defun org-babel-remove-temporary-directory () "Remove `org-babel-temporary-directory' on Emacs shutdown." From 30922bd7e9a2a5ebf03ed0544bd9af6f9187d175 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Fri, 21 Dec 2012 09:32:38 +0100 Subject: [PATCH 2/2] org.el (org-edit-special): Fix docstring. * org.el (org-edit-special): Fix docstring. (org-in-src-block-p): Small enhancement. --- lisp/org.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 9d2aba866..a5d48b62f 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -18968,6 +18968,7 @@ See the individual commands for more information." "Call a special editor for the stuff at point. When at a table, call the formula editor with `org-table-edit-formulas'. When in a source code block, call `org-edit-src-code'. +When in a fixed-width region, call `org-edit-fixed-width-region'. When in an #+include line, visit the included file. On a link, call `ffap' to visit the link at point. Otherwise, return a user error." @@ -20251,14 +20252,13 @@ and end of string." When INSIDE is non-nil, don't consider we are within a src block when point is at #+BEGIN_SRC or #+END_SRC." (let ((case-fold-search t) ov) - (or (when (setq ov (overlays-at (point))) - (memq 'org-block-background - (overlay-properties - (car ov)))) + (or (and (setq ov (overlays-at (point))) + (memq 'org-block-background + (overlay-properties (car ov)))) (and (not inside) (save-match-data (save-excursion - (move-beginning-of-line 1) + (beginning-of-line) (looking-at ".*#\\+\\(begin\\|end\\)_src"))))))) (defun org-context ()