diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-09-27 23:51:18 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-09-27 23:51:18 +0200 |
commit | d3593a4dcb13f15b531cee7e71e61a1e1f604ba4 (patch) | |
tree | 7e05aa0b2a0079732efea088d1df26403c30637c /elisp | |
parent | fa57fec9e27da642c12244d097ae2da601f9a08d (diff) | |
download | geiser-chez-d3593a4dcb13f15b531cee7e71e61a1e1f604ba4.tar.gz geiser-chez-d3593a4dcb13f15b531cee7e71e61a1e1f604ba4.tar.bz2 |
Cosmetics.
Diffstat (limited to 'elisp')
-rw-r--r-- | elisp/geiser-guile.el | 47 | ||||
-rw-r--r-- | elisp/geiser-plt.el | 45 |
2 files changed, 36 insertions, 56 deletions
diff --git a/elisp/geiser-guile.el b/elisp/geiser-guile.el index 806bc97..332454f 100644 --- a/elisp/geiser-guile.el +++ b/elisp/geiser-guile.el @@ -44,20 +44,13 @@ started." :type 'string :group 'geiser-guile) -(geiser-custom--defcustom geiser-guile-use-compiler-in-eval t - "When enable, always use Guile's compiler to perform evaluation. -Recommended, since the compiler usually collects better metadata -than the interpreter." - :type 'boolean - :group 'geiser-guile) - ;;; REPL support: -(defun geiser-guile-binary () +(defun geiser-guile--binary () (if (listp geiser-guile-binary) (car geiser-guile-binary) geiser-guile-binary)) -(defun geiser-guile-parameters () +(defun geiser-guile--parameters () "Return a list with all parameters needed to start Guile. This function uses `geiser-guile-init-file' if it exists." (let ((init-file (and (stringp geiser-guile-init-file) @@ -67,23 +60,19 @@ This function uses `geiser-guile-init-file' if it exists." ,@(apply 'append (mapcar (lambda (p) (list "-L" p)) geiser-guile-load-path)) ,@(and init-file (file-readable-p init-file) (list "-l" init-file))))) -(defconst geiser-guile-prompt-regexp "^[^() \n]+@([^)]*?)> ") +(defconst geiser-guile--prompt-regexp "^[^() \n]+@([^)]*?)> ") ;;; Evaluation support: -(defun geiser-guile-geiser-procedure (proc) - (let ((proc (intern (format "ge:%s" - (if (and geiser-guile-use-compiler-in-eval - (eq proc 'eval)) - 'compile - proc))))) +(defun geiser-guile--geiser-procedure (proc) + (let ((proc (intern (format "ge:%s" (if (eq proc 'eval) 'compile proc))))) `(@ (geiser emacs) ,proc))) (defconst geiser-guile--module-re "(define-module +\\(([^)]+)\\)") -(defun geiser-guile-get-module (&optional module) +(defun geiser-guile--get-module (&optional module) (cond ((null module) (save-excursion (ignore-errors @@ -91,14 +80,14 @@ This function uses `geiser-guile-init-file' if it exists." (while (not (zerop (geiser-syntax--nesting-level))) (backward-up-list))) (if (re-search-backward geiser-guile--module-re nil t) - (geiser-guile-get-module (match-string-no-properties 1)) + (geiser-guile--get-module (match-string-no-properties 1)) :f))) ((listp module) module) ((stringp module) (or (ignore-errors (car (read-from-string module))) :f)) (t :f))) -(defun geiser-guile-symbol-begin (module) +(defun geiser-guile--symbol-begin (module) (if module (max (save-excursion (beginning-of-line) (point)) (save-excursion (skip-syntax-backward "^(>") (1- (point)))) @@ -130,7 +119,7 @@ This function uses `geiser-guile-init-file' if it exists." (when file (geiser-edit--make-link beg end file line 0))))))) -(defun geiser-guile-display-error (module key msg) +(defun geiser-guile--display-error (module key msg) (when key (insert "Error: ") (geiser--insert-with-face (format "%s" key) 'bold) @@ -145,7 +134,7 @@ This function uses `geiser-guile-init-file' if it exists." ;;; Trying to ascertain whether a buffer is Guile Scheme: -(defun geiser-guile-guess () +(defun geiser-guile--guess () (save-excursion (goto-char (point-min)) (re-search-forward geiser-guile--module-re nil t))) @@ -154,16 +143,16 @@ This function uses `geiser-guile-init-file' if it exists." ;;; Implementation definition: (define-geiser-implementation guile - (binary geiser-guile-binary) - (arglist geiser-guile-parameters) + (binary geiser-guile--binary) + (arglist geiser-guile--parameters) (startup) - (prompt-regexp geiser-guile-prompt-regexp) - (marshall-procedure geiser-guile-geiser-procedure) - (find-module geiser-guile-get-module) - (find-symbol-begin geiser-guile-symbol-begin) - (display-error geiser-guile-display-error) + (prompt-regexp geiser-guile--prompt-regexp) + (marshall-procedure geiser-guile--geiser-procedure) + (find-module geiser-guile--get-module) + (find-symbol-begin geiser-guile--symbol-begin) + (display-error geiser-guile--display-error) (display-help) - (check-buffer geiser-guile-guess)) + (check-buffer geiser-guile--guess)) (provide 'geiser-guile) diff --git a/elisp/geiser-plt.el b/elisp/geiser-plt.el index 893b97a..1352e2f 100644 --- a/elisp/geiser-plt.el +++ b/elisp/geiser-plt.el @@ -47,10 +47,10 @@ ;;; REPL support: -(defun geiser-plt-binary () +(defun geiser-plt--binary () (if (listp geiser-plt-binary) (car geiser-plt-binary) geiser-plt-binary)) -(defun geiser-plt-parameters () +(defun geiser-plt--parameters () "Return a list with all parameters needed to start mzscheme. This function uses `geiser-plt-init-file' if it exists." (let ((init-file (and (stringp geiser-plt-init-file) @@ -62,21 +62,12 @@ This function uses `geiser-plt-init-file' if it exists." ,@(and init-file (file-readable-p init-file) (list "-f" init-file)) "-f" ,(expand-file-name "plt/geiser.ss" geiser-scheme-dir)))) -(defconst geiser-plt-prompt-regexp "^mzscheme@[^ ]*?> ") - -(defun switch-to-plt (&optional ask) - (interactive "P") - (switch-to-geiser ask 'plt)) - -(defun run-plt () - "Run Geiser using mzscheme." - (interactive) - (run-geiser 'plt)) +(defconst geiser-plt--prompt-regexp "^mzscheme@[^ ]*?> ") ;;; Evaluation support: -(defun geiser-plt-geiser-procedure (proc) +(defun geiser-plt--geiser-procedure (proc) (let ((proc (intern (format "geiser:%s" proc)))) `(dynamic-require ''geiser ',proc))) @@ -97,7 +88,7 @@ This function uses `geiser-plt-init-file' if it exists." (buffer-file-name) :f))) -(defun geiser-plt-get-module (&optional module) +(defun geiser-plt--get-module (&optional module) (cond ((and (null module) (buffer-file-name))) ;; (geiser-plt--explicit-module) ((null module) (geiser-plt--implicit-module)) ((symbolp module) module) @@ -105,13 +96,13 @@ This function uses `geiser-plt-init-file' if it exists." ((stringp module) (intern module)) (t nil))) -(defun geiser-plt-symbol-begin (module) +(defun geiser-plt--symbol-begin (module) (save-excursion (skip-syntax-backward "^-()>") (point))) ;;; External help -(defun geiser-plt-external-help (symbol module) +(defun geiser-plt--external-help (symbol module) (message "Requesting help for '%s'..." symbol) (geiser-eval--send/wait `(:eval (get-help ',symbol (:module ,module)) geiser/autodoc)) @@ -134,7 +125,7 @@ This function uses `geiser-plt-init-file' if it exists." (match-string 2) (match-string 3))))) -(defun geiser-plt-display-error (module key msg) +(defun geiser-plt--display-error (module key msg) (when key (insert "Error: ") (geiser-doc--insert-button key nil 'plt) @@ -153,7 +144,7 @@ This function uses `geiser-plt-init-file' if it exists." ;;; Trying to ascertain whether a buffer is mzscheme scheme: -(defun geiser-plt-guess () +(defun geiser-plt--guess () (or (save-excursion (goto-char (point-min)) (re-search-forward "#lang " nil t)) @@ -163,17 +154,17 @@ This function uses `geiser-plt-init-file' if it exists." ;;; Implementation definition: (define-geiser-implementation plt - (binary geiser-plt-binary) - (arglist geiser-plt-parameters) + (binary geiser-plt--binary) + (arglist geiser-plt--parameters) (startup) (unsupported-procedures '(callers callees generic-methods)) - (prompt-regexp geiser-plt-prompt-regexp) - (marshall-procedure geiser-plt-geiser-procedure) - (find-module geiser-plt-get-module) - (find-symbol-begin geiser-plt-symbol-begin) - (display-error geiser-plt-display-error) - (display-help geiser-plt-external-help) - (check-buffer geiser-plt-guess)) + (prompt-regexp geiser-plt--prompt-regexp) + (marshall-procedure geiser-plt--geiser-procedure) + (find-module geiser-plt--get-module) + (find-symbol-begin geiser-plt--symbol-begin) + (display-error geiser-plt--display-error) + (display-help geiser-plt--external-help) + (check-buffer geiser-plt--guess)) (geiser-impl--add-to-alist 'regexp "\\.mzscheme\\.sl?s$" 'plt t) (geiser-impl--add-to-alist 'regexp "\\.ss$" 'plt t) |