summaryrefslogtreecommitdiff
path: root/elisp/geiser-syntax.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-08-24 03:22:12 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-08-24 03:22:12 +0200
commite0dd77a67b8e7c7d2d56aa353967249cc1e19f1e (patch)
treeda070b7f0e2a104ce201736dbf88a58d8d6b4dd5 /elisp/geiser-syntax.el
parent8e2810f0942745de2534c4dbc8d5d7ec52e79a22 (diff)
downloadgeiser-e0dd77a67b8e7c7d2d56aa353967249cc1e19f1e.tar.gz
geiser-e0dd77a67b8e7c7d2d56aa353967249cc1e19f1e.tar.bz2
Taking into account those ugly square brackets while scanning locals.
Diffstat (limited to 'elisp/geiser-syntax.el')
-rw-r--r--elisp/geiser-syntax.el20
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)