summaryrefslogtreecommitdiff
path: root/elisp/geiser-chicken.el
diff options
context:
space:
mode:
authorDan Leslie <dan@ironoxide.ca>2015-09-25 21:14:21 -0700
committerDan Leslie <dan@ironoxide.ca>2015-09-25 21:16:13 -0700
commit59f140f19b36ce273e3a0f955597469d5192c209 (patch)
treef4e7e26286a764336038ddf5ba8dd0209ed0e87b /elisp/geiser-chicken.el
parent9a3d363ee0b2921a5f1479a06deab9bb26b9bee9 (diff)
downloadgeiser-guile-59f140f19b36ce273e3a0f955597469d5192c209.tar.gz
geiser-guile-59f140f19b36ce273e3a0f955597469d5192c209.tar.bz2
Adds the ability to have sub-word delimiters
Many chickeners use prefixes when importing eggs, which breaks completions. This commit adds the ability to define custom prefix delimiters, with : and # pre-defined due to their common usage.
Diffstat (limited to 'elisp/geiser-chicken.el')
-rw-r--r--elisp/geiser-chicken.el16
1 files changed, 15 insertions, 1 deletions
diff --git a/elisp/geiser-chicken.el b/elisp/geiser-chicken.el
index 5bf45f2..c086b17 100644
--- a/elisp/geiser-chicken.el
+++ b/elisp/geiser-chicken.el
@@ -46,6 +46,12 @@
"Customization for Geiser's Chicken flavour."
:group 'geiser)
+(geiser-custom--defcustom geiser-chicken-prefix-delimiters
+ '("^:" "^#")
+ "Regex to match symbol prefix delimiters."
+ :type '(repeat string)
+ :group 'geiser-chicken)
+
(geiser-custom--defcustom geiser-chicken-binary
(cond ((eq system-type 'windows-nt) '("csi.exe" "-:c"))
((eq system-type 'darwin) "csi")
@@ -165,7 +171,15 @@ This function uses `geiser-chicken-init-file' if it exists."
(defun geiser-chicken--exit-command () ",q")
(defun geiser-chicken--symbol-begin (module)
- (save-excursion (skip-syntax-backward "^-()>") (point)))
+ (apply
+ 'max
+ (append
+ (list (save-excursion (beginning-of-line) (point))
+ (save-excursion (skip-syntax-backward "^-()>") (point)))
+ (mapcar
+ (lambda (match-string)
+ (save-excursion (skip-chars-backward match-string) (point)))
+ geiser-chicken-prefix-delimiters))))
;;; Error display