1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-12-28 10:56:57 +00:00

org-src.el (org-edit-src-exit): Fix bug when saving an empty source buffer

* org-src.el (org-edit-src-exit): Fix bug when saving an empty
source buffer.

Thanks to Hsiu-Khuern Tang for reporting this.
This commit is contained in:
Bastien Guerry 2012-10-25 10:48:33 +02:00
parent c3390982cb
commit aba9e2b94d

View File

@ -689,9 +689,10 @@ with \",*\", \",#+\", \",,*\" and \",,#+\"."
(kill-buffer buffer))
(goto-char beg)
(when allow-write-back-p
(delete-region beg (1- end))
(insert code)
(delete-char 1)
(delete-region beg (max beg (1- end)))
(unless (string-match "^[ \t]*$" code)
(insert code)
(delete-char 1))
(goto-char beg)
(if single (just-one-space)))
(if (memq t (mapcar (lambda (overlay)