From b131c3e5c1e954c9ce3b1324937ba89a54bc66d1 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sat, 12 Sep 2009 23:26:22 +0200 Subject: New function: `geiser-syntax--read-from-string', analogous to elisp's `read-from-string'. --- elisp/geiser-syntax.el | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'elisp') diff --git a/elisp/geiser-syntax.el b/elisp/geiser-syntax.el index 6d05f57..e22344e 100644 --- a/elisp/geiser-syntax.el +++ b/elisp/geiser-syntax.el @@ -171,6 +171,14 @@ ((char string atom) (cdr token)) (t (error "Reading scheme syntax: unexpected token: %s" token))))) +(defun geiser-syntax--read-from-string (string &optional start end) + (when (stringp string) + (let ((start (or start 0)) + (end (or end (length string)))) + (with-temp-buffer + (save-excursion (insert string)) + (cons (ignore-errors (geiser-syntax--read)) (point)))))) + (defsubst geiser-syntax--read/keyword-value (s) (and (consp s) (eq (car s) :keyword) (cdr s))) -- cgit v1.2.3