1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-26 07:33:39 +00:00

ob-eval: Do not use read-only mode, switch to compilation mode only once

* lisp/ob-eval.el (org-babel-eval): Switch to compilation mode only if
  the current mode is not already (a derived mode of)
  compilation-mode.  Remove the read-only state from the buffer
  directly without using `read-only-mode'.
This commit is contained in:
Achim Gratz 2014-09-10 11:22:43 +02:00
parent 2f8067c915
commit ec8f245d27

View File

@ -60,9 +60,10 @@ STDERR with `org-babel-eval-error-notify'."
(save-excursion
(when (get-buffer org-babel-error-buffer-name)
(with-current-buffer org-babel-error-buffer-name
(compilation-mode)
;;compilation-mode enforces read-only
(read-only-mode 0))))
(unless (derived-mode-p 'compilation-mode)
(compilation-mode))
;; Compilation-mode enforces read-only, but Babel expects the buffer modifiable.
(setq buffer-read-only nil))))
nil)
(buffer-string)))))