REPL auto-completion in windows ?

Started by jamesqiu, October 16, 2011, 06:52:56 PM

Previous topic - Next topic

jamesqiu

Anybody here use newlisp REPL under windows or cygwin ?

Is it possible to make REPL (not editor) support TAB auto-complete function name?

Lutz

#1
The tab-expansion in the REPL depends on the UNIX readline C-library. The Cygwin flavor of newLISP is compiled using this library. Until six years ago, newLISP was delivered as a Cygwin app. on Windows, but this changed during the year 2005. Today, the Windows version is compiled using MinGW which does not include the readline library.



The source distribution contains a makefile_cygwin, which was added back beginning of 2010, and some changes where added to the source for Cygwin by a user. So, perhaps it is still possible to compile for Cygwin. The Cygwin version of newLISP does not need a full version of Cygwin to run. Only the cygwin1.dll library needs to be present.

TedWalther

#2
Also, can you try using "configure-alt" and see if that works under cygwin?
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence.  Nine months later, they left with a baby named newLISP.  The women of the ivory towers wept and wailed.  \"Abomination!\" they cried.

jamesqiu

#3
cygwin under win7 64bit

./config-alt

make



nl-sock.c: In function 'p_netConnect':

nl-sock.c:422:6: warning: array subscript has type 'char'

nl-sock.c: In function 'p_netListen':

nl-sock.c:1198:6: warning: array subscript has type 'char'

nl-sock.c: In function 'ping':

nl-sock.c:1967:21: error: storage size of 'filter' isn't known

nl-sock.c:2008:2: warning: implicit declaration of function 'ICMP6_FILTER_SETPASSALL'

nl-sock.c:2009:33: error: 'ICMP6_FILTER' undeclared (first use in this function)

nl-sock.c:2009:33: note: each undeclared identifier is reported only once for each function it appea

rs in

nl-sock.c:2092:8: error: dereferencing pointer to incomplete type

nl-sock.c:2092:23: error: 'ICMP6_ECHO_REQUEST' undeclared (first use in this function)

nl-sock.c:2093:8: error: dereferencing pointer to incomplete type

nl-sock.c:2094:40: error: dereferencing pointer to incomplete type

nl-sock.c:2157:10: error: dereferencing pointer to incomplete type

nl-sock.c:2157:26: error: 'ICMP6_ECHO_REPLY' undeclared (first use in this function)

nl-sock.c:2158:13: error: dereferencing pointer to incomplete type

nl-sock.c:2159:53: error: dereferencing pointer to incomplete type

nl-sock.c:1967:21: warning: unused variable 'filter'

make[1]: *** [nl-sock.o] Error 1

make[1]: Leaving directory `/home/jamesqiu/newlisp-10.3.3'

make: *** [default] Error 2

jamesqiu

#4
An unsatisfied solution:



init.lsp

------------------------------------

(define-macro (kw s)
  (sort
(sort
 (filter (fn (x) (find (string s) (string x))) (symbols)))
 (fn (x) (starts-with (string x) (string s)))))

--------------------------------------------

> (kw read)

(read read-buffer read-char read-expr read-file read-key read-line read-utf8 reader-event)

TedWalther

#5
Thank you for running configure-alt.



Can you paste the contents of makefile_build, makefile_install, and config.h here so I can see what output it generated?
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence.  Nine months later, they left with a baby named newLISP.  The women of the ivory towers wept and wailed.  \"Abomination!\" they cried.

jamesqiu

#6
/home/jamesqiu/newlisp-10.3.3>./configure



removing old objects and setting correct permissions ...

discovering platform and default memory model ...



detected memory model ILP32

detected Operating System CYGWIN

creating makefile_build ...



to make for ILP32 on CYGWIN type:

    make

to make for any other system do:

    make -f makefile_xxx

where makefile_xxx is one of the preconfigured makefiles



/home/jamesqiu/newlisp-10.3.3>more makefile_build

# makefile for newLISP v.10.x.x on Cygwin with readline support

#

# Note, that readline support may require different libraries on different OSs

#

# To install, install the normal Win32 version of newLISP first,

# then copy the newlisp.exe into $(NEWLISPDIR), which is normally

# defined as "C:Program Filesnewlisp" after the Win32 install.



OBJS = newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o

        nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o pcre.o



CFLAGS = -m32 -Wall -pedantic -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DCYGWIN



CC = gcc





default: $(OBJS)

        $(CC) $(OBJS) -m32 -g -lm -ldl -lreadline -o newlisp.exe

        strip newlisp.exe



.c.o:

        $(CC) $(CFLAGS) $<



$(OBJS): primes.h protos.h makefile_cygwin



/home/jamesqiu/newlisp-10.3.3>

jamesqiu

#7
/home/jamesqiu/newlisp-10.3.3>cat makefile_install

#



VERSION=10.3.3



# NOTE when changing PREFIX, then newlisp should only run

# run in an environment, where NEWLISPDIR is predefined,

# else NEWLISPDIR will be defined during newlisp startup

# as /usr/share/newlisp which is hardcoded in newlisp.c

prefix=/usr

datadir=$(prefix)/share

bindir=$(prefix)/bin

mandir=$(prefix)/share/man



# if prefix is not /usr then several places in the file

# guiserver/newlisp-exit.lsp must change too

GUISERVER = $(prefix)/share/newlisp/guiserver



# this is the standard install in /usr/bin and usr/share (with prefix=/usr)

# which as to be done as 'root' with supersuser permissions

# for an install in your home directory use make install_home

#

# One-line description for distribution packages:

# newLISP is a LISP like, general purpose scripting language.

#

# Longer description for distribution packages:

# newLISP is a scripting language for developing web applications and programs

# in general and in the domains of artificial intelligence (AI) and statistics.



install:

        -install -d $(datadir)/newlisp

        -install -d $(datadir)/newlisp/modules

        -install -d $(datadir)/newlisp/util

        -install -d $(datadir)/doc/newlisp

        -rm $(bindir)/newlisp

        -install -m 755  newlisp $(bindir)/newlisp-$(VERSION)

        -ln -s $(bindir)/newlisp-$(VERSION) $(bindir)/newlisp

        -install -m 644 examples/init.lsp.example $(datadir)/newlisp/init.lsp.example

        -install -m 755 util/newlispdoc $(bindir)/newlispdoc

        -install -m 644 util/syntax.cgi $(datadir)/newlisp/util/syntax.cgi

        -install -m 644 util/newlisp.vim $(datadir)/newlisp/util/newlisp.vim

        -install -m 644 util/nanorc $(datadir)/newlisp/util/nanorc

        -install -m 644 util/link.lsp $(datadir)/newlisp/util/link.lsp

        -install -m 644 util/httpd-conf.lsp $(datadir)/newlisp/util/httpd-conf.lsp

        -install -m 644 doc/COPYING $(datadir)/doc/newlisp/COPYING

        -install -m 644 doc/CREDITS $(datadir)/doc/newlisp/CREDITS

        -install -m 644 doc/newlisp_manual.html $(datadir)/doc/newlisp/newlisp_manual.html

        -install -m 644 doc/newlisp_index.html $(datadir)/doc/newlisp/newlisp_index.html

        -install -m 644 doc/manual_frame.html $(datadir)/doc/newlisp/manual_frame.html

        -install -m 644 doc/CodePatterns.html $(datadir)/doc/newlisp/CodePatterns.html

        -install -m 644 doc/newLISPdoc.html $(datadir)/doc/newlisp/newLISPdoc.html

        -install -m 644 doc/newLISP-10.3.3-Release.html $(datadir)/doc/newlisp/newLISP-10.3.3-Releas

e.html

        -install -m 644 doc/newlisp.1 $(mandir)/man1/newlisp.1

        -install -m 644 doc/newlispdoc.1 $(mandir)/man1/newlispdoc.1

        -install -m 644 modules/canvas.lsp $(datadir)/newlisp/modules/canvas.lsp

        -install -m 644 modules/cgi.lsp $(datadir)/newlisp/modules/cgi.lsp

        -install -m 644 modules/crypto.lsp $(datadir)/newlisp/modules/crypto.lsp

        -install -m 644 modules/ftp.lsp $(datadir)/newlisp/modules/ftp.lsp

        -install -m 644 modules/gmp.lsp $(datadir)/newlisp/modules/gmp.lsp

        -install -m 644 modules/infix.lsp $(datadir)/newlisp/modules/infix.lsp

        -install -m 644 modules/json.lsp $(datadir)/newlisp/modules/json.lsp

        -install -m 644 modules/macro.lsp $(datadir)/newlisp/modules/macro.lsp

        -install -m 644 modules/mysql.lsp $(datadir)/newlisp/modules/mysql.lsp

        -install -m 644 modules/odbc.lsp $(datadir)/newlisp/modules/odbc.lsp

        -install -m 644 modules/pop3.lsp $(datadir)/newlisp/modules/pop3.lsp

        -install -m 644 modules/postgres.lsp $(datadir)/newlisp/modules/postgres.lsp

        -install -m 644 modules/postscript.lsp $(datadir)/newlisp/modules/postscript.lsp

        -install -m 644 modules/smtp.lsp $(datadir)/newlisp/modules/smtp.lsp

        -install -m 644 modules/smtpx.lsp $(datadir)/newlisp/modules/smtpx.lsp

        -install -m 644 modules/sqlite3.lsp $(datadir)/newlisp/modules/sqlite3.lsp

        -install -m 644 modules/stat.lsp $(datadir)/newlisp/modules/stat.lsp

        -install -m 644 modules/unix.lsp $(datadir)/newlisp/modules/unix.lsp

        -install -m 644 modules/xmlrpc-client.lsp $(datadir)/newlisp/modules/xmlrpc-client.lsp

        -install -m 644 modules/zlib.lsp $(datadir)/newlisp/modules/zlib.lsp

        # GUI-Server install

        -install -d $(datadir)/newlisp/guiserver

        -install -d $(datadir)/doc/newlisp/guiserver

        -install -m 755 guiserver/newlisp-edit.lsp $(bindir)/newlisp-edit

        -install -m 644 guiserver/guiserver.jar $(datadir)/newlisp/guiserver.jar

        -install -m 644 guiserver/guiserver.lsp $(datadir)/newlisp/guiserver.lsp

        -install -m 644 guiserver/images/newLISP128.png $(datadir)/newlisp/newLISP128.png

        -install -m 644 guiserver/COPYING $(datadir)/doc/newlisp/guiserver/COPYING

        -install -m 644 guiserver/index.html $(datadir)/doc/newlisp/guiserver/index.html

        -install -m 644 guiserver/guiserver.lsp.html $(datadir)/doc/newlisp/guiserver/guiserver.lsp.

html

        -install -m 644 util/newlispdoc.css $(datadir)/doc/newlisp/guiserver/newlispdoc.css

        -install -m 644 guiserver/allfonts-demo.lsp $(datadir)/newlisp/guiserver/allfonts-demo.lsp

        -install -m 644 guiserver/animation-demo.lsp $(datadir)/newlisp/guiserver/animation-demo.lsp



        -install -m 644 guiserver/border-layout-demo.lsp $(datadir)/newlisp/guiserver/border-layout-

demo.lsp

        -install -m 644 guiserver/button-demo.lsp $(datadir)/newlisp/guiserver/button-demo.lsp

        -install -m 644 guiserver/clipboard-demo.lsp $(datadir)/newlisp/guiserver/clipboard-demo.lsp



        -install -m 644 guiserver/cursor-demo.lsp $(datadir)/newlisp/guiserver/cursor-demo.lsp

        -install -m 644 guiserver/drag-demo.lsp $(datadir)/newlisp/guiserver/drag-demo.lsp

        -install -m 644 guiserver/font-demo.lsp $(datadir)/newlisp/guiserver/font-demo.lsp

        -install -m 644 guiserver/frameless-demo.lsp $(datadir)/newlisp/guiserver/frameless-demo.lsp



        -install -m 644 guiserver/html-demo.lsp $(datadir)/newlisp/guiserver/html-demo.lsp

        -install -m 644 guiserver/image-demo.lsp $(datadir)/newlisp/guiserver/image-demo.lsp

        -install -m 644 guiserver/midi-demo.lsp $(datadir)/newlisp/guiserver/midi-demo.lsp

        -install -m 644 guiserver/midi2-demo.lsp $(datadir)/newlisp/guiserver/midi2-demo.lsp

        -install -m 644 guiserver/mouse-demo.lsp $(datadir)/newlisp/guiserver/mouse-demo.lsp

        -install -m 644 guiserver/move-resize-demo.lsp $(datadir)/newlisp/guiserver/move-resize-demo

.lsp

        -install -m 644 guiserver/pinballs-demo.lsp $(datadir)/newlisp/guiserver/pinballs-demo.lsp

        -install -m 644 guiserver/properties-demo.lsp $(datadir)/newlisp/guiserver/properties-demo.l

sp

        -install -m 644 guiserver/rotation-demo.lsp $(datadir)/newlisp/guiserver/rotation-demo.lsp

        -install -m 644 guiserver/shapes-demo.lsp $(datadir)/newlisp/guiserver/shapes-demo.lsp

        -install -m 644 guiserver/sound-demo.lsp $(datadir)/newlisp/guiserver/sound-demo.lsp

        -install -m 644 guiserver/stroke-demo.lsp $(datadir)/newlisp/guiserver/stroke-demo.lsp

        -install -m 644 guiserver/tabs-demo.lsp $(datadir)/newlisp/guiserver/tabs-demo.lsp

        -install -m 644 guiserver/table-demo.lsp $(datadir)/newlisp/guiserver/table-demo.lsp

        -install -m 644 guiserver/textfield-demo.lsp $(datadir)/newlisp/guiserver/textfield-demo.lsp



        -install -m 644 guiserver/textrot-demo.lsp $(datadir)/newlisp/guiserver/textrot-demo.lsp

        -install -m 644 guiserver/widgets-demo.lsp $(datadir)/newlisp/guiserver/widgets-demo.lsp

        -install -m 644 guiserver/word-count.lsp $(datadir)/newlisp/guiserver/word-count.lsp

        -install -m 644 guiserver/uppercase.lsp $(datadir)/newlisp/guiserver/uppercase.lsp





uninstall:

        -rm  $(bindir)/newlisp

        -rm  $(bindir)/newlispdoc

        -rm  $(bindir)/newlisp-edit

        -rm  -rf $(datadir)/newlisp

        -rm  -rf $(datadir)/doc/newlisp

        -rm  $(mandir)/man1/newlisp.1

        -rm  $(mandir)/man1/newlispdoc.1



# installs newLISP in home directory, but without guiserver files except

# documentation. To make guiserver run from ~/share/newlisp. The loading

# from guiserver.lsp at the beginning of a guiserver app and loading

# of guiserver.jar from inside of guiserver.lsp have to be changed.



install_home:

        -install -d $(HOME)/bin

        -install -d $(HOME)/share/newlisp

        -install -d $(HOME)/share/newlisp/modules

        -install -d $(HOME)/share/newlisp/util

        -install -d $(HOME)/share/doc/newlisp/

        -install -d $(HOME)/share/doc/newlisp/guiserver

        -install -d $(HOME)/share/man/man1

        -install -m 755 newlisp $(HOME)/bin/newlisp

        -install -m 644 examples/init.lsp.example $(HOME)/share/newlisp/init.lsp.example

        -install -m 755 util/newlispdoc $(HOME)/bin/newlispdoc

        -install -m 644 util/syntax.cgi $(HOME)/share/newlisp/util/syntax.cgi

        -install -m 644 util/newlisp.vim $(HOME)/share/newlisp/util/newlisp.vim

        -install -m 644 util/nanorc $(HOME)/share/newlisp/util/nanorc

        -install -m 644 util/link.lsp $(HOME)/share/newlisp/util/link.lsp

        -install -m 644 util/httpd-conf.lsp $(HOME)/share/newlisp/util/httpd-conf.lsp

        -install -m 644 guiserver/index.html $(HOME)/share/doc/newlisp/guiserver/index.html

        -install -m 644 guiserver/guiserver.lsp.html $(HOME)/share/doc/newlisp/guiserver/guiserver.l

sp.html

        -install -m 644 doc/COPYING $(HOME)/share/doc/newlisp/COPYING

        -install -m 644 doc/COPYING $(HOME)/share/doc/newlisp/guiserver/COPYING

        -install -m 644 doc/CREDITS $(HOME)/share/doc/newlisp/CREDITS

        -install -m 644 doc/newlisp_manual.html $(HOME)/share/doc/newlisp/newlisp_manual.html

        -install -m 644 doc/newlisp_index.html $(HOME)/share/doc/newlisp/newlisp_index.html

        -install -m 644 doc/manual_frame.html $(HOME)/share/doc/newlisp/manual_frame.html

        -install -m 644 doc/CodePatterns.html $(HOME)/share/doc/newlisp/CodePatterns.html

        -install -m 644 doc/newLISPdoc.html $(HOME)/share/doc/newlisp/newLISPdoc.html

        -install -m 644 doc/newLISP-10.3.3-Release.html $(HOME)/share/doc/newlisp/newLISP-10.3.3-Rel

ease.html

        -install -m 644 doc/newlisp.1 $(HOME)/share/man/man1/newlisp.1

        -install -m 644 doc/newlispdoc.1 $(HOME)/share/man/man1/newlispdoc.1

        -install -m 644 modules/canvas.lsp $(HOME)/share/newlisp/modules/canvas.lsp

        -install -m 644 modules/cgi.lsp $(HOME)/share/newlisp/modules/cgi.lsp

        -install -m 644 modules/crypto.lsp $(HOME)/share/newlisp/modules/crypto.lsp

        -install -m 644 modules/ftp.lsp $(HOME)/share/newlisp/modules/ftp.lsp

        -install -m 644 modules/gmp.lsp $(HOME)/share/newlisp/modules/gmp.lsp

        -install -m 644 modules/infix.lsp $(HOME)/share/newlisp/modules/infix.lsp

        -install -m 644 modules/json.lsp $(HOME)/share/newlisp/modules/json.lsp

        -install -m 644 modules/macro.lsp $(HOME)/share/newlisp/modules/macro.lsp

        -install -m 644 modules/mysql.lsp $(HOME)/share/newlisp/modules/mysql.lsp

        -install -m 644 modules/odbc.lsp $(HOME)/share/newlisp/modules/odbc.lsp

        -install -m 644 modules/pop3.lsp $(HOME)/share/newlisp/modules/pop3.lsp

        -install -m 644 modules/postgres.lsp $(HOME)/share/newlisp/modules/postgres.lsp

        -install -m 644 modules/postscript.lsp $(HOME)/share/newlisp/modules/postscript.lsp

        -install -m 644 modules/smtp.lsp $(HOME)/share/newlisp/modules/smtp.lsp

        -install -m 644 modules/smtpx.lsp $(HOME)/share/newlisp/modules/smtpx.lsp

        -install -m 644 modules/sqlite3.lsp $(HOME)/share/newlisp/modules/sqlite3.lsp

        -install -m 644 modules/stat.lsp $(HOME)/share/newlisp/modules/stat.lsp

        -install -m 644 modules/unix.lsp $(HOME)/share/newlisp/modules/unix.lsp

        -install -m 644 modules/xmlrpc-client.lsp $(HOME)/share/newlisp/modules/xmlrpc-client.lsp

        -install -m 644 modules/zlib.lsp $(HOME)/share/newlisp/modules/zlib.lsp





uninstall_home:

        -rm  -rf $(HOME)/share/newlisp

        -rm  -rf $(HOME)/share/doc/newlisp

        -rm  $(HOME)/share/man/man1/newlisp.1

        -rm $(HOME)/bin/newlisp

        -rm $(HOME)/bin/newlispdoc



/home/jamesqiu/newlisp-10.3.3>

jamesqiu

#8
/home/jamesqiu/newlisp-10.3.3>more config.h

config.h: No such file or directory

/home/jamesqiu/newlisp-10.3.3>ls *.h

newlisp.h  pcre.h  pcre-config.h  pcre-internal.h  primes.h  protos.h

jamesqiu

#9
/home/jamesqiu/newlisp-10.3.3>./configure-alt



Could not discover your OS platform use one of the following commands:

nDo one of the following:

  make                 # auto-select one of the predefined makefiles and build newLISP

  make help            # display this help

  make install         # install on LINUX/UNIX in /usr/bin and /usr/share (need to be root)

  make uninstall       # uninstall on LINUX/UNIX from /usr/bin and /usr/share (need to be root)

  make install_home    # install on LINUX/UNIX in users home directory

  make uninstall_home  # uninstall on LINUX/UNIX from users home directory



  make clean           # remove all *.o and .tar files etc. USE BETWEEN FLAVORS!

  make check           # run qa-dot, qa-net, qa-xml etc. test scripts

  make test            # same as 'make check'

  make version         # replace version number in several files after changing in Makefile

  make bench           # benchmark relative to 32-bit Mac OS 10.5 on MacMini 1.83Ghz



Note! on some systems use gmake instead of make.

Note! not all makefiles are listed in this help, specifically 64-bit versions.



Readline is for commandline editing support and requires libreadline and headerfiles.

Not all makefiles contain libreadline support, but is easy to add (see other makefieles).

If there is no UTF-8 option for your OS, consult makefile_xxx.



For more customization options (exe dir, install dir, 64-biti, etc) see the file doc/INSTALL