[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [PATCH 2/7] New macro: Evaluate FORM in ENVIRONMENT

From: David Maus
Subject: [O] [PATCH 2/7] New macro: Evaluate FORM in ENVIRONMENT
Date: Tue, 2 Aug 2011 11:23:35 +0200

* org-macs.el (org-eval-in-environment): New macro. Evaluate
(org-with-uninterned): Move to top of file.
 lisp/org-macs.el |   23 ++++++++++++++++++-----
 1 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index 53c60e5..7a0cc60 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -47,6 +47,12 @@
 (declare-function org-add-props "org-compat" (string plist &rest props))
 (declare-function org-string-match-p "org-compat" (&rest args))
+(defmacro org-with-uninterned (symbols &rest body)
+  `(let ,(mapcar (lambda (s)
+                  `(,s (make-symbol (symbol-name ',s)))) symbols)
+     ,@body))
+(put 'org-with-uninterned 'lisp-indent-function 1)
 (defmacro org-called-interactively-p (&optional kind)
   (if (featurep 'xemacs)
@@ -370,11 +376,18 @@ The number of levels is controlled by 
       (format-seconds string seconds)
     (format-time-string string (seconds-to-time seconds))))
-(defmacro org-with-uninterned (symbols &rest body)
-  `(let ,(mapcar (lambda (s)
-                  `(,s (make-symbol (symbol-name ',s)))) symbols)
-     ,@body))
-(put 'org-with-uninterned 'lisp-indent-function 1)
+(defun org-make-parameter-alist (flat)
+  "Return alist based on FLAT.
+FLAT is a list with alternating symbol names and values. The
+returned alist is a list of lists with the symbol name in car and
+the value in cdr."
+  (when flat
+    (cons (list (car flat) (cadr flat))
+         (org-make-parameter-alist (cddr flat)))))
+(defmacro org-eval-in-environment (environment form)
+  `(eval '(let ,environment ,form)))
+(put 'org-eval-in-environment 'lisp-indent-function 1)
 (provide 'org-macs)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]