diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-08-24 03:22:12 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-08-24 03:22:12 +0200 |
commit | 479493f40a1666cc7fb2de8f855badc7106b762b (patch) | |
tree | ec3c303ceb1fd264191fca8e34a840f4fc824cdf | |
parent | b652ff751b5c5e4210195cadbac0b404e3fe402e (diff) | |
download | geiser-chez-479493f40a1666cc7fb2de8f855badc7106b762b.tar.gz geiser-chez-479493f40a1666cc7fb2de8f855badc7106b762b.tar.bz2 |
Taking into account those ugly square brackets while scanning locals.
-rw-r--r-- | elisp/geiser-syntax.el | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/elisp/geiser-syntax.el b/elisp/geiser-syntax.el index 38bb76c..789b6e9 100644 --- a/elisp/geiser-syntax.el +++ b/elisp/geiser-syntax.el @@ -119,29 +119,35 @@ (when (listp fst) (push fst path))) (nreverse path)))) +(defsubst geiser-syntax--listify (l &optional strict) + (cond ((vectorp l) (append l nil)) + ((listp l) l) + (strict nil) + (t l))) + (defun geiser-syntax--read-list (p) - (let ((list (ignore-errors (read (current-buffer))))) + (let ((list (geiser-syntax--listify (ignore-errors (read (current-buffer))) t))) (if (and list (< (point) p)) - list + (mapcar 'geiser-syntax--listify list) (goto-char p) nil))) -(defconst geiser-syntax--delim-regexp "\\(?:[\\s-\\s<\\s>$\n]+\\)") +(defconst geiser-syntax--delim-regexp "\\(?:\\s-\\|\\s<\\|\\s>\\|$\\|\n\\)+") (defconst geiser-syntax--ident-regexp - (format "\\(?:%s\\([^ (]+?\\)\\)" geiser-syntax--delim-regexp)) + (format "\\(?:%s\\([^[ (]+?\\)\\)" geiser-syntax--delim-regexp)) (defconst geiser-syntax--let-regexp - (format "\\=(let\\(?:\\*\\|rec\\|%s\\|%s\\)%s*(" + (format "\\=[[(]let\\(?:\\*\\|rec\\|%s\\|%s\\)%s*[[(]" geiser-syntax--ident-regexp geiser-syntax--delim-regexp geiser-syntax--delim-regexp)) (defconst geiser-syntax--ldefine-regexp - (format "\\=(define%s%s" geiser-syntax--ident-regexp geiser-syntax--delim-regexp)) + (format "\\=[[(]define%s%s" geiser-syntax--ident-regexp geiser-syntax--delim-regexp)) (defconst geiser-syntax--define-regexp - (format "\\=(\\(?:define\\|lambda\\)%s(" geiser-syntax--delim-regexp)) + (format "\\=[[(]\\(?:define\\|lambda\\)%s[[(]" geiser-syntax--delim-regexp)) (defun geiser-syntax--locals-around-point () (when (eq major-mode 'scheme-mode) |