From 241acc9a36d7e942bb025f27dad8087145d10ce4 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Sat, 25 Jun 2005 04:02:11 +0000 Subject: [PATCH] Add `muse-current-file', fix minor QuickStart issue. * examples/QuickStart: Make John Wiegley the author. * lisp/muse-blosxom.el (muse-blosxom-markup-date-directive): Use `muse-current-file' instead of `buffer-file-name'. * lisp/muse-project.el (muse-current-project): Document. * lisp/muse-project.el (muse-current-file): New variable indicating the name, including path, of the file that is currently being published. (muse-project-of-file): Make use of `muse-current-file'. * lisp/muse-publish.el (muse-publish-file): Set `muse-current-file' here. * lisp/muse.el (muse-page-name): Make use of `muse-current-file'. git-archimport-id: mwolson@gnu.org--2005/muse--main--1.0--patch-78 --- ChangeLog | 29 +++++++++++++++++++++++++++++ examples/QuickStart | 1 + lisp/muse-blosxom.el | 2 +- lisp/muse-poem.el | 3 --- lisp/muse-project.el | 9 +++++++-- lisp/muse-publish.el | 1 + lisp/muse.el | 2 +- 7 files changed, 40 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 27d1ce6..30a6b17 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,35 @@ # arch-tag: automatic-ChangeLog--mwolson@gnu.org--2005/muse--main--1.0 # +2005-06-25 04:02:11 GMT Michael Olson patch-78 + + Summary: + Add `muse-current-file', fix minor QuickStart issue. + Revision: + muse--main--1.0--patch-78 + + * examples/QuickStart: Make John Wiegley the author. + + * lisp/muse-blosxom.el (muse-blosxom-markup-date-directive): Use + `muse-current-file' instead of `buffer-file-name'. + + * lisp/muse-project.el (muse-current-project): Document. + + * lisp/muse-project.el (muse-current-file): New variable indicating the + name, including path, of the file that is currently being published. + (muse-project-of-file): Make use of + `muse-current-file'. + + * lisp/muse-publish.el (muse-publish-file): Set `muse-current-file' here. + + * lisp/muse.el (muse-page-name): Make use of `muse-current-file'. + + modified files: + ChangeLog examples/QuickStart lisp/muse-blosxom.el + lisp/muse-poem.el lisp/muse-project.el lisp/muse-publish.el + lisp/muse.el + + 2005-06-24 21:15:35 GMT Michael Olson patch-77 Summary: diff --git a/examples/QuickStart b/examples/QuickStart index 98339c6..927549c 100644 --- a/examples/QuickStart +++ b/examples/QuickStart @@ -1,3 +1,4 @@ +#author John Wiegley #title The Emacs Muse Emacs Muse is an authoring and publishing environment for Emacs. It diff --git a/lisp/muse-blosxom.el b/lisp/muse-blosxom.el index 41112d3..9c4500c 100644 --- a/lisp/muse-blosxom.el +++ b/lisp/muse-blosxom.el @@ -132,7 +132,7 @@ See `muse-blosxom' for more information." (save-match-data (add-to-list 'muse-blosxom-page-date-alist - `(,buffer-file-name . ,date)))) + `(,muse-current-file . ,date)))) "") ;; Enter a new blog entry diff --git a/lisp/muse-poem.el b/lisp/muse-poem.el index 7e76b6f..8444117 100644 --- a/lisp/muse-poem.el +++ b/lisp/muse-poem.el @@ -188,9 +188,6 @@ differs little between the various styles." (forward-line 1)) nil)) -(eval-when-compile - (defvar muse-current-project)) - (defvar muse-poem-tag '("poem" nil t muse-poem-markup-tag)) (defun muse-poem-markup-tag (beg end attrs) diff --git a/lisp/muse-project.el b/lisp/muse-project.el index ebb4d63..1f84e15 100644 --- a/lisp/muse-project.el +++ b/lisp/muse-project.el @@ -68,9 +68,14 @@ when publishing files in that project." :type 'regexp :group 'muse-regexps) -(defvar muse-current-project nil) +(defvar muse-current-project nil + "Project we are currently visiting.") (make-variable-buffer-local 'muse-current-project) +(defvar muse-current-file nil + "File currently being published.") +(make-variable-buffer-local 'muse-current-file) + (defsubst muse-project (&optional project) "Resolve the given PROJECT into a full Muse project, if it is a string." (if (null project) @@ -183,7 +188,7 @@ disk." If PATHNAME is nil, the current buffer's filename is used." (if (and (null pathname) muse-current-project) muse-current-project - (when (or pathname buffer-file-name) + (when (or pathname muse-current-file buffer-file-name) (let* ((file (file-truename (or pathname buffer-file-name))) (dir (file-name-directory file)) (project-entry muse-project-alist) diff --git a/lisp/muse-publish.el b/lisp/muse-publish.el index 2a7ea38..8c2de4d 100644 --- a/lisp/muse-publish.el +++ b/lisp/muse-publish.el @@ -537,6 +537,7 @@ the file is published no matter what." (message "Publishing %s ..." file)) (with-temp-buffer (insert-file-contents file t) + (setq muse-current-file file) (muse-publish-markup-buffer (muse-page-name file) style) (let ((backup-inhibited t)) (write-file output-path)) diff --git a/lisp/muse.el b/lisp/muse.el index f20116c..5d81269 100644 --- a/lisp/muse.el +++ b/lisp/muse.el @@ -81,7 +81,7 @@ familiar with Emacs." All this means is that certain extensions, like .gz, are removed." (save-match-data (unless name - (setq name buffer-file-name)) + (setq name (or muse-current-file buffer-file-name))) (if name (let ((page (file-name-nondirectory name))) (if (string-match muse-ignored-extensions-regexp page) -- 2.11.4.GIT