Re: How to get the signature of function and method definitions

2011-11-15 Thread Alexander Burger
Hi Thorsten,

 I have a problem there, I tried
 
 ,
 | home/tj1/bin/picolisp/pil   |
 | home/tj1/bin/picolisp/plmod |
 | home/tj1/bin/picolisp/bin/pil   |
 | home/tj1/bin/picolisp/bin/plmod |
 | home/tj1/bin/picolisp/bin/psh |
 `
 
 but no matter which one  I use, and I always get an error, e.g. 
 
 ,--
 | (prog (load  
 | /home/tj1/bin/picolisp/lib/swank-picolisp/swank-picolisp.l)
 | (swank-start /tmp/slime.20688))
 |  
 | Can't exec program:  
 | /home/tj1/bin/picolisp/bin/psh   
 `--
 
 Now I'm a bit confused - which command should I use, and is that related
 to file permissions (they seem alright to me) or something else?

I think this error occurs because the binary 'picolisp' cannot be found.

BTW, 'psh' does not make sense to be executed stand-alone (though this
is not the problem here), because it tries to connect to a running
PicoLisp application server.

But /home/tj1/bin/picolisp/pil or /home/tj1/bin/picolisp/plmod, for
example, should work, if in the directory /home/tj1/bin/picolisp/bin a
binary executable picolisp can be found.



  Is that still valid, or should it rather be 'pil ore 'plmod now? 
  ,---
  | (setq slime-lisp-implementations  
  |   `((picolisp (/usr/bin/picolisp/p) :init slime-init-picolisp)))
  `---
 
  Yes, I think the way picolisp is launched has changed recently, so you
  need the use the correct shell script, likely pil.  Please let me know

Right. 'p' doesn't exist any longer (too easy to conflict).

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: How to get the signature of function and method definitions

2011-11-15 Thread Thorsten
Alexander Burger a...@software-lab.de writes:

Hi Alex,

 I have a problem there, I tried
 
 ,
 | home/tj1/bin/picolisp/pil   |
 | home/tj1/bin/picolisp/plmod |
 | home/tj1/bin/picolisp/bin/pil   |
 | home/tj1/bin/picolisp/bin/plmod |
 | home/tj1/bin/picolisp/bin/psh |
 `
 
 but no matter which one  I use, and I always get an error, e.g. 
 
 ,--
 | (prog (load  
 | /home/tj1/bin/picolisp/lib/swank-picolisp/swank-picolisp.l)
 | (swank-start /tmp/slime.20688))
 |  
 | Can't exec program:  
 | /home/tj1/bin/picolisp/bin/psh   
 `--
 
 Now I'm a bit confused - which command should I use, and is that related
 to file permissions (they seem alright to me) or something else?

 I think this error occurs because the binary 'picolisp' cannot be found.

strange, I changed $PATH and emacs exec-path:

,---
| ~ $ echo $PATH

| 
/home/tj1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:

| 
/usr/local/scala/bin:/home/tj1/shellscripts:/home/tj1/.cabal/bin:home/tj1/bin/picolisp/bin
`---

,
| ~ $ (print exec-path)  
| (/home/tj1/shellscripts /home/tj1/bin /usr/local/sbin
| /usr/local/bin /usr/sbin /usr/bin /sbin /bin /usr/games
| /usr/local/scala/bin /usr/lib/emacs/23.1/i686-linux-gnu
| /home/tj1/.cabal/bin/ /home/tj1/ /home/tj1/bin/picolisp/bin) 
`
 
and still get the same error message:

,--
| (prog (load  
| /home/tj1/bin/picolisp/lib/swank-picolisp/swank-picolisp.l)
| (swank-start /tmp/slime.1757)) 
| Can't exec program:  
| /home/tj1/bin/picolisp/pil   
|  
| Process inferior-lisp exited abnormally with code 1  
`--



 BTW, 'psh' does not make sense to be executed stand-alone (though this
 is not the problem here), because it tries to connect to a running
 PicoLisp application server.

ok, I changed that to 'pil'

 But /home/tj1/bin/picolisp/pil or /home/tj1/bin/picolisp/plmod, for
 example, should work, if in the directory /home/tj1/bin/picolisp/bin a
 binary executable picolisp can be found.

and there is an executable 'picolisp' in /home/tj1/bin/picolisp/bin
(and without slime, with inferior picolisp mode, it works)

,---
| /home/tj1/bin/picoLisp/bin:   
| insgesamt 232 
| drwxr-xr-x  2 tj1 tjx   4096 2011-11-11 15:23 .   
| drwxr-xr-x 19 tj1 tjx   4096 2011-11-15 01:35 ..  
| -rwxr-xr-x  1 tj1 tjx 206636 2011-11-11 15:23 picolisp
| -rwxr-xr-x  1 tj1 tjx107 2010-03-14 16:37 pil 
| -rwxr-xr-x  1 tj1 tjx223 2011-05-30 07:56 plmod   
| -rwxr-xr-x  1 tj1 tjx277 2011-05-06 08:14 psh 
| -rwxr-xr-x  1 tj1 tjx923 2011-05-06 08:45 replica 
| -rwxr-xr-x  1 tj1 tjx   2211 2008-03-09 15:16 watchdog
`---

When using slime, should the inferior buffer a *inferior-lisp* or rather
a *inferior-picolisp* buffer? I guess, the *inferior-lisp* buffer should
be fine ...

Cheers,
-- 
Thorsten

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: How to get the signature of function and method definitions

2011-11-15 Thread Alexander Burger
Hi Thorsten,

  I think this error occurs because the binary 'picolisp' cannot be found.
 
 strange, I changed $PATH and emacs exec-path:

As far as the 'picolisp' executable is concerned, the $PATH doesn't
matter at all. All that counts is how it is invoked by the scripts.
About emacs exec-path, however, I can't say anything.


 and still get the same error message:
 
 ,--
 | (prog (load  
 | /home/tj1/bin/picolisp/lib/swank-picolisp/swank-picolisp.l)
 | (swank-start /tmp/slime.1757)) 
 | Can't exec program:  
 | /home/tj1/bin/picolisp/pil   
 |  
 | Process inferior-lisp exited abnormally with code 1  
 `--

What happens if you execute it in the shell

   $ /home/tj1/bin/picolisp/pil

I assume that this 'pil' file is

   #!/bin/sh
   exec ${0%/*}/bin/picolisp ${0%/*}/lib.l @ext.l $@

so you see that it will try to execute

   /home/tj1/bin/picolisp/bin/picolisp

What does the command

   $ file /home/tj1/bin/picolisp/bin/picolisp

say?


 and there is an executable 'picolisp' in /home/tj1/bin/picolisp/bin
 (and without slime, with inferior picolisp mode, it works)

Ah, ok, I see.

Hmm, then I'm a bit clueless ...

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: How to get the signature of function and method definitions

2011-11-15 Thread Thorsten
Alexander Burger a...@software-lab.de writes:

Hi Alex,

 What happens if you execute it in the shell

$ /home/tj1/bin/picolisp/pil

,
| tj1@tj-desktop:~$ /home/tj1/bin/picolisp/pil   
| bash: /home/tj1/bin/picolisp/pil: Datei oder Verzeichnis nicht gefunden
`


 I assume that this 'pil' file is

#!/bin/sh
exec ${0%/*}/bin/picolisp ${0%/*}/lib.l @ext.l $@

yes, that it.


 so you see that it will try to execute

/home/tj1/bin/picolisp/bin/picolisp

 What does the command

$ file /home/tj1/bin/picolisp/bin/picolisp

 say?

,--
| tj1@tj-desktop:~$ file /home/tj1/bin/picolisp/bin/picolisp   
| /home/tj1/bin/picolisp/bin/picolisp: ERROR: cannot open  
| `/home/tj1/bin/picolisp/bin/picolisp' (No such file or directory)
`--


 and there is an executable 'picolisp' in /home/tj1/bin/picolisp/bin
 (and without slime, with inferior picolisp mode, it works)

,--
| tj1@tj-desktop:~$ pil
| : (+ 3 5)
| - 8 
| :
`--

very strange. but

,--
| tj1@tj-desktop:~$ /usr/bin/picolisp/pil  
| bash: /usr/bin/picolisp/pil: Ist kein Verzeichnis
| tj1@tj-desktop:~$ /usr/share/picolisp/pil
| :
`--

so thats the solution - I have a local installation, I set the 4 links
to /usr/bin/ and /usr/share/ as described in INSTALL - but apparently
only /usr/share/picolisp is the one that works. 
I have no idea why. 

after changing all calls to 'pil' to '/usr/share/picolisp/pil' and the
call to swank-picolisp to '/usr/share/picolisp/lib/swank-picolisp'
things worked - more or less. 
The connection to slime worked, I get a slime-repl with a pil prompt,
and calculations like (+ 3 4 ) work - but everything is extremely slow,
and after each keystroke I get 'wrong number of arguments' errors ...

but anyway - it works, somehow, finally. 
I should become a software- and usability-tester, I have what it takes
;)

now I'll try to figure out why what is still making problems. 
thanks for your help!

Cheers,
-- 
Thorsten

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: How to get the signature of function and method definitions

2011-11-15 Thread Tomas Hlavaty
Hi Thorsten,

 so thats the solution - I have a local installation, I set the 4 links
 to /usr/bin/ and /usr/share/ as described in INSTALL - but apparently
 only /usr/share/picolisp is the one that works.  I have no idea why.

how did you install your local picolisp?  Did you cd src; make?  Can
you find the bin/picolisp executable file after that?

 after changing all calls to 'pil' to '/usr/share/picolisp/pil' and the
 call to swank-picolisp to '/usr/share/picolisp/lib/swank-picolisp'
 things worked - more or less.  The connection to slime worked, I get a
 slime-repl with a pil prompt, and calculations like (+ 3 4 ) work -
 but everything is extremely slow, and after each keystroke I get
 'wrong number of arguments' errors ...

OK.  Now how exactly did you set up your slime?  I think Henrik had a
similar problem because he was using some slime contribs that
swank-picolisp doesn't support.  If you start with those contribs I sent
in the previous email, it should work.

The problem you are seeing is that when you move your cursor, emacs
talks to picolisp to find information about symbols your cursor points
at, e.g. if you write

   pil (+ 1 2)

and then place your cursor above +, slime tries to display information
about +.  I use emacs autodoc and in this case, I see that the symbol
plus is a built-in function, its address and arguments.

It is slow for you because something about this autodoc stuff doesn't
work for you.

 but anyway - it works, somehow, finally.  I should become a software-
 and usability-tester, I have what it takes ;)

Great;-)

You could have a look at the inferior-lisp buffer and you'll see some
messages sent forth and back between emacs and picolisp.  It should give
you an idea what the problem is.

Cheers,

Tomas
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: How to get the signature of function and method definitions

2011-11-15 Thread Tomas Hlavaty
Hi Thorsten,

 When using slime, should the inferior buffer a *inferior-lisp* or
 rather a *inferior-picolisp* buffer? I guess, the *inferior-lisp*
 buffer should be fine ...

It is *inferior-lisp* and the repl is called *slime-repl picolisp*.
They are numbered if you are connecting to multiple servers.

Cheers,

Tomas
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: How to get the signature of function and method definitions

2011-11-15 Thread Thorsten
Tomas Hlavaty t...@logand.com writes:

Hi Tomas,

 swank-picolisp and copied your configuration except the picolisp command 

 ,---
 | usr/bin/picolisp/p
 `---

 I have a problem there, I tried

 ,
 | home/tj1/bin/picolisp/pil   |
 | home/tj1/bin/picolisp/plmod |
 | home/tj1/bin/picolisp/bin/pil   |
 | home/tj1/bin/picolisp/bin/plmod |
 | home/tj1/bin/picolisp/bin/psh |
 `

 isn't there a slash missing to indicate absolute pathname?

this now works with the pil command, although the behaviour is still a
bit strange. 

 but no matter which one  I use, and I always get an error, e.g. 

 ,--
 | (prog (load  
 | /home/tj1/bin/picolisp/lib/swank-picolisp/swank-picolisp.l)
 | (swank-start /tmp/slime.20688))
 |  
 | Can't exec program:  
 | /home/tj1/bin/picolisp/bin/psh   
 `--

 I just tried with the latest picolisp from repository and it works.

 My .emacs is something like:

 (setq slime-lisp-implementations
   `((picolisp (/home/tomas/git/picolisp/pil +) :init 
 slime-init-picolisp)))

 (defun slime-init-picolisp (file _)
   (setq slime-protocol-version 'ignore)
   (format %S\n
   `(prog (load ,(expand-file-name
  /home/tomas/git/swank-picolisp/swank-picolisp.l))
  (swank-start ,file

 (add-to-list 'load-path ~/git/picolisp/lib/el/)
 (require 'picolisp)
 (add-to-list 'auto-mode-alist '(\\.l\\' . picolisp-mode))

 (add-hook 'picolisp-mode-hook (lambda () (slime-mode 1)))

 (add-to-list 'load-path ~/lisp/slime/)
 (require 'slime-autoloads)
 (slime-setup '(slime-repl slime-fuzzy slime-fancy slime-asdf))

 (setq slime-net-coding-system 'utf-8-unix)

I spend the afternoon updating to emacs 24, since I read about problems
with emacs 23.1.1 and slime. But nothing changed, its still very slow,
and I get 

,
| error in process filter: Wrong number of arguments: nil, 27
`

constantly when moving in the repl. 
I copied most of your configs too, but to no avail. 


 | (:program /home/tj1/bin/picolisp/bin/psh :program-args nil :buffer

 I think this is wrong program.  See my config above, it should be pil.
 
yes I changed that. 

Thank a lot for your help, I'm kind of exhausted now after installing
slime and installing emacs 24 the whole day - can't think straight ahead
anymore. Have to get used to the new emacs, and then figure out whats
wrong with my slime installation.

The new gnus is incredibly colorfull - I hope you don't see my text in
orange and yellow like I do. 

Cheers,
-- 
Thorsten

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: How to get the signature of function and method definitions

2011-11-15 Thread Thorsten
Tomas Hlavaty t...@logand.com writes:


 Hi Tomas,

 When using slime, should the inferior buffer a *inferior-lisp* or
 rather a *inferior-picolisp* buffer? I guess, the *inferior-lisp*
 buffer should be fine ...

 It is *inferior-lisp* and the repl is called *slime-repl picolisp*.
 They are numbered if you are connecting to multiple servers.

That looks good then. 
Thanks

Cheers,
-- 
Thorsten

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: How to get the signature of function and method definitions

2011-11-14 Thread Thorsten
Henrik Sarvell hsarv...@gmail.com
writes:

Hi Henrik,

 Does it matter if you can see the definition instead of simply jumping
 to it?

not really.

 Because with the help of CTags I can jump to any defined function or
 method in a .l file.

I tried it once to set up TAG files, but I didn't really succeed. I think
I have to read a bit more in the Emacs manual and then try your tutorial
again. TAGS seem to be really usefull, not only for Picolisp, but
everywhere in Emacs.  

 With jump to documentation you basically get this functionality for
 the built in functions.

I really like this, since I'm still in a phase where I basically have to
look up (almost) every Picolisp function I use, and that was a bit
tedious using the web interface.

 On Sat, Nov 12, 2011 at 2:44 AM, Thorsten
 quintf...@googlemail.com wrote:

 Tomas Hlavaty t...@logand.com writes:

 Hi Tomas,

 I remember that Alex recently mentioned a method how to get the
 signature of any function or method definition loaded in the system.
 Unfortunately, I could not find the related post again.

 Any hints where I have to look  would be appreciated.

 have a look at

    $ git clone http://logand.com/git/swank-picolisp.git

 it does what you are after, even for C/asm functions.

 Thats quite impressive, thanks. I thought slime/swank is only for 
 communication
 with compiled lisps, but well ...

 I can open a picolisp file in slime-mode now, but I can't connect (with
 slime-connect):

 ,---
 | Connecting to Swank on port 4005.. [2 times] open-network-stream: make
 | client process failed: verbindungsaufbau abgelehnt, :name, SLIME
 | Lisp, :buffer, nil, :host, 127.0.0.1, :service, 4005
 `---

 I have to check my slime installation ...


 Is that still valid, or should it rather be 'pil ore 'plmod now?
 ,---
 | (setq slime-lisp-implementations
 |       `((picolisp (/usr/bin/picolisp/p) :init slime-init-picolisp)))
 `---

 So, the connection via swank replaces the connection via
 inferior-picolisp/commint - or uses it? And slime-mode replaces
 picolisp-mode, or adds new functionality to it?

 Thats new terrain, I only knew about swank from ENSIME, the emacs scala
 mode, never used slime/swank with a lisp.

 Cheers,
 --
 Thorsten

 --

 UNSUBSCRIBE:
mailto:picolisp@software-lab.de?subject=Unsubscribe

cheers
-- 
Thorsten

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: How to get the signature of function and method definitions

2011-11-14 Thread Alexander Burger
Hi Henrik, Thorsten,

  Because with the help of CTags I can jump to any defined function or
  method in a .l file.
 
 I tried it once to set up TAG files, but I didn't really succeed. I think
 I have to read a bit more in the Emacs manual and then try your tutorial
 again. TAGS seem to be really usefull, not only for Picolisp, but
 everywhere in Emacs.  

I think that the necessary tags are already there, or can be easily
generated. At least in the latest version of PicoLisp (this was extended
recently a bit).

You can - again - take the 'vi' function as example. It generates a
temporary file ~/.pil/tmp/pid/tags upon startup, so that all
functions defined in the current session are included. The other symbols
(all built-in functions and assembly-level labels, equates etc.) already
come with the distribution in src64/tags).

So, in 'vi', after you edit a function, e.g.

   : (vi 'doc)

you can move the cursor on other symbols, e.g. 'call' in the next line,
and hit Ctrl-']'. There, you may click on 'CDR', and so on.

I think it should be easy to adopt this mechanism to other editors.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: How to get the signature of function and method definitions

2011-11-14 Thread Alexander Burger
On Mon, Nov 14, 2011 at 01:38:56PM +0100, Alexander Burger wrote:
 I think that the necessary tags are already there, or can be easily

I'm assuming that emacs can use the 'vi' tag file format. Am I wrong?
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: How to get the signature of function and method definitions

2011-11-14 Thread Henrik Sarvell
It's at the end here:
http://www.prodevtips.com/2010/09/29/emacs-color-themes-tags-cedet-ecb-and-other-customizations/

Not much to it, I do things old school ie I put the download in
/opt/picolisp and simply cd there in a shell and do: ctags -e -R
--languages=-JavaScript,-PHP,-C,-Make,-HTML

This will recursively loop through all the folders and generate tags
for everything, for instance all my projects in /opt/picolisp/projects
and the standard library in /opt/picolisp/lib


On Mon, Nov 14, 2011 at 9:18 PM, Thorsten quintf...@googlemail.com wrote:

 Alexander Burger a...@software-lab.de writes:

 Hi Alex,
  On Mon, Nov 14, 2011 at 01:38:56PM +0100, Alexander Burger wrote:
  I think that the necessary tags are already there, or can be easily
 
  I'm assuming that emacs can use the 'vi' tag file format. Am I wrong?

 I must admit I'm a bit overwhelmed by all the new information and
 possibilities I learned about in this thread - will need some time to
 digest all that.

 Since Emacs is such a huge beast, I try to learn it step by step - and
 TAGS was one of the topics I couldn't get my head around easiliy, so I
 just left it for another attempt later on.

 Therefore, I can't really say much about the tag file formats at the
 moment, maybe Henrik can help.

 cheers
 --
 Thorsten

 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: How to get the signature of function and method definitions

2011-11-14 Thread Alexander Burger
Hi Henrik,

 Not much to it, I do things old school ie I put the download in
 /opt/picolisp and simply cd there in a shell and do: ctags -e -R
 --languages=-JavaScript,-PHP,-C,-Make,-HTML
 
 This will recursively loop through all the folders and generate tags
 for everything, for instance all my projects in /opt/picolisp/projects
 and the standard library in /opt/picolisp/lib

I see. However, I would see some problems with that:

- 'ctags' doesn't know how to handle the Lisp level functions like '*/',
  and their connection to 'doMulDiv'.

- In the folders may be several files that contain a (de foo (..) ..),
  and 'ctags' doesn't know which are loaded in the current project.

- 'ctags' cannot resolve methods with the same name for different
  classes, and associate each of them with its class.

If you simply let the PicoLisp runtime do it, you have it all in the
right place.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: How to get the signature of function and method definitions

2011-11-14 Thread Henrik Sarvell
1.) Lisp level functions are handled anyway by the jump to documentation script.
2.) It's only a problem when jumping as you then jump to the incorrect
file but since I don't do much global functions anyway this is not a
problem for me, if I jump to http for instance I end up in the right
file.
3.) Correct and could become a potential annoyance when jumping,
unfortunately my autocompletion only locks on to the predefined lisp
functions and all definitions in all open buffers so there it is not a
problem (I was wrong before when I wrote in my article that it would
lock on tags too).

On Tue, Nov 15, 2011 at 12:22 AM, Alexander Burger a...@software-lab.de wrote:
 Hi Henrik,

 Not much to it, I do things old school ie I put the download in
 /opt/picolisp and simply cd there in a shell and do: ctags -e -R
 --languages=-JavaScript,-PHP,-C,-Make,-HTML

 This will recursively loop through all the folders and generate tags
 for everything, for instance all my projects in /opt/picolisp/projects
 and the standard library in /opt/picolisp/lib

 I see. However, I would see some problems with that:

 - 'ctags' doesn't know how to handle the Lisp level functions like '*/',
  and their connection to 'doMulDiv'.

 - In the folders may be several files that contain a (de foo (..) ..),
  and 'ctags' doesn't know which are loaded in the current project.

 - 'ctags' cannot resolve methods with the same name for different
  classes, and associate each of them with its class.

 If you simply let the PicoLisp runtime do it, you have it all in the
 right place.

 Cheers,
 - Alex
 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: How to get the signature of function and method definitions

2011-11-14 Thread Thorsten
Alexander Burger a...@software-lab.de writes:


Hi Alex,
 On Mon, Nov 14, 2011 at 01:38:56PM +0100, Alexander Burger wrote:
 I think that the necessary tags are already there, or can be easily

 I'm assuming that emacs can use the 'vi' tag file format. Am I wrong?

I'm afraid not, I used 

,-
| M-. 
| (find-tag tagname optional next-p regexp-p)
`-

on 'while' in a picolisp source-file in @/src64. and got the following
message:

,-
| visit-tags-table-buffer:
| File /home/tj1/bin/picoLisp/src64/tags is not a valid tags table
`-

Is that ctags or etags or something else what 'vi' uses? 


,---
| *emacs-tags* *emacs_tags* *E430*  
| Emacs style tag files are only supported if Vim was compiled with the 
| |+emacs_tags| feature enabled.  Sorry, there is no explanation about Emacs tag
| files here, it is only supported for backwards compatibility :-). 
|   
| Lines in Emacs tags files can be very long.  Vim only deals with lines of up  
| to about 510 bytes.  To see whether lines are ignored set 'verbose' to 5 or   
| higher.   
|   
| http://vimdoc.sourceforge.net/htmldoc/tagsrch.html
`---

If 'vi' uses (exuberant) ctags, it seems you could produce an etags TAGS
file for emacs by simply running 'ctags -e'. 


,-
| Despite the wealth of available options, defaults are set so that ctags |
| is most commonly executed without any options (e.g. ctags *, or ctags|
| −R), which will create a tag file in the current directory for all |
| recognized source files. The options described below are provided merely|
| to allow custom tailoring to meet special needs.|
| |
| −e  |
| |
| Enable etags mode, which will create a tag file for use with the Emacs  |
| editor. Alternatively, if ctags is invoked by a name containing the |
| string etags (either by renaming, or creating a link to, the  |
| executable), etags mode will be enabled. This option must appear before |
| the first file name.|
| http://ctags.sourceforge.net/ctags.html#HOW%20TO%20USE%20WITH%20GNU%20EMACS |
| |
`-

cheers
-- 
Thorsten

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: How to get the signature of function and method definitions

2011-11-14 Thread Alexander Burger
Hi Thorsten,

 ,-
 | visit-tags-table-buffer:
 | File /home/tj1/bin/picoLisp/src64/tags is not a valid tags table
 `-
 
 Is that ctags or etags or something else what 'vi' uses? 

Yes, so this seems indeed to be te case.


 ...
 If 'vi' uses (exuberant) ctags, it seems you could produce an etags TAGS
 file for emacs by simply running 'ctags -e'. 

There must surely be a way.

Then the easiest would probably be (if the intention is anyway to write
an emacs version of 'vi'), to modify this part of 'vi'

  (out (tmp tags)
 (let D (pack (pwd) /)
(for This (sort (all))
   (let? P (path (: *Dbg 1 -1))
  (prinl
 This
 ^I
 (unless (= `(char /) (char P)) D)
 P
 ^I
 (: *Dbg 1 1) ) ) ) ) )

to output an emacs compatible format.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: How to get the signature of function and method definitions

2011-11-14 Thread Thorsten
Tomas Hlavaty t...@logand.com writes:

Hi Henrik, Hi Tomas,
thanks for your help so far. 

I now have slime and sbcl installed and working, and I downloaded
swank-picolisp and copied your configuration except the picolisp command 

,---
| usr/bin/picolisp/p
`---

I have a problem there, I tried

,
| home/tj1/bin/picolisp/pil   |
| home/tj1/bin/picolisp/plmod |
| home/tj1/bin/picolisp/bin/pil   |
| home/tj1/bin/picolisp/bin/plmod |
| home/tj1/bin/picolisp/bin/psh |
`

but no matter which one  I use, and I always get an error, e.g. 

,--
| (prog (load  
| /home/tj1/bin/picolisp/lib/swank-picolisp/swank-picolisp.l)
| (swank-start /tmp/slime.20688))
|  
| Can't exec program:  
| /home/tj1/bin/picolisp/bin/psh   
`--

Now I'm a bit confused - which command should I use, and is that related
to file permissions (they seem alright to me) or something else?
Do you use recent versions of picolisp?


here is the backtrace I get when I try to open a test2.l file:

,-
| Debugger entered--Lisp error: (error Process inferior-lisp not 
| running) process-send-string(#process inferior-lisp (prog (load 
| \/home/tj1/bin/picolisp/lib/swank-picolisp/swank-picolisp.l\) 
| (swank-start \/tmp/slime.20688\))\n) (let ((str ...)) (goto-char 
| (process-mark process)) (insert-before-markers str) (process-send-string
| process str)) (save-current-buffer (set-buffer (process-buffer process))
| (make-local-variable (quote slime-inferior-lisp-args)) (setq
| slime-inferior-lisp-args args) (let (...) (goto-char ...)   
| (insert-before-markers str) (process-send-string process str))) 
| (with-current-buffer (process-buffer process) (make-local-variable  
| (quote slime-inferior-lisp-args)) (setq slime-inferior-lisp-args args)  
| (let (...) (goto-char ...) (insert-before-markers str)  
| (process-send-string process str))) (let* ((--cl-rest-- args)   
| (coding-system ...) (init ...)) (with-current-buffer (process-buffer
| process) (make-local-variable ...) (setq slime-inferior-lisp-args args) 
| (let ... ... ... ...))) (progn (let* (... ... ...) (with-current-buffer 
| ... ... ... ...))) (destructuring-bind (key coding-system init 
| allow-other-keys) args (with-current-buffer (process-buffer process)   
| (make-local-variable ...) (setq slime-inferior-lisp-args args) (let ... 
| ... ... ...))) slime-start-swank-server(#process inferior-lisp
| (:program /home/tj1/bin/picolisp/bin/psh :program-args nil :buffer
| *inferior-lisp* :coding-system iso-latin-1-unix :init 
| slime-init-picolisp :name picolisp :init-function nil :env nil))
| slime-inferior-connect(#process inferior-lisp (:program   
| /home/tj1/bin/picolisp/bin/psh :program-args nil :buffer  
| *inferior-lisp* :coding-system iso-latin-1-unix :init 
| slime-init-picolisp :name picolisp :init-function nil :env nil)) (let   
| ((proc ...)) (slime-inferior-connect proc args) (pop-to-buffer  
| (process-buffer proc))) (let ((args ...)) (slime-check-coding-system
| coding-system) (when (slime-bytecode-stale-p)   
| (slime-urge-bytecode-recompile)) (let (...) (slime-inferior-connect proc
| args) (pop-to-buffer ...))) (catch (quote --cl-block-slime-start--) (let
| (...) (slime-check-coding-system coding-system) (when ... ...) (let ... 
| ... ...))) (cl-block-wrapper (catch (quote --cl-block-slime-start--)
| (let ... ... ... ...))) (block slime-start (let (...)   
| (slime-check-coding-system coding-system) (when ... ...) (let ... ...   
| ...))) (let* ((program ...) (program-args ...) (directory ...)  
| (coding-system ...) (init ...) (name ...) (buffer ...) (init-function   
| ...) (env ...)) (let (...) (while --cl-keys-- ...)) (block slime-start  
| (let ... ... ... ...))) slime-start(:name picolisp :program 
| /home/tj1/bin/picolisp/bin/psh :program-args nil :init
| slime-init-picolisp) apply(slime-start (:name picolisp :program 
| /home/tj1/bin/picolisp/bin/psh :program-args nil :init
| slime-init-picolisp)) slime-start*((:name picolisp :program 
| /home/tj1/bin/picolisp/bin/psh :program-args nil :init
| slime-init-picolisp)) (let ((inferior-lisp-program ...) 
| (slime-net-coding-system ...)) (slime-start* (cond ... ...))) slime()   
| 

Re: How to get the signature of function and method definitions

2011-11-12 Thread Tomas Hlavaty
Hi Thorsten,

 Thats quite impressive, thanks. I thought slime/swank is only for
 communication with compiled lisps, but well ...

slime/swank is a client/server protocol.  There are backends e.g. for
Common Lisp, Scheme, Clojure, R, Picolisp and probably more.  It is not
difficult to write a new backend, if your interpreter supports the
features you are after.  I find it much better that the traditional
commint stuff. I use slime daily and can't imagine life without it
anymore;-) Definitely the way to go if you don't follow Alex's steps
with xterm and vi.  I haven't implemented the whole protocol yet, but
the subset in swank-picolisp is already usable and very helpful.

 I can open a picolisp file in slime-mode now, but I can't connect
 (with slime-connect):

 ,---
 | Connecting to Swank on port 4005.. [2 times] open-network-stream: make
 | client process failed: verbindungsaufbau abgelehnt, :name, SLIME  
 | Lisp, :buffer, nil, :host, 127.0.0.1, :service, 4005  
 `---

 I have to check my slime installation ...

 Is that still valid, or should it rather be 'pil ore 'plmod now? 
 ,---
 | (setq slime-lisp-implementations  
 |   `((picolisp (/usr/bin/picolisp/p) :init slime-init-picolisp)))
 `---

Yes, I think the way picolisp is launched has changed recently, so you
need the use the correct shell script, likely pil.  Please let me know
it it worked for you.  You should get a repl and then type (+ 1 2) and
get the result.  If you move your cursor around, you should see function
arguments in the message buffer and if you do M-. and M-, then you
should be jumping around the sources.

 So, the connection via swank replaces the connection via
 inferior-picolisp/commint - or uses it? And slime-mode replaces
 picolisp-mode, or adds new functionality to it?

Swank is a client/server protocol that doesn't use commint mode, it
talks to the picolisp interpreter via socket.  Slime mode extends
picolisp mode with the ability to talk to the server interpreter(s) via
the swank protocol.

 Thats new terrain, I only knew about swank from ENSIME, the emacs
 scala mode, never used slime/swank with a lisp.

I didn't know Scala worked with slime too.

I recommend reading about slime and watching some videos (look for slime
and Marco Baringer), e.g.

http://www.youtube.com/watch?v=_B_4vhsmRRI
http://bc.tech.coop/blog/050728.html
http://common-lisp.net/project/slime/
https://secure.wikimedia.org/wikipedia/en/wiki/SLIME
http://www.emacswiki.org/emacs/SlimeMode

Cheers,

Tomas
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: How to get the signature of function and method definitions

2011-11-11 Thread Thorsten
Alexander Burger a...@software-lab.de writes:

Hi Alex,

 Perhaps the output mode (console cooked vs. raw) is not right? Does it
 behave correctly if you start it - without emacs - just from the shell

$ pil +

 in the default way?

picolisp does work from the shell - but not 'doc:

,-
| tj1@tj-desktop:~$ pil + 
| + open: No such file or directory   
| ?   
| : (+ 2 3)   
| - 5
| : (pp 'insert)  
| (de insert (N Lst X)
| (conc (cut (dec N) 'Lst) (cons X) Lst) )
| - insert   
| : (doc 'insert) 
| !? (doc 'insert)
| doc -- Undefined
| ?   
| :   
`-


Cheers,
-- 
Thorsten

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: How to get the signature of function and method definitions

2011-11-11 Thread Alexander Burger
Hi Thorsten,

  Perhaps the output mode (console cooked vs. raw) is not right? Does it
  behave correctly if you start it - without emacs - just from the shell
 
 $ pil +
 
  in the default way?
 
 picolisp does work from the shell - but not 'doc:
 
 ,-
 | tj1@tj-desktop:~$ pil + 
 | + open: No such file or directory   

Oops, do you use a rather old version? The '+' as debug flag was
introduced with picoLisp-3.0.6 (before March 2011).


 | !? (doc 'insert)
 | doc -- Undefined

This happens because the '+' was not recognized, and thus the debugger
and related information were not loaded.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


How to get the signature of function and method definitions

2011-11-10 Thread Thorsten

Hi list, 

I remember that Alex recently mentioned a method how to get the
signature of any function or method definition loaded in the system.
Unfortunately, I could not find the related post again.

Any hints where I have to look  would be appreciated.

cheers
-- 
Thorsten

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: How to get the signature of function and method definitions

2011-11-10 Thread Henrik Sarvell
I don't know if this is exactly what you want but (all) can be used to
inspect stuff, an example of getting all loaded classes:

(de getClasses ()

  (filter
 '((S)
 (and
(= `(char +) (char S))
(type S)))
 (all)))


On Thu, Nov 10, 2011 at 7:27 PM, Thorsten quintf...@googlemail.com wrote:

 Hi list,

 I remember that Alex recently mentioned a method how to get the
 signature of any function or method definition loaded in the system.
 Unfortunately, I could not find the related post again.

 Any hints where I have to look  would be appreciated.

 cheers
 --
 Thorsten

 --
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: How to get the signature of function and method definitions

2011-11-10 Thread Alexander Burger
Hi Thorsten,

 I remember that Alex recently mentioned a method how to get the
 signature of any function or method definition loaded in the system.

I'm not completely sure what you mean with signature in this context.


You can inspect a function by pretty-printing,

   : (pp 'insert)
   (de insert (N Lst X)
  (conc (cut (dec N) 'Lst) (cons X) Lst) )

by looking at it with an editor (sorry, only 'vim' at the moment),

   : (vi 'insert)

or access its reference

   : (doc 'insert)


A signature in the sense of C or Java is perhaps

   : (car insert)
   - (N Lst X)

i.e. the formal parameters of the function.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: How to get the signature of function and method definitions

2011-11-10 Thread Thorsten
Alexander Burger a...@software-lab.de writes:

Hi Alex,

 I remember that Alex recently mentioned a method how to get the
 signature of any function or method definition loaded in the system.

 I'm not completely sure what you mean with signature in this context.


 You can inspect a function by pretty-printing,

: (pp 'insert)
(de insert (N Lst X)
   (conc (cut (dec N) 'Lst) (cons X) Lst) )

too much output in this case

 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?

 or access its reference

: (doc 'insert)

gives me this output - is that intended for vim too? (sorry for the long
lines). 

: (doc 'insert)
1,02kbloaded-(208730594.32315):(stamp73059432315)-2000-06-1708:58:35(init 
'tree ['any1] ['any2]) - 
lstInitializesastructureforsteppingiterativelythroughadatabasetree.any1andany2mayspecifyarangeofkeys.Ifany2isgreaterthanany1,thetraversalwillbeinoppositedirection.Seealsotree,step,iterandscan.:(init(tree'nr'+Item)35)-(((3.5)((3NIL.{3-3})(4NIL.{3-4})(5NIL.{3-5})(6NIL.{3-6})(insert
 'cnt 'lst 'any) - 
lstInsertsanyintolstatpositioncnt.Thisisanon-destructiveoperation.Seealsoremove,place,append,deleteandreplace.:(insert3'(abcde)777)-(ab777cde):(insert1'(abcde)777)-(777abcde):(insert9'(abcde)777)-(abcde777)≪
 ↑ ↓ Viewing Ilibgpm: zero screen dimension, assuming 80x25.


 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)  
`---

Thanks for you answer

Cheers,
-- 
Thorsten

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: How to get the signature of function and method definitions

2011-11-10 Thread Alexander Burger
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 clicked 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:picolisp@software-lab.de?subject=Unsubscribe


Re: How to get the signature of function and method definitions

2011-11-10 Thread Thorsten
Alexander Burger a...@software-lab.de writes:

Hi Alex,

  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'.

Ok, let me think about this, when I fully understand the 'vi' function I
might be able to produce an 'emacs' function, its a nice exercise.   

 'edit' is far more tricky, because it re-opens itself with additional
 symbols which were clicked on. Perhaps we should think about it once
 'vi' is ported to 'emacs'.

agreed.


 : (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').

I do use w3m and w3m-mode for emacs, and now I exported a new
environment variable BROWSER=w3m - and w3m seems to be on the path, since
I get the expected output when I type 'w3m' in a shell. But
nevertheless I get the same strange output in the emacs inferior
*picolisp* buffer. 

  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)).

I see, that works, still (very) much to learn ;)
Thanks for you help.

Cheers,
-- 
Thorsten

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe