From d1f17840a786f6af82874483a4f93197c85c1624 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Sun, 16 Apr 2023 19:28:07 +0300 Subject: [PATCH] Only kill buffers that were opened during export --- esy-publish.el | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/esy-publish.el b/esy-publish.el index ead4a2d..fffcd9c 100644 --- a/esy-publish.el +++ b/esy-publish.el @@ -6,7 +6,7 @@ ;; Maintainer: Eshel Yaron ;; 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. @@ -330,7 +330,8 @@ (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 "" (esy-publish--dom-to-string (car (dom-by-id dom "content"))))))))) + (description nil ,(format "" (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 @@ -428,6 +429,7 @@ (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" @@ -511,8 +513,11 @@ (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 () -- 2.39.2