From a3b03cc822e927f788f3363ba36b8a6efb932f48 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Mon, 8 May 2006 07:34:41 +0000 Subject: [PATCH] Fix buggy behavior in muse-browse-result. * lisp/muse-mode.el (muse-browse-result): Construct a mapping of style names to styles, based on the styles contained in the current Muse project. Thanks to kid kid for the analysis. * lisp/muse-publish.el (muse-publish-get-style): Permit styles to be specified as an argument. git-archimport-id: mwolson@gnu.org--2006/muse--main--1.0--patch-120 --- ChangeLog.2006 | 18 ++++++++++++++++++ lisp/muse-mode.el | 7 ++++++- lisp/muse-publish.el | 12 ++++++------ 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/ChangeLog.2006 b/ChangeLog.2006 index c699a71..ea91819 100644 --- a/ChangeLog.2006 +++ b/ChangeLog.2006 @@ -2,6 +2,24 @@ # arch-tag: automatic-ChangeLog--mwolson@gnu.org--2006/muse--main--1.0 # +2006-05-08 07:34:41 GMT Michael Olson patch-120 + + Summary: + Fix buggy behavior in muse-browse-result. + Revision: + muse--main--1.0--patch-120 + + * lisp/muse-mode.el (muse-browse-result): Construct a mapping of style + names to styles, based on the styles contained in the current Muse + project. Thanks to kid kid for the analysis. + + * lisp/muse-publish.el (muse-publish-get-style): Permit styles to be + specified as an argument. + + modified files: + ChangeLog.2006 lisp/muse-mode.el lisp/muse-publish.el + + 2006-05-08 07:29:42 GMT Michael Olson patch-119 Summary: diff --git a/lisp/muse-mode.el b/lisp/muse-mode.el index 114a0c7..713278a 100644 --- a/lisp/muse-mode.el +++ b/lisp/muse-mode.el @@ -542,7 +542,12 @@ in `muse-project-alist'." ;;;###autoload (defun muse-browse-result (style &optional other-window) "Visit the current page's published result." - (interactive (list (muse-publish-get-style) current-prefix-arg)) + (interactive (list (muse-publish-get-style + (mapcar + (lambda (style) + (cons (muse-get-keyword :base style) style)) + (cddr muse-current-project))) + current-prefix-arg)) (setq style (muse-style style)) (let ((result-path (muse-publish-output-file buffer-file-name diff --git a/lisp/muse-publish.el b/lisp/muse-publish.el index 27cde2e..c40eecd 100644 --- a/lisp/muse-publish.el +++ b/lisp/muse-publish.el @@ -540,12 +540,12 @@ to the text with ARGS as parameters." ;; Commands for publishing files -(defsubst muse-publish-get-style () - (if (= 1 (length muse-publishing-styles)) - (car muse-publishing-styles) - (assoc (completing-read "Publish with style: " - muse-publishing-styles nil t) - muse-publishing-styles))) +(defsubst muse-publish-get-style (&optional styles) + (unless styles (setq styles muse-publishing-styles)) + (if (= 1 (length styles)) + (car styles) + (assoc (completing-read "Publish with style: " styles nil t) + styles))) (defsubst muse-publish-get-output-dir (style) (let ((default-directory (or (muse-style-element :path style) -- 2.11.4.GIT