0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-08-23 17:48:35 +00:00

Fix return value of `org-publish-find-title'.

My previous patch to remove buffers created just for retrieving the
page title did mess up the return value of this function.  This has
now been fixed.
This commit is contained in:
Carsten Dominik 2008-11-03 13:52:16 +01:00
parent 0dc772285e
commit cceb998feb

View file

@ -674,18 +674,21 @@ Default for INDEX-FILENAME is 'index.org'."
(defun org-publish-find-title (file) (defun org-publish-find-title (file)
"Find the title of file in project." "Find the title of file in project."
(let* ((visiting (find-buffer-visiting file)) (let* ((visiting (find-buffer-visiting file))
(buffer (or visiting (find-file-noselect file)))) (buffer (or visiting (find-file-noselect file)))
title)
(save-excursion (save-excursion
(set-buffer buffer) (set-buffer buffer)
(let* ((opt-plist (org-combine-plists (org-default-export-plist) (let* ((opt-plist (org-combine-plists (org-default-export-plist)
(org-infile-export-plist)))) (org-infile-export-plist))))
(or (plist-get opt-plist :title) (setq title
(and (not (or (plist-get opt-plist :title)
(plist-get opt-plist :skip-before-1st-heading)) (and (not
(org-export-grab-title-from-buffer)) (plist-get opt-plist :skip-before-1st-heading))
(file-name-nondirectory (file-name-sans-extension file))))) (org-export-grab-title-from-buffer))
(file-name-nondirectory (file-name-sans-extension file))))))
(unless visiting (unless visiting
(kill-buffer buffer)))) (kill-buffer buffer))
title))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Interactive publishing functions ;;; Interactive publishing functions