Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode
This commit is contained in:
commit
950bea36f8
|
@ -31,9 +31,11 @@
|
|||
(require 'ob)
|
||||
(eval-when-compile (require 'cl))
|
||||
|
||||
(defvar org-babel-error-buffer-name "*Org-Babel Error Output*")
|
||||
|
||||
(defun org-babel-eval-error-notify (exit-code stderr)
|
||||
"Open a buffer to display STDERR and a message with the value of EXIT-CODE."
|
||||
(let ((buf (get-buffer-create "*Org-Babel Error Output*")))
|
||||
(let ((buf (get-buffer-create org-babel-error-buffer-name)))
|
||||
(with-current-buffer buf
|
||||
(goto-char (point-max))
|
||||
(save-excursion (insert stderr)))
|
||||
|
@ -44,7 +46,7 @@
|
|||
"Run CMD on BODY.
|
||||
If CMD succeeds then return its results, otherwise display
|
||||
STDERR with `org-babel-eval-error-notify'."
|
||||
(let ((err-buff (get-buffer-create "*Org-Babel Error*")) exit-code)
|
||||
(let ((err-buff (get-buffer-create " *Org-Babel Error*")) exit-code)
|
||||
(with-current-buffer err-buff (erase-buffer))
|
||||
(with-temp-buffer
|
||||
(insert body)
|
||||
|
@ -247,6 +249,13 @@ specifies the value of ERROR-BUFFER."
|
|||
(delete-file error-file))
|
||||
exit-status))
|
||||
|
||||
|
||||
(defun org-babel-eval-wipe-error-buffer ()
|
||||
(when (get-buffer org-babel-error-buffer-name)
|
||||
(save-excursion
|
||||
(set-buffer org-babel-error-buffer-name)
|
||||
(delete-region (point-min) (point-max)))))
|
||||
|
||||
(provide 'ob-eval)
|
||||
|
||||
;; arch-tag: 5328b17f-957d-42d9-94da-a2952682d04d
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
(defvar org-babel-lob-one-liner-regexp)
|
||||
(defvar org-babel-ref-split-regexp)
|
||||
(declare-function org-babel-lob-get-info "ob-lob" ())
|
||||
|
||||
(declare-function org-babel-eval-wipe-error-buffer "ob-eval" ())
|
||||
(add-to-list 'org-export-interblocks '(src org-babel-exp-inline-src-blocks))
|
||||
(add-to-list 'org-export-interblocks '(lob org-babel-exp-lob-one-liners))
|
||||
(add-hook 'org-export-blocks-postblock-hook 'org-exp-res/src-name-cleanup)
|
||||
|
@ -288,6 +288,7 @@ inhibit insertion of results into the buffer."
|
|||
(org-babel-process-params (nth 2 info))))
|
||||
;; skip code blocks which we can't evaluate
|
||||
(when (fboundp (intern (concat "org-babel-execute:" lang)))
|
||||
(org-babel-eval-wipe-error-buffer)
|
||||
(if (equal type 'inline)
|
||||
(let ((raw (org-babel-execute-src-block
|
||||
nil info '((:results . "silent"))))
|
||||
|
|
|
@ -78,6 +78,7 @@
|
|||
(declare-function org-list-to-generic "org-list" (LIST PARAMS))
|
||||
(declare-function org-list-bottom-point "org-list" ())
|
||||
|
||||
(declare-function org-babel-eval-wipe-error-buffer "ob-eval" ())
|
||||
(defgroup org-babel nil
|
||||
"Code block evaluation and management in `org-mode' documents."
|
||||
:tag "Babel"
|
||||
|
@ -242,7 +243,8 @@ then run `org-babel-execute-src-block'."
|
|||
(interactive)
|
||||
(let ((info (org-babel-get-src-block-info)))
|
||||
(if info
|
||||
(progn (org-babel-execute-src-block current-prefix-arg info) t) nil)))
|
||||
(progn (org-babel-eval-wipe-error-buffer)
|
||||
(org-babel-execute-src-block current-prefix-arg info) t) nil)))
|
||||
|
||||
;;;###autoload
|
||||
(defun org-babel-expand-src-block-maybe ()
|
||||
|
|
Loading…
Reference in New Issue