diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-02-17 22:33:16 +0100 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-02-17 22:33:16 +0100 |
commit | 120b565054c87a11ad50a6a7cd3ce46191909568 (patch) | |
tree | 6cbd833443397aef1e67a9a20422427644e941dc | |
parent | 542890cd3f7fc482c7a1c949de6eba46af9fb4e0 (diff) | |
parent | bf601016dce45df7eeaebe270063829c8a3715b3 (diff) | |
download | org-mode-120b565054c87a11ad50a6a7cd3ce46191909568.tar.gz |
Merge branch 'maint'
-rw-r--r-- | lisp/org-src.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/org-src.el b/lisp/org-src.el index d07655e..2379a58 100644 --- a/lisp/org-src.el +++ b/lisp/org-src.el @@ -646,7 +646,8 @@ See also `org-src-mode-hook'." (setq buffer-offer-save t) (setq buffer-file-name (concat (buffer-file-name (marker-buffer org-src--beg-marker)) - "[" (buffer-name) "]"))) + "[" (buffer-name) "]")) + (setq-local write-contents-functions '(org-edit-src-save))) (setq buffer-read-only t)))) (add-hook 'org-src-mode-hook #'org-src-mode-configure-edit-buffer) @@ -1054,7 +1055,10 @@ Throw an error if there is no such buffer." (insert edited-code) (when (and expecting-bol (not (bolp))) (insert "\n"))) (save-buffer) - (move-overlay overlay beg (point))))) + (move-overlay overlay beg (point)))) + ;; `write-contents-functions' require the function to return + ;; a non-nil value so that other functions are not called. + t) (defun org-edit-src-exit () "Kill current sub-editing buffer and return to source buffer." |