From 7f4c43ac5d7430fd4368f9d20299f712d8c993f5 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Thu, 7 Jul 2005 20:06:35 +0000 Subject: [PATCH] Make muse-blosxom use relative name of published file in page-date alist. * lisp/muse-blosxom.el (muse-blosxom-base-directory): Move higher in file. (muse-blosxom-update-page-date-alist): Renamed from `muse-blosxom-markup-date-directive'. Make the current file name relative to the base directory and strip file extension if necessary. git-archimport-id: mwolson@gnu.org--2005/muse--main--1.0--patch-104 --- ChangeLog | 18 ++++++++++++++++++ lisp/muse-blosxom.el | 36 +++++++++++++++++++++++------------- 2 files changed, 41 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1385b97..282eea0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,24 @@ # arch-tag: automatic-ChangeLog--mwolson@gnu.org--2005/muse--main--1.0 # +2005-07-07 20:06:35 GMT Michael Olson patch-104 + + Summary: + Make muse-blosxom use relative name of published file in page-date alist. + Revision: + muse--main--1.0--patch-104 + + * lisp/muse-blosxom.el (muse-blosxom-base-directory): Move higher in + file. + (muse-blosxom-update-page-date-alist): Renamed from + `muse-blosxom-markup-date-directive'. Make the current file name + relative to the base directory and strip file extension if necessary. + + + modified files: + ChangeLog lisp/muse-blosxom.el + + 2005-07-07 19:14:38 GMT Michael Olson patch-103 Summary: diff --git a/lisp/muse-blosxom.el b/lisp/muse-blosxom.el index 4605b79..52761f5 100644 --- a/lisp/muse-blosxom.el +++ b/lisp/muse-blosxom.el @@ -138,26 +138,36 @@ See `muse-blosxom' for more information." :type '(choice string file) :group 'muse-blosxom) +(defcustom muse-blosxom-base-directory "~/Blog" + "Base directory of blog entries. +This is the top-level directory where your Muse blog entries may be found." + :type 'directory + :group 'muse-blosxom) + ;; Maintain (published-file . date) alist, which will later be written ;; to a timestamps file; not implemented yet. (defvar muse-blosxom-page-date-alist nil) -(defun muse-blosxom-markup-date-directive () +(defun muse-blosxom-update-page-date-alist () "Add a date entry to `muse-blosxom-page-date-alist' for this page." - (add-to-list - 'muse-blosxom-page-date-alist - `(,muse-publishing-current-file . ,(muse-publishing-directive "date")))) + ;; Make current file be relative to base directory + (let ((rel-file (file-relative-name + (expand-file-name muse-publishing-current-file) + (expand-file-name muse-blosxom-base-directory)))) + ;; Strip the file extension + (when muse-ignored-file-extensions-regexp + (set rel-file (save-match-data + (and (string-match muse-ignored-file-extensions-regexp + rel-file) + (replace-match "" t t rel-file))))) + ;; Add to page-date alist + (add-to-list + 'muse-blosxom-page-date-alist + `(,rel-file . ,(muse-publishing-directive "date"))))) ;; Enter a new blog entry -(defcustom muse-blosxom-base-directory "~/Blog" - "Base directory of blog entries, used by `muse-blosxom-new-entry'. -This is the top-level directory where your blog entries may be found -locally." - :type 'directory - :group 'muse-blosxom) - (defun muse-blosxom-get-categories (&optional base) "Retrieve all of the categories from a Blosxom project. The base directory is specified by BASE, and defaults to @@ -238,13 +248,13 @@ For an example of the use of this function, see :suffix 'muse-blosxom-extension :header 'muse-blosxom-header :footer 'muse-blosxom-footer - :after 'muse-blosxom-markup-date-directive) + :after 'muse-blosxom-update-page-date-alist) (muse-derive-style "blosxom-xhtml" "xhtml" :suffix 'muse-blosxom-extension :header 'muse-blosxom-header :footer 'muse-blosxom-footer - :after 'muse-blosxom-markup-date-directive)) + :after 'muse-blosxom-update-page-date-alist)) (provide 'muse-blosxom) -- 2.11.4.GIT