From 52c30560eb26f38e5192543ab6b8a6e6adb40b2a Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Thu, 17 Nov 2005 01:45:58 +0000 Subject: [PATCH] Add with-muse-project macro from parts of patch-260. * lisp/muse-project.el (with-muse-project): New function courtesy of Jim Ottaway. git-archimport-id: mwolson@gnu.org--2005/muse--rel--3.02--patch-5 --- lisp/muse-project.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lisp/muse-project.el b/lisp/muse-project.el index efe7a5f..4f9be26 100644 --- a/lisp/muse-project.el +++ b/lisp/muse-project.el @@ -57,6 +57,19 @@ Each function is passed the project object, a cons with the format has been modified via the customize interface.") (make-variable-buffer-local 'muse-project-alist-using-customize) +(defmacro with-muse-project (project &rest body) + `(progn + (unless (muse-project ,project) + (error "Can't find project %s" ,project)) + (with-temp-buffer + (muse-mode) + (setq muse-current-project (muse-project ,project)) + (muse-project-set-variables) + ,@body))) + +(put 'with-muse-project 'lisp-indent-function 0) +(put 'with-muse-project 'edebug-form-spec '(sexp body)) + (defun muse-project-alist-get (sym) "Turn `muse-project-alist' into something we can customize easily." (when (boundp sym) -- 2.11.4.GIT