org-export: Default title doesn't overwrite a blank #+title keyword
* contrib/lisp/org-export.el (org-export-collect-options): Default title is retrieved before in-buffer settings are read. Also, be more careful about indirect buffers.
This commit is contained in:
parent
a7389dff1e
commit
57f51dce5d
|
@ -843,6 +843,13 @@ settings."
|
||||||
(let ((options (org-combine-plists
|
(let ((options (org-combine-plists
|
||||||
;; ... from global variables...
|
;; ... from global variables...
|
||||||
(org-export-get-global-options backend)
|
(org-export-get-global-options backend)
|
||||||
|
;; ... from buffer's name (default title)...
|
||||||
|
`(:title
|
||||||
|
,(or (let ((file (buffer-file-name (buffer-base-buffer))))
|
||||||
|
(and file
|
||||||
|
(file-name-sans-extension
|
||||||
|
(file-name-nondirectory file))))
|
||||||
|
(buffer-name (buffer-base-buffer))))
|
||||||
;; ... from an external property list...
|
;; ... from an external property list...
|
||||||
ext-plist
|
ext-plist
|
||||||
;; ... from in-buffer settings...
|
;; ... from in-buffer settings...
|
||||||
|
@ -854,16 +861,7 @@ settings."
|
||||||
(and subtreep
|
(and subtreep
|
||||||
(org-export-get-subtree-options)))))
|
(org-export-get-subtree-options)))))
|
||||||
;; Add initial options.
|
;; Add initial options.
|
||||||
(setq options (append (org-export-initial-options options)
|
(setq options (append (org-export-initial-options options) options))
|
||||||
options))
|
|
||||||
;; Set a default title if none has been specified so far.
|
|
||||||
(unless (plist-get options :title)
|
|
||||||
(setq options (plist-put options :title
|
|
||||||
(or (and buffer-file-name
|
|
||||||
(file-name-sans-extension
|
|
||||||
(file-name-nondirectory
|
|
||||||
buffer-file-name)))
|
|
||||||
(buffer-name)))))
|
|
||||||
;; Return plist.
|
;; Return plist.
|
||||||
options))
|
options))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue