diff options
author | Dan Davison <davison@stats.ox.ac.uk> | 2009-10-14 18:43:25 -0400 |
---|---|---|
committer | Dan Davison <davison@stats.ox.ac.uk> | 2009-10-14 18:43:25 -0400 |
commit | 9592b6f1bd0811fd1d7478755e5a44457ab9fc14 (patch) | |
tree | 4206725cb3ab21c9f420a4d64309a8cdb7b9208d | |
parent | 23b4026937572339a453922bb79a05d1e82597e7 (diff) | |
download | org-mode-9592b6f1bd0811fd1d7478755e5a44457ab9fc14.tar.gz |
New variable org-src-ask-before-returning-to-edit-buffer
If an active edit buffer exists for a source block, and this variable
is non-nil, then org-edit-src-code will not ask before returning to
the edit buffer, and future saves will overwrite the source block's
contents.
-rw-r--r-- | lisp/org-src.el | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/org-src.el b/lisp/org-src.el index 03e5b45..685a311 100644 --- a/lisp/org-src.el +++ b/lisp/org-src.el @@ -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 |