From cd76c49390558c0ad634156bf487aa46e01fbb13 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Sat, 1 Apr 2006 04:20:45 +0000 Subject: [PATCH] Fix a bug triggered by batch-publishing. * lisp/muse-publish.el (muse-detect-invalid-style): Remove, since the right algorithm turned out to be simpler than I had thought. Thanks to Sergei V. Fleytin for reporting breakage with the old method. (muse-publish-file): Don't be overzealous when checking for an invalid style -- use a simpler check. (muse-batch-publish-files): Don't check for invalid styles here, since we already do so in `muse-publish-file'. git-archimport-id: mwolson@gnu.org--2006/muse--main--1.0--patch-80 --- ChangeLog.2006 | 19 +++++++++++++++++++ lisp/muse-publish.el | 24 ++++++------------------ 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/ChangeLog.2006 b/ChangeLog.2006 index b26547e..e3dd741 100644 --- a/ChangeLog.2006 +++ b/ChangeLog.2006 @@ -2,6 +2,25 @@ # arch-tag: automatic-ChangeLog--mwolson@gnu.org--2006/muse--main--1.0 # +2006-04-01 04:20:45 GMT Michael Olson patch-80 + + Summary: + Fix a bug triggered by batch-publishing. + Revision: + muse--main--1.0--patch-80 + + * lisp/muse-publish.el (muse-detect-invalid-style): Remove, since the + right algorithm turned out to be simpler than I had thought. Thanks to + Sergei V. Fleytin for reporting breakage with the old method. + (muse-publish-file): Don't be overzealous when checking for an invalid + style -- use a simpler check. + (muse-batch-publish-files): Don't check for invalid styles here, since + we already do so in `muse-publish-file'. + + modified files: + ChangeLog.2006 lisp/muse-publish.el + + 2006-03-31 04:27:54 GMT Michael Olson patch-79 Summary: diff --git a/lisp/muse-publish.el b/lisp/muse-publish.el index b6b12b1..056e847 100644 --- a/lisp/muse-publish.el +++ b/lisp/muse-publish.el @@ -586,17 +586,6 @@ to the text with ARGS as parameters." (concat (file-name-directory file) (muse-publish-link-name file style)))) -(defun muse-detect-invalid-style (style) - "Throw an error if STYLE is invalid." - (setq style (muse-style style)) - (when (null style) - (error "Invalid style")) - (setq style (muse-style-element :base style)) - (when (null style) - (error "Style does not contain a :base value")) - (unless (muse-style style) - (error "Cannot find the %s publishing style" style))) - ;;;###autoload (defun muse-publish-file (file style &optional output-dir force) "Publish the given FILE in a particular STYLE to OUTPUT-DIR. @@ -605,8 +594,10 @@ newer than the published version. If the argument FORCE is non-nil, the file is published no matter what." (interactive (cons (read-file-name "Publish file: ") (muse-publish-get-info))) - (setq style (muse-style style)) - (muse-detect-invalid-style style) + (let ((style-name style)) + (setq style (muse-style style)) + (unless style + (error "There is no style '%s' defined." style-name))) (let* ((output-path (muse-publish-output-file file output-dir style)) (output-suffix (muse-style-element :osuffix style)) (muse-publishing-current-file file) @@ -642,9 +633,8 @@ the file is published no matter what." (defun muse-batch-publish-files () "Publish Muse files in batch mode." (let ((muse-batch-publishing-p t) - style-name style output-dir) - (setq style-name (car command-line-args-left) - style (muse-style style-name) + style output-dir) + (setq style (car command-line-args-left) command-line-args-left (cdr command-line-args-left) output-dir (car command-line-args-left) output-dir @@ -652,8 +642,6 @@ the file is published no matter what." (prog1 (substring output-dir (match-end 0)) (setq command-line-args-left (cdr command-line-args-left))))) - (unless style - (error "There is no style '%s' defined." style-name)) (dolist (file command-line-args-left) (muse-publish-file file style output-dir t)))) -- 2.11.4.GIT