Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

cldoc.el 1.3 --- show Common Lisp function arglist in echo area

15 views
Skip to first unread message

Yuji Minejima

unread,
Sep 16, 2004, 2:38:00 AM9/16/04
to
Hi, all.

This is an eldoc.el clone adapted for Common Lisp which works on Emacs
editor.

cldoc.el automatically displays the function arguments and the macro
syntax rule of the one which you are currently editing. For example, when
you enter `(getf <-!>', the following line should appear in the Emacs's
echo area, "getf: (PLIST INDICATOR &OPTIONAL DEFAULT) => VALUE".


This package is still at a pre alpha stage. What I've done so far is just
writing an operator signature table and changing a display function.
Currently almost all the code is from eldocl.el. But I think it's already
usefull.

Write the following code snippet in your .emacs file.
(autoload 'turn-on-cldoc-mode "cldoc" nil t)
(add-hook 'lisp-mode-hook 'turn-on-cldoc-mode)
(add-hook 'ilisp-mode-hook 'turn-on-cldoc-mode)
(add-hook 'slime-repl-mode-hook 'turn-on-cldoc-mode)
Slime users might want to change a binding of SPACE key.

The current signature table contains entries of CLHS dictionary pages of
conses, sequences, arrays, strings, types and classes, data and control
flow, and iteration.

I'll notify this thread of a new version release.
Any comments, ideas and patches are welcome.

You can find the latest cldoc.el at
http://homepage1.nifty.com/bmonkey/emacs/elisp/cldoc.el

Yuji.

Peter Seibel

unread,
Sep 16, 2004, 1:47:55 PM9/16/04
to
Yuji Minejima <ggb0...@nifty.ne.jp> writes:

> Hi, all.
>
> This is an eldoc.el clone adapted for Common Lisp which works on Emacs
> editor.
>
> cldoc.el automatically displays the function arguments and the macro
> syntax rule of the one which you are currently editing. For example, when
> you enter `(getf <-!>', the following line should appear in the Emacs's
> echo area, "getf: (PLIST INDICATOR &OPTIONAL DEFAULT) => VALUE".

How is this different from the similar functionality already built
into SLIME?

-Peter

--
Peter Seibel pe...@javamonkey.com

Lisp is the red pill. -- John Fraser, comp.lang.lisp

R. Mattes

unread,
Sep 16, 2004, 6:06:59 PM9/16/04
to
On Thu, 16 Sep 2004 17:47:55 +0000, Peter Seibel wrote:

> Yuji Minejima <ggb0...@nifty.ne.jp> writes:
>
>> Hi, all.
>>
>> This is an eldoc.el clone adapted for Common Lisp which works on Emacs
>> editor.
>>
>> cldoc.el automatically displays the function arguments and the macro
>> syntax rule of the one which you are currently editing. For example, when
>> you enter `(getf <-!>', the following line should appear in the Emacs's
>> echo area, "getf: (PLIST INDICATOR &OPTIONAL DEFAULT) => VALUE".
>
> How is this different from the similar functionality already built
> into SLIME?

Well, i assume it doesn't need a running lisp process :-)

RalfD

> -Peter

Yuji Minejima

unread,
Sep 16, 2004, 7:18:15 PM9/16/04
to
On Thu, 16 Sep 2004 17:47:55 +0000, Peter Seibel wrote:

> How is this different from the similar functionality already built
> into SLIME?

* cldoc doesn't need a running lisp process as R. Mattes has already
pointed out. Even if you have a running lisp process, parameter
names of some implementations(e.g. GNU CLISP) are too terse to be
informative.

* cldoc doesn't need to be taught when to display the information.
the slime's functionality (slime-space) displays the information only
when you enter the space key. When reading someone else's code like the
following,
(subtypep type1 type2)
with cldoc, moving the point inside the form (probably by clicking a
mouse botton) will triger cldoc to display the following information.
"subtypep: (SUBTYPE TYPE &optional ENVIRONMENT) => SUBTYPE-P, VALID-P"
and you'll learn type1 is supposed to be a subtype.

* cldoc displays the information on functions' return values.
"gethash: (KEY HASH-TABLE &optional DEFAULT => VALUE, PRESENT-P"
I think this is useful when you write multiple-value-bind form to
receive the results.

* cldoc can display syntax rules.
cldoc: "throw: tag-form result-form =>|"
slime-space with cmucl: "(throw &rest stuff)"
By using the term TAG-FORM, programmers will know a tag symbol should be
quoted.

* cldoc and slime-space are not mutually exclusive.
cldoc can pass the task to slime-space when it encounters an unknown
function. I intend to write such code when I finish the signature
table.

Regards,

Yuji.

Yuji Minejima

unread,
Sep 17, 2004, 12:05:13 AM9/17/04
to
On Fri, 17 Sep 2004 08:18:15 +0900, Yuji Minejima wrote:

> * cldoc doesn't need to be taught when to display the information.

> ...
Oops! I didn't notice slime-autodoc-mode. So this point doesn't hold.


> cldoc can pass the task to slime-space when it encounters an unknown
> function. I intend to write such code when I finish the signature
> table.

I just implemented this for slime.
I also wrote some code for ilisp but it needs some polishing up, so it's
disabled now.


I guess code for interaction with slime-autodoc-mode would be nice
(e.g. displaying the value of a global-variable)


I wonder whether ilisp's development is still continuing.
I still use ilisp with no good reason (actually there is one but it's
too trivial). I use clisp most of the time. Any suggestions?

Any comments or wishes are welcome.

cldoc.el version 1.4
http://homepage1.nifty.com/bmonkey/emacs/elisp/cldoc.el

Yuji Minejima

unread,
Sep 17, 2004, 2:40:54 AM9/17/04
to
On Thu, 16 Sep 2004 15:38:00 +0900, Yuji Minejima wrote:

The signature table is completed. Now it contains all the entries of CLHS
dictionary pages (only operators, not variables and constants).

Experimentally, multiple line syntax rules are used for handler-case,
defpackage, etc. Tell me how you feel about it.
Also, how about a long parameter name like the one in
"find-package: (STRING-DESIGNATOR-OR-PACKAGE) => PACKAGE" ?

I'll touch up the entries when I find a more appropriate name or format.

To slime users, please tell me how to disable slime-space binding
and restore the normal space binding cleanly. I'd like to write about
it in the documentation.

Stefan Monnier

unread,
Sep 17, 2004, 2:31:59 PM9/17/04
to
> Currently almost all the code is from eldocl.el. But I think it's already
> useful.

I recent versions of eldoc.el, you can use:

(defvar eldoc-print-current-symbol-info-function nil
"If non-nil, function to call to return doc string.
The function of no args should return a one-line string for displaying
doc about a function etc. appropriate to the context around point.
It should return nil if there's no doc appropriate for the context.
Typically doc is returned if point is on a function-like name or in its
arg list.

This variable is expected to be made buffer-local by modes (other than
Emacs Lisp mode) that support Eldoc.")


Stefan

Yuji Minejima

unread,
Sep 17, 2004, 11:27:24 PM9/17/04
to

I enhanced the interaction with slime.

Now, cldoc uses slime's code to display information on unknown
functions and global variables.

I expect cldoc surpasses the functionality of slime-autodoc-mode with this
enhancement in the slime environment. Please tell me if it's not.

Yuji Minejima

unread,
Sep 18, 2004, 10:28:51 PM9/18/04
to
Stefan Monnier <mon...@iro.umontreal.ca> wrote in message news:<jwv3c1gzr7d.fsf-monn...@gnu.org>...

Thanks for the information. eldoc.el version 1.18 which I inherited
the code from seems not to have that. I'll check to see if this
facility is general enough to support what I want to do in cldoc.el.

Yuji.

0 new messages