Hi Carsten and Friends of Org-mode, appended is the ongoing caching stuff as patch against the current master. Please everyone: test this patch and report not _if_ it breaks something, but _what_ it actually breaks :-P It is meant to make life as a "publisher" easier (or at least faster ... or longer even?). * What it does It writes the information gathered during publishing to disk and re-loads it from there the next time you publish the same project. All those informations, currently titles and publishing-timestamps, will survive a restart of emacs. One cache file per publishing project is used. The contents of that file is the elisp that fills the new variable `org-publish-cache'. The cache is loaded using `load-file', once a project is to be published. The cache file is named like the project with `.cache' appended and lives in `org-timestamp-directory' [1] `org-publish-cache' stores key value pairs: - "timestamp-filename" => time of last publishing as integer "timestamp-filename" is that sha1 hash of the filename, publishing-directory and publishing-function. - Absolute filename => plist Currently this plist holds just one property: `:title' to speed up sitemap generation. The publishing is meant to keep working the exact way it did before. Some minor quirks remain: - The cache file is written, even if `org-publish-use-timestamps-flag' is nil. - `org-publish-cache-file-needs-publishing' could replace `org-publish-needed-p' or it's body could go there. - In case of an error, the cache is not always written and cleared. This causes no trouble though. - We should add functions to clear the cache from old stuff. Now it's growing each time a file is added or renamed, but it won't shrink once a file is removed. The only way to clear the cache is to remove all cache files using `org-publish-remove-all-timestamps' * Changes/Fixes: - Function `initialize-files-alist' and the variable `org-publish-files-alist' are not used anymore in favour of the reloadable cache and the functions for handling it. Removed therefor. - `org-publish-validate-link' was not used. Removed. - `org-publish-get-base-files' Added the variable `sitemap-requested' to avoid sorting where possible (see end of `org-publish-get-base-files-1'). - `org-publish-get-project-from-filename' does not depend on a list of files anymore. Before, all files of all projects had to be loaded which took too much time here (my org-publish-project-alist is constantly growing). Instead of that, we walk `org-publish-project-alist' until we find a project, where the properties :base-directory, :recursive, :base-extension, :include and :exclude match. This must especially be tested in different setups, since a failure might expose private files to the public. - `org-publish-file' takes an additional parameter to avoid superfloues loading and writing of the cache file when used to publish a part of a project. - Everting below. * Internal usage of the cache: - org-publish-reset-cache () Ensure the cache is nil. - org-publish-initialize-cache (project-name) Initialize the cache for a certain project. - org-publish-write-cache-file () Write the cache to file. To get and set values, four functions are provided: - org-publish-cache-set (key value) Simple key => value association. - org-publish-cache-get (key) Dito. - org-publish-cache-set-file-property (file prop value) Set a property to value in plist associated with file. - org-publish-cache-get-file-property (file prop value) Get a property's value out of plist associated with file. Helpers: - org-publish-cache-ctime-of-src (filename) Return the ctime of file filename as integer.