summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--elisp/geiser-chicken.el32
1 files changed, 21 insertions, 11 deletions
diff --git a/elisp/geiser-chicken.el b/elisp/geiser-chicken.el
index 65b494f..2a8c082 100644
--- a/elisp/geiser-chicken.el
+++ b/elisp/geiser-chicken.el
@@ -58,6 +58,7 @@
"use"
"with-input-from-pipe"))
+
;;; Customization:
(defgroup geiser-chicken nil
@@ -114,7 +115,7 @@ this variable to t."
:type 'boolean
:group 'geiser-chicken)
-
+
;;; REPL support:
(defun geiser-chicken--binary ()
@@ -136,6 +137,7 @@ This function uses `geiser-chicken-init-file' if it exists."
(defconst geiser-chicken--prompt-regexp "#[^;]*;[^:0-9]*:?[0-9]+> ")
+
;;; Evaluation support:
(defun geiser-chicken--geiser-procedure (proc &rest args)
@@ -189,16 +191,20 @@ This function uses `geiser-chicken-init-file' if it exists."
(defun geiser-chicken--exit-command () ",q")
(defun geiser-chicken--symbol-begin (module)
- (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))))
-
+ (let ((distance-to-beginning-of-line (- (point) (line-beginning-position))))
+ (apply
+ 'max
+ (append
+ (list (save-excursion (beginning-of-line) (point))
+ (save-excursion (skip-syntax-backward "^-()>" distance-to-beginning-of-line)
+ (point)))
+ (mapcar
+ (lambda (match-string)
+ (save-excursion (skip-chars-backward match-string distance-to-beginning-of-line)
+ (point)))
+ geiser-chicken-prefix-delimiters)))))
+
+
;;; Error display
(defun geiser-chicken--display-error (module key msg)
@@ -208,6 +214,7 @@ This function uses `geiser-chicken-init-file' if it exists."
(geiser-edit--buttonize-files))
(and (not key) msg (not (zerop (length msg)))))
+
;;; Trying to ascertain whether a buffer is Chicken Scheme:
(defconst geiser-chicken--guess-re
@@ -222,6 +229,7 @@ This function uses `geiser-chicken-init-file' if it exists."
"Loads chicken doc into a buffer"
(browse-url (format "http://api.call-cc.org/cdoc?q=%s&query-name=Look+up" id)))
+
;;; Keywords and syntax
(defun geiser-chicken--keywords ()
@@ -260,6 +268,7 @@ This function uses `geiser-chicken-init-file' if it exists."
(with-input-from-pipe 1)
(with-output-to-pipe 1))
+
;;; REPL startup
(defconst geiser-chicken-minimum-version "4.8.0.0")
@@ -299,6 +308,7 @@ This function uses `geiser-chicken-init-file' if it exists."
(compilation-setup t)
(geiser-chicken--compile-or-load (not geiser-chicken-compile-geiser-p)))
+
;;; Implementation definition:
(define-geiser-implementation chicken