From: Thomas Fitzsimmons Date: Fri, 17 Jun 2016 01:59:27 +0000 (-0400) Subject: packages/excorporate: Interoperate with `save-some-buffers' X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/0ef1d9b5c9e183827a930f08da9dd201f6874329 packages/excorporate: Interoperate with `save-some-buffers' * packages/excorporate/excorporate-org.el (exco-org-initialize-buffer): Set buffer-file-name to excorporate-org-buffer-name during org-mode initialization (bug#23765). --- diff --git a/packages/excorporate/excorporate-org.el b/packages/excorporate/excorporate-org.el index 05d11fb60..22661619f 100644 --- a/packages/excorporate/excorporate-org.el +++ b/packages/excorporate/excorporate-org.el @@ -34,8 +34,14 @@ "Add initial text to the destination buffer." (with-current-buffer (get-buffer-create excorporate-org-buffer-name) (setq buffer-read-only t) - (setq buffer-file-name excorporate-org-buffer-name) - (org-mode) + ;; Some Org mode configurations need `buffer-file-name' to be + ;; non-nil, or they'll make `org-mode' error out, for example + ;; `org-startup-with-latex-preview'. Set `buffer-file-name' to + ;; something non-nil temporarily during initialization. Don't + ;; leave it set or `save-some-buffers' will always prompt about + ;; *Excorporate*. + (let ((buffer-file-name excorporate-org-buffer-name)) + (org-mode)) (use-local-map (copy-keymap org-mode-map)) (local-set-key "q" 'quit-window) (display-buffer (current-buffer))