[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/excorporate 68c5585 17/93: packages/excorporate: Intero

From: Stefan Monnier
Subject: [elpa] externals/excorporate 68c5585 17/93: packages/excorporate: Interoperate with `save-some-buffers'
Date: Sun, 29 Nov 2020 15:42:59 -0500 (EST)

branch: externals/excorporate
commit 68c558541ae3ea2d35a6aaee65327c9d9f691daa
Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Commit: Thomas Fitzsimmons <fitzsim@fitzsim.org>

    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
 excorporate-org.el | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/excorporate-org.el b/excorporate-org.el
index 05d11fb..2266161 100644
--- a/excorporate-org.el
+++ b/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))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]