[climacs-devel] Climacs - self documenting editor?

Christophe Rhodes csr21 at cam.ac.uk
Wed Apr 26 09:39:22 UTC 2006


Troels Henriksen <athas at sigkill.dk> writes:

> Climacs is severely lacking in the self-documenting aspect of The
> Emacs Way. ESA has a few functions that can be used to find out about
> available commands, but that's it. I believe the facilities in ESA
> should be expanded, but, unfortunately, ESA does not have the concept
> of a typeout-pane, and the minibuffer is far too small for complete
> documentation, so these functions will have to present their
> documentation to a user-provided string. 

Maybe to a user-provided stream?

> I have attached a file to this post that contains code for an
> implementation of the C-h f and C-h k help commands from Emacs. My
> idea is that the functions should go in ESA and the command
> definitions in the applications themselves. In this case, I've just
> put everything in the CLIMACS-GUI package though. Please comment on
> my approach (and start writing docstrings ;-).

So the potential for really large CVS conflicts is looming, because I
have just about got to the bottom of the command-parser framework (in
as much as it has a bottom) with a view to replacing all the
argumentless esa/gsharp/climacs commands with ones that accept
arguments (rather than commands which call ACCEPT in their bodies).

The idea behind this is to be able to do
  (execute-frame-command (find-application-frame 'climacs)
                         `(com-find-file "/tmp/foo"))
from other applications: at present, this is not possible because
COM-FIND-FILE does not take an argument.

I've been playing with the command processor because the climacs
minibuffer is small: too small to let the ordinary CLIM command
processor take over, as it wants to print newlines or go over 80
characters; I presume that this is why the commands were written this
way in the first place.  Does anyone know of any other reason that
this was done?

In the context of this thread, one advantage of this refactoring, from
  (define-command (com-find-file :name t :command-table buffer-table) ()
    (let* ((filepath (accept 'pathname :prompt "Find File"
                      :default (directory-of-buffer (buffer (current-window)))
                      :default-type 'pathname
                      :insert-default t)))
    (find-file filepath))) 
to
  (define-command (com-find-file :name t :command-table buffer-table)
      ((filepath 'pathname :prompt "Find File: " :prompt-mode :raw
                 :default (directory-of-buffer (buffer (current-window)))
                 :default-type 'pathname :insert-default t))
    (find-file filepath))
is that arguments to commands can be documented as well as the
commands themselves.

To get this working in McCLIM, in addition to real ugliness in the
command processor itself (a new function ESA-COMMAND-PARSER that gets
bound to CLIM:*COMMAND-PARSER*), there's an unresolved issue with
input editing streams that the patch at
<http://paste.lisp.org/display/19329#3> works around, so none of this
is quite ready for prime-time.

Cheers,

Christophe



More information about the climacs-devel mailing list