ecbrown

laertus.el

Oct 11th, 2020
3,564
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.55 KB | None | 0 0
  1. (defun my-eval-string (str)
  2.   "Read and evaluate all forms in str.
  3. Return the results of all forms as a list."
  4.   (let ((next 0)
  5.         ret)
  6.     (condition-case err
  7.         (while t
  8.           (setq ret (cons (funcall (lambda (ret)
  9.                                      (setq next (cdr ret))
  10.                                      (eval (car ret)))
  11.                                    (read-from-string str next))
  12.                           ret)))
  13.       (end-of-file))
  14.     (nreverse ret)))
  15.  
  16. (car (my-eval-string (format "%S" '(xr "\\.\\(?:txt\\|tex\\|el\\)\\'"))))
  17.  
  18.  
  19.  
Advertisement