Hi Thorsten,
> > by looking at it with an editor (sorry, only 'vim' at the moment),
> >
> > : (vi 'insert)
>
> that was another question of mine - what would it take to get a
>
> ,----------------
> | (emacs 'insert)
> `----------------
>
> function, and a
>
> ,---------------
> | (edit 'insert)
> `---------------
>
> that opens an emacs window?
Yes, this would be nice to have. I don't know enough about emacs, but
it should be surely possible.
For the first case, the source of 'vi' (lib/debug.l:162) could be taken
as a template.
The first expression
(when (pair "X")
(setq C (cdr "X") "X" (car "X")) )
occurs in a similar form in most debugging functions, and extracts a
possible class from the argument(s), i.e. calling (vi 'msg> '+Cls) or
(vi '(msg> . +Cls)) is the same. Then the file and line number is
searched in the '*Dbg' property of that symbol or class:
(if C
(get C '*Dbg -1 "X")
(get "X" '*Dbg 1) ) )
and also maintained in a local static variable "*Vi" for later
(repeated) calls and for 'ld'.
Then there is some "tags" file handling, don't know what makes
sense for emacs here.
The real call of 'vim' is
(call 'vim
(pack "+set tags=" (tmp "tags") ",./tags")
"+set isk=33-34,36-38,42-90,92,94-95,97-125"
(pack "+" (car "*Vi"))
(path (cdr "*Vi")) )
Again, some tags fiddling, and the charset for symbols is set in 'isk'.
The most important part is the argument +123 (if the line number in the
file is 123) and the file's path name in the last two arguments to
'vim'.
'edit' is far more tricky, because it re-opens itself with additional
symbols which were "click"ed on. Perhaps we should think about it once
'vi' is ported to 'emacs'.
> > : (doc 'insert)
>
> gives me this output - is that intended for vim too? (sorry for the long
> lines).
>
> : (doc 'insert)
> 1,02kbloaded->(208730594...
Dunno. This is strange.
By default, 'doc' simply calls the 'w3m' browser (if neither a browser
is in the environment variable BROWSER, nor one was passed as a second
argument to 'doc').
> > A "signature" in the sense of C or Java is perhaps
> >
> > : (car insert)
> > -> (N Lst X)
>
> That probably what I was looking for.
>
> > i.e. the formal parameters of the function.
>
> Is there is similar method to get the formal parameters of a method?
>
> ,-----------------------------------------------
> | :(class +Shape)
> | -> +Shape
> |
> | :(dm T (X Y)
> | (=: x X)
> | (=: y Y))
> | -> T
> |
> | :(dm move> (DX DY)
> | (inc (:: x) DX)
> | (inc (:: y) DY))
> | -> move>
> |
> | :(car move>)
> | !? (car move>) 67291568 -- Variable expected ?
> |
> | : (car 'move>)
> | -> 67291568
> |
> | : (car insert)
> | -> (N Lst X)
> `-----------------------------------------------
Yes, you could do
: (car (method 'move> '+Shape))
-> (DX DY)
(as you can do (pp 'move> '+Shape) or (vi 'move> '+Shape)).
Cheers,
- Alex
--
UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe