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

Use theindex.inc and theindex.org as described in the manual.

* org-publish.el (org-publish-index-generate-theindex): Use
theindex.inc for storing index entries, and theindex.org for
including theindex.inc.

Commit f0d7ac removed the theindex.inc and directly included
index entries in theindex.org.  This is not as flexible as using
theindex.org as a page you want to manually edit, which can then
include theindex.inc with proper content.

Thanks to Stefan Vollmar for insisting about this issue.
This commit is contained in:
Bastien Guerry 2011-12-17 15:55:18 +01:00
parent a3ac9d80ed
commit 006d704145

View file

@ -997,7 +997,7 @@ the project."
(kill-buffer buf))
(setq index (sort index (lambda (a b) (string< (downcase (car a))
(downcase (car b))))))
(setq ibuffer (find-file-noselect (expand-file-name "theindex.org" directory)))
(setq ibuffer (find-file-noselect (expand-file-name "theindex.inc" directory)))
(with-current-buffer ibuffer
(erase-buffer)
(insert "* Index\n")
@ -1024,7 +1024,16 @@ the project."
(insert " - " link "\n")
(insert " - " link "\n")))
(save-buffer))
(kill-buffer ibuffer)))
(kill-buffer ibuffer)
;; Create theindex.org if it doesn't exist already
(let ((index-file (expand-file-name "theindex.org" directory)))
(unless (file-exists-p index-file)
(setq ibuffer (find-file-noselect index-file))
(with-current-buffer ibuffer
(erase-buffer)
(insert "\n\n#+include: \"theindex.inc\"\n\n")
(save-buffer))
(kill-buffer ibuffer)))))
;; Caching functions: