From 557c72ac19c42147771791c60bc45834943e6d24 Mon Sep 17 00:00:00 2001 From: dleslie Date: Sat, 17 Sep 2016 15:00:04 -0700 Subject: Allows Chicken to limit the number of symbols provided to Geiser - Also cleaned up the namespace a little. --- elisp/geiser-chicken.el | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'elisp') diff --git a/elisp/geiser-chicken.el b/elisp/geiser-chicken.el index 12ca006..8c10908 100644 --- a/elisp/geiser-chicken.el +++ b/elisp/geiser-chicken.el @@ -104,6 +104,11 @@ this variable to t." :type 'boolean :group 'geiser-chicken) +(geiser-custom--defcustom geiser-chicken-match-limit 20 + "The limit on the number of matching symbols that Chicken will provide to Geiser." + :type 'integer + :group 'geiser-chicken) + (defvar geiser-chicken--required-modules (list "chicken-doc" "apropos" "data-structures" "extras" "ports" "posix" "srfi-1" "srfi-13" "srfi-14" "srfi-18" "srfi-69" "tcp" "utils")) @@ -277,17 +282,19 @@ This function uses `geiser-chicken-init-file' if it exists." (suppression-prefix "(define geiser-stdout (current-output-port))(current-output-port (make-output-port (lambda a #f) (lambda a #f)))") (suppression-postfix - "(current-output-port geiser-stdout)")) + "(current-output-port geiser-stdout)") + (match-limit-set + (format "(geiser-chicken-symbol-match-limit %s)" geiser-chicken-match-limit))) (let ((load-sequence (cond (force-load - (format "(load \"%s\")\n(import geiser)\n" source)) + (format "(load \"%s\")\n(import geiser)%s\n" source match-limit-set)) ((file-exists-p target) - (format "%s(load \"%s\")(import geiser)%s\n" - suppression-prefix target suppression-postfix)) + (format "%s(load \"%s\")(import geiser)%s%s\n" + suppression-prefix target match-limit-set suppression-postfix)) (t - (format "%s(use utils)(compile-file \"%s\" options: '(\"-O3\" \"-s\") output-file: \"%s\" load: #t)(import geiser)%s\n" - suppression-prefix source target suppression-postfix))))) + (format "%s(use utils)(compile-file \"%s\" options: '(\"-O3\" \"-s\") output-file: \"%s\" load: #t)(import geiser)%s%s\n" + suppression-prefix source target match-limit-set suppression-postfix))))) (geiser-eval--send/wait load-sequence)))) (defun geiser-chicken--startup (remote) -- cgit v1.2.3