Browse Source

org-babel-alist-pop now actually does modify alist

Eric Schulte 16 years ago
parent
commit
760e811c8c
1 changed files with 4 additions and 4 deletions
  1. 4 4
      lisp/org-babel.el

+ 4 - 4
lisp/org-babel.el

@@ -404,12 +404,12 @@ non-nil."
         (dotimes (n size)
         (dotimes (n size)
           (move-beginning-of-line 1) (insert ": ") (forward-line 1))))))
           (move-beginning-of-line 1) (insert ": ") (forward-line 1))))))
 
 
-(defun org-babel-alist-pop (key alist)
+(defmacro org-babel-alist-pop (key alist)
   "Return the `assoc' of KEY in ALIST, and remove all elements of
   "Return the `assoc' of KEY in ALIST, and remove all elements of
 ALIST matching KEY with `assq-delete-all'."
 ALIST matching KEY with `assq-delete-all'."
-  (let ((results (assoc key alist)))
-    (setq alist (assq-delete-all key alist))
-    results))
+  `(let ((results (assoc ,key ,alist)))
+     (setq ,alist (assq-delete-all ,key ,alist))
+     results))
 
 
 (defun org-babel-clean-text-properties (text)
 (defun org-babel-clean-text-properties (text)
   "Strip all properties from text return."
   "Strip all properties from text return."