diff --git a/ORGWEBPAGE/Changes.org b/ORGWEBPAGE/Changes.org index de682cc15..429f54670 100644 --- a/ORGWEBPAGE/Changes.org +++ b/ORGWEBPAGE/Changes.org @@ -126,7 +126,7 @@ that the command =org-open-at-point-global= which follows links not only in Org-mode, but in arbitrary files like source code files etc, will work also with links created by - planner. The following customization es needed to make all of + planner. The following customization is needed to make all of this work #+begin_src emacs-lisp diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9749f9774..24087ef74 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2008-11-24 Carsten Dominik + * org-publish.el (org-publish-org-index): Improve removal of + temporary buffers. + * org-agenda.el (org-get-closed): Re-apply changes accidentially overwritten by last commit to Emacs. diff --git a/lisp/org-publish.el b/lisp/org-publish.el index 6e3d1af85..2a3582707 100644 --- a/lisp/org-publish.el +++ b/lisp/org-publish.el @@ -619,13 +619,12 @@ Default for INDEX-FILENAME is 'index.org'." (concat "Index for project " (car project)))) (index-style (or (plist-get project-plist :index-style) 'tree)) - (index-buffer (find-buffer-visiting index-filename)) + (visiting (find-buffer-visiting index-filename)) (ifn (file-name-nondirectory index-filename)) - file) - ;; if buffer is already open, kill it to prevent error message - (if index-buffer - (kill-buffer index-buffer)) - (with-temp-buffer + file index-buffer) + (with-current-buffer (setq index-buffer + (or visiting (find-file index-filename))) + (erase-buffer) (insert (concat "#+TITLE: " index-title "\n\n")) (while (setq file (pop files)) (let ((fn (file-name-nondirectory file)) @@ -662,10 +661,9 @@ Default for INDEX-FILENAME is 'index.org'." ;; This is common to 'flat and 'tree (insert (concat indent-str " + [[file:" link "][" (org-publish-find-title file) - "]]\n")) - ))) - (write-file index-filename) - (kill-buffer (current-buffer))))) + "]]\n"))))) + (save-buffer)) + (or visiting (kill-buffer index-buffer)))) (defun org-publish-find-title (file) "Find the title of file in project."