org-src.el (org-edit-src-code): Don't set `buffer-auto-save-file-name' unless `auto-save-default' is non-nil

* org-src.el (org-edit-src-code): Don't set
`buffer-auto-save-file-name' unless `auto-save-default' is
non-nil.

Thanks to Charles Berry for reporting this.
This commit is contained in:
Bastien Guerry 2013-04-07 22:43:02 +02:00
parent d6d7bc55b8
commit 8c7e46b6a9
1 changed files with 5 additions and 4 deletions

View File

@ -350,10 +350,11 @@ the display of windows containing the Org buffer and the code buffer."
(if org-src-preserve-indentation col (max 0 (- col total-nindent))))
(org-src-mode)
(set-buffer-modified-p nil)
(setq buffer-file-name nil
buffer-auto-save-file-name
(concat (make-temp-name "org-src-")
(format-time-string "-%Y-%d-%m") ".txt"))
(setq buffer-file-name nil)
(when auto-save-default
(setq buffer-auto-save-file-name
(concat (make-temp-name "org-src-")
(format-time-string "-%Y-%d-%m") ".txt")))
(and org-edit-src-persistent-message
(org-set-local 'header-line-format msg))
(let ((edit-prep-func (intern (concat "org-babel-edit-prep:" lang))))