ChezScheme
ChezScheme copied to clipboard
autodoc (via company-quickhelp) not working with chez scheme
I currently have autocomplete working via company, but autodoc is not working with company-quickhelp.
Here is what I have installed: Ubuntu 17.10 GNU Emacs 25.2.2 Chez Scheme Version 9.5.1 Geiser 20180329.548
Here is my setup:
(use-package geiser
:ensure t
:config
(defvar geiser-active-implementations)
(setq geiser-active-implementations '(chez))
(setq geiser-mode-start-repl-p t)
(setq geiser-repl-history-filename "~/.emacs.d/geiser-history")
(add-to-list 'company-backends 'geiser-company))
(use-package company
:ensure t
:config
(add-hook 'prog-mode-hook 'company-mode)
(setq company-dabbrev-downcase 0)
(setq company-idle-delay 0.3))
(use-package company-quickhelp
:ensure t
:config
(company-quickhelp-mode 1)
(define-key company-active-map (kbd "C-c h") #'company-quickhelp-manual-begin))
and the error I get is:
Error running timer ‘company-quickhelp--show’: (error "No buffer named No documentation available for ’default-exception-handler’")
And here is a screenshot of the autodoc failure:

I'm not an emacs user, so I'm not really sure what this tool is, or what you would need from Chez Scheme to support it.
The Chez Scheme documentation is written in stex an extension on LaTeX that generates pdf and html output, with the standard R6RS Scheme library documented in The Scheme Programming Language, but is not part of the Chez Scheme source repository.
Geiser uses Chezʼs inspect/object functionality. For procedures that you created, you need to evaluate them before you can see autodoc. For built-in procedures you need to compile Chez with generate-inspector-information set to #t.
By setting generate-inspector-information to #t will we be able to get the minibuffer strings that show a functions parameters?
like map f l | f l l2 ...etc?
@Silverbeard00 yes!
I got this working by editing the following lines in the build file "s/Mf-base"
# i determines whether inspector-information is generated: f for false, t for true
i = f
I changed i = f to i = t and then rebuilt Chez with
.configure
sudo make
sudo make bootfiles
sudo make install
After that Geiser began showing arguments for some built-in procedures, like printf, but not all. For instance, nothing is shown for map. I think this is a problem with Geiser's handling of procedures defined by lambda-case with multiple arities, but I'm not sure.
I figured I should document this here because I didn't find how to compile Chez with "generate-inspector-information" anywhere.
On Wed, Sep 12 2018, andregrigon wrote:
After that Geiser began showing arguments for some built-in procedures, like printf, but not all. For instance, nothing is shown for map. I think this is a problem with Geiser's handling of procedures defined by lambda-case with multiple arities, but I'm not sure.
I haven't looked, so I might be missing something but: geiser's elisp doesn't guess any arguments by itself, it just asks the scheme process (chezscheme in this case) for a list of arities of the given procedure. So, Geiser's elisp doesn't even know in general whether the function was defined as a lambda-case or in any other form (or even if it's a macro, for that matter), as long as the arities are reported in the expected format (which is fixed; multiple arities are supported). That arity list is generated somewhere in Geiser's scheme code for ChezScheme, so maybe that's the code that is not handling correctly reporting of arities for lambda-case.
Oh right, that's what I meant. I think the problem is in the following procedure from geiser/scheme/chez/geiser/geiser.ss
(define (procedure-parameter-list p)
;; same as (inspect object), then hitting c
(let ((s (((inspect/object p) 'code) 'source)))
(if s
(let ((form (s 'value)))
(if (and (list? form)
(> (length form) 2)
(eq? (car form) 'lambda))
(cadr form)
#f))
#f)))
It seems to look at the procedure source to determine the parameter list and only treats lambdas.
Sorry for the confusion!