]> git.eshelyaron.com Git - esy-publish.git/commitdiff
Only kill buffers that were opened during export
authorEshel Yaron <me@eshelyaron.com>
Sun, 16 Apr 2023 16:28:07 +0000 (19:28 +0300)
committerEshel Yaron <me@eshelyaron.com>
Sun, 16 Apr 2023 16:28:07 +0000 (19:28 +0300)
esy-publish.el

index ead4a2dee07fa2c07738636bf46e3edccccf2264..fffcd9cde1a25860e2855de71f24b3e9b85fafe1 100644 (file)
@@ -6,7 +6,7 @@
 ;; Maintainer: Eshel Yaron <me@eshelyaron.com>
 ;; Keywords: languages extensions
 ;; URL: http://git.eshelyaron.com/gitweb/?p=esy-publish.git
-;; Package-Version: 0.7.0
+;; Package-Version: 0.8.0
 ;; Package-Requires: ((emacs "28.2"))
 
 ;; This file is NOT part of GNU Emacs.
              (link nil ,(concat "https://eshelyaron.com/posts/" file))
              (guid ((isPermaLink . "true")) ,(concat "https://eshelyaron.com/posts/" file))
              (pubDate nil ,(substring file 0 10))
-             (description nil ,(format "<![CDATA[%s]]>" (esy-publish--dom-to-string (car (dom-by-id dom "content")))))))))
+             (description nil ,(format "<![CDATA[%s]]>" (esy-publish--dom-to-string (car (dom-by-id dom "content")))))))
+    (push (current-buffer) esy-publish--buffers)))
 
 (defun esy-publish--finalize-sitemap (plist)
   (let ((locs (mapcar #'esy-publish--file-url
          (make-backup-files nil)
          (auto-save-default nil)
          (esy-publish--buffers nil)
+         (initial-buffers (buffer-list))
          (org-publish-project-alist
           (list '("all" :components ("assets" "org"))
                 (list "assets"
                                   (time ((class . "copyright-year")) "2023")
                                   " %a"))))))))
     (org-publish "all" force)
-    (dolist (buffer esy-publish--buffers)
-      (kill-buffer)))
+    (dolist (buffer (seq-difference esy-publish--buffers
+                                    initial-buffers))
+      (with-current-buffer buffer
+        (set-buffer-modified-p nil))
+      (kill-buffer buffer)))
   (setq esy-publish--buffers nil))
 
 (defun esy-publish-all ()