ox-publish: Fix prefix for some variables
* lisp/ox-publish.el (org-publish-sitemap-sort-files, org-publish-sitemap-sort-folders, org-publish-sitemap-ignore-case, org-publish-sitemap-requested, org-publish-sitemap-date-format, org-publish-sitemap-file-entry-format): Set prefix to "org-publish-sitemap" instead of "org-sitemap". (org-publish-compare-directory-files, org-publish-get-base-files-1, org-publish-projects, org-publish-format-file-entry): Use new prefix.
This commit is contained in:
parent
ab8bfb8460
commit
74750b0839
|
@ -383,19 +383,19 @@ This splices all the components into the list."
|
||||||
(push p rtn)))
|
(push p rtn)))
|
||||||
(nreverse (delete-dups (delq nil rtn)))))
|
(nreverse (delete-dups (delq nil rtn)))))
|
||||||
|
|
||||||
(defvar org-sitemap-sort-files)
|
(defvar org-publish-sitemap-sort-files)
|
||||||
(defvar org-sitemap-sort-folders)
|
(defvar org-publish-sitemap-sort-folders)
|
||||||
(defvar org-sitemap-ignore-case)
|
(defvar org-publish-sitemap-ignore-case)
|
||||||
(defvar org-sitemap-requested)
|
(defvar org-publish-sitemap-requested)
|
||||||
(defvar org-sitemap-date-format)
|
(defvar org-publish-sitemap-date-format)
|
||||||
(defvar org-sitemap-file-entry-format)
|
(defvar org-publish-sitemap-file-entry-format)
|
||||||
(defun org-publish-compare-directory-files (a b)
|
(defun org-publish-compare-directory-files (a b)
|
||||||
"Predicate for `sort', that sorts folders and files for sitemap."
|
"Predicate for `sort', that sorts folders and files for sitemap."
|
||||||
(let ((retval t))
|
(let ((retval t))
|
||||||
(when (or org-sitemap-sort-files org-sitemap-sort-folders)
|
(when (or org-publish-sitemap-sort-files org-publish-sitemap-sort-folders)
|
||||||
;; First we sort files:
|
;; First we sort files:
|
||||||
(when org-sitemap-sort-files
|
(when org-publish-sitemap-sort-files
|
||||||
(case org-sitemap-sort-files
|
(case org-publish-sitemap-sort-files
|
||||||
(alphabetically
|
(alphabetically
|
||||||
(let* ((adir (file-directory-p a))
|
(let* ((adir (file-directory-p a))
|
||||||
(aorg (and (string-match "\\.org$" a) (not adir)))
|
(aorg (and (string-match "\\.org$" a) (not adir)))
|
||||||
|
@ -405,7 +405,7 @@ This splices all the components into the list."
|
||||||
(org-publish-find-title a)) a))
|
(org-publish-find-title a)) a))
|
||||||
(B (if borg (concat (file-name-directory b)
|
(B (if borg (concat (file-name-directory b)
|
||||||
(org-publish-find-title b)) b)))
|
(org-publish-find-title b)) b)))
|
||||||
(setq retval (if org-sitemap-ignore-case
|
(setq retval (if org-publish-sitemap-ignore-case
|
||||||
(not (string-lessp (upcase B) (upcase A)))
|
(not (string-lessp (upcase B) (upcase A)))
|
||||||
(not (string-lessp B A))))))
|
(not (string-lessp B A))))))
|
||||||
((anti-chronologically chronologically)
|
((anti-chronologically chronologically)
|
||||||
|
@ -414,17 +414,17 @@ This splices all the components into the list."
|
||||||
(A (+ (lsh (car adate) 16) (cadr adate)))
|
(A (+ (lsh (car adate) 16) (cadr adate)))
|
||||||
(B (+ (lsh (car bdate) 16) (cadr bdate))))
|
(B (+ (lsh (car bdate) 16) (cadr bdate))))
|
||||||
(setq retval
|
(setq retval
|
||||||
(if (eq org-sitemap-sort-files 'chronologically) (<= A B)
|
(if (eq org-publish-sitemap-sort-files 'chronologically) (<= A B)
|
||||||
(>= A B)))))))
|
(>= A B)))))))
|
||||||
;; Directory-wise wins:
|
;; Directory-wise wins:
|
||||||
(when org-sitemap-sort-folders
|
(when org-publish-sitemap-sort-folders
|
||||||
;; a is directory, b not:
|
;; a is directory, b not:
|
||||||
(cond
|
(cond
|
||||||
((and (file-directory-p a) (not (file-directory-p b)))
|
((and (file-directory-p a) (not (file-directory-p b)))
|
||||||
(setq retval (equal org-sitemap-sort-folders 'first)))
|
(setq retval (equal org-publish-sitemap-sort-folders 'first)))
|
||||||
;; a is not a directory, but b is:
|
;; a is not a directory, but b is:
|
||||||
((and (not (file-directory-p a)) (file-directory-p b))
|
((and (not (file-directory-p a)) (file-directory-p b))
|
||||||
(setq retval (equal org-sitemap-sort-folders 'last))))))
|
(setq retval (equal org-publish-sitemap-sort-folders 'last))))))
|
||||||
retval))
|
retval))
|
||||||
|
|
||||||
(defun org-publish-get-base-files-1
|
(defun org-publish-get-base-files-1
|
||||||
|
@ -457,7 +457,7 @@ matching the regexp SKIP-DIR when recursing through BASE-DIR."
|
||||||
(or (file-directory-p file)
|
(or (file-directory-p file)
|
||||||
(and match (string-match match file))))
|
(and match (string-match match file))))
|
||||||
(directory-files base-dir t)))))
|
(directory-files base-dir t)))))
|
||||||
(if (not org-sitemap-requested) all-files
|
(if (not org-publish-sitemap-requested) all-files
|
||||||
(sort all-files 'org-publish-compare-directory-files)))))
|
(sort all-files 'org-publish-compare-directory-files)))))
|
||||||
|
|
||||||
(defun org-publish-get-base-files (project &optional exclude-regexp)
|
(defun org-publish-get-base-files (project &optional exclude-regexp)
|
||||||
|
@ -472,15 +472,15 @@ matching filenames."
|
||||||
(extension (or (plist-get project-plist :base-extension) "org"))
|
(extension (or (plist-get project-plist :base-extension) "org"))
|
||||||
;; sitemap-... variables are dynamically scoped for
|
;; sitemap-... variables are dynamically scoped for
|
||||||
;; org-publish-compare-directory-files:
|
;; org-publish-compare-directory-files:
|
||||||
(org-sitemap-requested
|
(org-publish-sitemap-requested
|
||||||
(plist-get project-plist :auto-sitemap))
|
(plist-get project-plist :auto-sitemap))
|
||||||
(sitemap-filename
|
(sitemap-filename
|
||||||
(or (plist-get project-plist :sitemap-filename) "sitemap.org"))
|
(or (plist-get project-plist :sitemap-filename) "sitemap.org"))
|
||||||
(org-sitemap-sort-folders
|
(org-publish-sitemap-sort-folders
|
||||||
(if (plist-member project-plist :sitemap-sort-folders)
|
(if (plist-member project-plist :sitemap-sort-folders)
|
||||||
(plist-get project-plist :sitemap-sort-folders)
|
(plist-get project-plist :sitemap-sort-folders)
|
||||||
org-publish-sitemap-sort-folders))
|
org-publish-sitemap-sort-folders))
|
||||||
(org-sitemap-sort-files
|
(org-publish-sitemap-sort-files
|
||||||
(cond ((plist-member project-plist :sitemap-sort-files)
|
(cond ((plist-member project-plist :sitemap-sort-files)
|
||||||
(plist-get project-plist :sitemap-sort-files))
|
(plist-get project-plist :sitemap-sort-files))
|
||||||
;; For backward compatibility:
|
;; For backward compatibility:
|
||||||
|
@ -488,18 +488,19 @@ matching filenames."
|
||||||
(if (plist-get project-plist :sitemap-alphabetically)
|
(if (plist-get project-plist :sitemap-alphabetically)
|
||||||
'alphabetically nil))
|
'alphabetically nil))
|
||||||
(t org-publish-sitemap-sort-files)))
|
(t org-publish-sitemap-sort-files)))
|
||||||
(org-sitemap-ignore-case
|
(org-publish-sitemap-ignore-case
|
||||||
(if (plist-member project-plist :sitemap-ignore-case)
|
(if (plist-member project-plist :sitemap-ignore-case)
|
||||||
(plist-get project-plist :sitemap-ignore-case)
|
(plist-get project-plist :sitemap-ignore-case)
|
||||||
org-publish-sitemap-sort-ignore-case))
|
org-publish-sitemap-sort-ignore-case))
|
||||||
(match (if (eq extension 'any) "^[^\\.]"
|
(match (if (eq extension 'any) "^[^\\.]"
|
||||||
(concat "^[^\\.].*\\.\\(" extension "\\)$"))))
|
(concat "^[^\\.].*\\.\\(" extension "\\)$"))))
|
||||||
;; Make sure `org-sitemap-sort-folders' has an accepted value
|
;; Make sure `org-publish-sitemap-sort-folders' has an accepted
|
||||||
(unless (memq org-sitemap-sort-folders '(first last))
|
;; value.
|
||||||
(setq org-sitemap-sort-folders nil))
|
(unless (memq org-publish-sitemap-sort-folders '(first last))
|
||||||
|
(setq org-publish-sitemap-sort-folders nil))
|
||||||
|
|
||||||
(setq org-publish-temp-files nil)
|
(setq org-publish-temp-files nil)
|
||||||
(if org-sitemap-requested
|
(if org-publish-sitemap-requested
|
||||||
(pushnew (expand-file-name (concat base-dir sitemap-filename))
|
(pushnew (expand-file-name (concat base-dir sitemap-filename))
|
||||||
org-publish-temp-files))
|
org-publish-temp-files))
|
||||||
(org-publish-get-base-files-1 base-dir recurse match
|
(org-publish-get-base-files-1 base-dir recurse match
|
||||||
|
@ -678,10 +679,10 @@ If `:auto-sitemap' is set, publish the sitemap too. If
|
||||||
"sitemap.org"))
|
"sitemap.org"))
|
||||||
(sitemap-function (or (plist-get project-plist :sitemap-function)
|
(sitemap-function (or (plist-get project-plist :sitemap-function)
|
||||||
'org-publish-org-sitemap))
|
'org-publish-org-sitemap))
|
||||||
(org-sitemap-date-format
|
(org-publish-sitemap-date-format
|
||||||
(or (plist-get project-plist :sitemap-date-format)
|
(or (plist-get project-plist :sitemap-date-format)
|
||||||
org-publish-sitemap-date-format))
|
org-publish-sitemap-date-format))
|
||||||
(org-sitemap-file-entry-format
|
(org-publish-sitemap-file-entry-format
|
||||||
(or (plist-get project-plist :sitemap-file-entry-format)
|
(or (plist-get project-plist :sitemap-file-entry-format)
|
||||||
org-publish-sitemap-file-entry-format))
|
org-publish-sitemap-file-entry-format))
|
||||||
(preparation-function
|
(preparation-function
|
||||||
|
@ -775,7 +776,7 @@ Default for SITEMAP-FILENAME is 'sitemap.org'."
|
||||||
;; This is common to 'flat and 'tree
|
;; This is common to 'flat and 'tree
|
||||||
(let ((entry
|
(let ((entry
|
||||||
(org-publish-format-file-entry
|
(org-publish-format-file-entry
|
||||||
org-sitemap-file-entry-format file project-plist))
|
org-publish-sitemap-file-entry-format file project-plist))
|
||||||
(regexp "\\(.*\\)\\[\\([^][]+\\)\\]\\(.*\\)"))
|
(regexp "\\(.*\\)\\[\\([^][]+\\)\\]\\(.*\\)"))
|
||||||
(cond ((string-match-p regexp entry)
|
(cond ((string-match-p regexp entry)
|
||||||
(string-match regexp entry)
|
(string-match regexp entry)
|
||||||
|
@ -791,9 +792,10 @@ Default for SITEMAP-FILENAME is 'sitemap.org'."
|
||||||
(or visiting (kill-buffer sitemap-buffer))))
|
(or visiting (kill-buffer sitemap-buffer))))
|
||||||
|
|
||||||
(defun org-publish-format-file-entry (fmt file project-plist)
|
(defun org-publish-format-file-entry (fmt file project-plist)
|
||||||
(format-spec fmt
|
(format-spec
|
||||||
|
fmt
|
||||||
`((?t . ,(org-publish-find-title file t))
|
`((?t . ,(org-publish-find-title file t))
|
||||||
(?d . ,(format-time-string org-sitemap-date-format
|
(?d . ,(format-time-string org-publish-sitemap-date-format
|
||||||
(org-publish-find-date file)))
|
(org-publish-find-date file)))
|
||||||
(?a . ,(or (plist-get project-plist :author) user-full-name)))))
|
(?a . ,(or (plist-get project-plist :author) user-full-name)))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue