diff options
author | Dan Leslie <dan@ironoxide.ca> | 2015-12-05 08:01:06 -0800 |
---|---|---|
committer | Dan Leslie <dan@ironoxide.ca> | 2015-12-05 08:01:06 -0800 |
commit | 23c3462311d0fd3da0bd2ffb924f237c620c80be (patch) | |
tree | 232502d04a4dca60da2fb808851142c0c0fc7cbe /elisp | |
parent | 585808c8dc6916482a544efe59c425a13641f119 (diff) | |
download | geiser-guile-23c3462311d0fd3da0bd2ffb924f237c620c80be.tar.gz geiser-guile-23c3462311d0fd3da0bd2ffb924f237c620c80be.tar.bz2 |
Completions didn't work after first symbol in sexp
Diffstat (limited to 'elisp')
-rw-r--r-- | elisp/geiser-chicken.el | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/elisp/geiser-chicken.el b/elisp/geiser-chicken.el index 88d60cf..0d9c8e7 100644 --- a/elisp/geiser-chicken.el +++ b/elisp/geiser-chicken.el @@ -67,7 +67,7 @@ (geiser-custom--defcustom geiser-chicken-prefix-delimiters '("^:" "^#") - "Regex to match symbol prefix delimiters." + "Regex to match symbol prefix delimiters. Consider that it will be placed inside []." :type '(repeat string) :group 'geiser-chicken) @@ -189,16 +189,18 @@ This function uses `geiser-chicken-init-file' if it exists." (defun geiser-chicken--exit-command () ",q") (defun geiser-chicken--symbol-begin (module) - (let ((distance-to-beginning-of-line (- (point) (line-beginning-position)))) - (apply - 'max - (append - (list (save-excursion (skip-syntax-backward "^'(>" distance-to-beginning-of-line) - (point))) + (apply + 'max + (cons + (if module + (max (save-excursion (beginning-of-line) (point)) + (save-excursion (skip-syntax-backward "^(>") (1- (point)))) + (save-excursion (skip-syntax-backward "^'-()>") (point))) + (let ((distance-to-beginning-of-line (- (point) (line-beginning-position)))) (mapcar (lambda (match-string) - (save-excursion (skip-chars-backward match-string distance-to-beginning-of-line) - (point))) + (save-excursion + (skip-chars-backward match-string distance-to-beginning-of-line) (point))) geiser-chicken-prefix-delimiters))))) |