|
@@ -148,6 +148,12 @@ For example, there is no ocaml-mode in Emacs, but the mode to use is
|
|
|
(defvar org-edit-src-overlay nil)
|
|
|
(defvar org-edit-src-block-indentation nil)
|
|
|
|
|
|
+(defvar org-src-ask-before-returning-to-edit-buffer t
|
|
|
+ "If nil, when org-edit-src code is used on a block that already
|
|
|
+ has an active edit buffer, it will switch to that edit buffer
|
|
|
+ immediately; otherwise it will ask whether you want to return
|
|
|
+ to the existing edit buffer.")
|
|
|
+
|
|
|
(define-minor-mode org-src-mode
|
|
|
"Minor mode for language major mode buffers generated by org.
|
|
|
This minor mode is turned on in two situations:
|
|
@@ -191,6 +197,7 @@ the edited version."
|
|
|
(error "No such language mode: %s" lang-f))
|
|
|
(org-goto-line line)
|
|
|
(if (and (setq buffer (org-edit-src-find-buffer beg end))
|
|
|
+ org-src-ask-before-returning-to-edit-buffer
|
|
|
(y-or-n-p "Return to existing edit buffer? [n] will revert changes: "))
|
|
|
(switch-to-buffer buffer)
|
|
|
(when buffer
|