mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-23 07:18:40 +00:00
Improve removal of temporary buffers during publishing.
Report by Richard Riley.
This commit is contained in:
parent
eb48aaa7c1
commit
663960af62
|
@ -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
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
2008-11-24 Carsten Dominik <carsten.dominik@gmail.com>
|
||||
|
||||
* 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.
|
||||
|
||||
|
|
|
@ -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."
|
||||
|
|
Loading…
Reference in a new issue