Updates:

1. breadline installed out of the box, no extra effort required, on SLES11
at work.
2. breadline did exactly what I expected when I added (repl) to the code in
the given csirc example and put it in my program.
3. ^R, history saving and all the other powerful features of readline all
seem to work.
4. Code completion works!! Maybe it is a bit much to ask but it'd be useful
if completion rolled over from internal symbols to files. (*)

Thanks Vasilij, this egg is very much appreciated. If no one else is
reporting problems on Ubuntu 18.04 then likely I've got something messed up
on my home machine. I'll debug further and report back on what I find.

This is what I included in my code to get a repl with line editing, history
etc:

  (case command
    ((repl)
     (import (chicken load))
     (load-verbose #f)
     (let ()
       (import (chicken format))
       (import (chicken process-context))
       (unless (get-environment-variable "INSIDE_EMACS")
      (import breadline)
      (import breadline-scheme-completion)
      (history-file (format "~a/.csi_history" (get-environment-variable
"HOME")))
      (stifle-history! 10000)
      (completer-word-break-characters-set! "\"\'`;|(")
      (completer-set! scheme-completer)
      (basic-quote-characters-set! "\"|")
      (variable-bind! "blink-matching-paren" "on")
      (paren-blink-timeout-set! 200000)
      (current-input-port (make-readline-port))))
     (repl)  ;; added this
)
 . . .

(*) What I mean by rollover is this:
#;> (publis<tab>
;; fills out from internal symbols and the publish is filled out. Then I'd
like to enter a filename:
#;> (publish "examples/a<tab>
;; if breadline doesn't find an internal symbol "examples/a" then it could
look at the filesystem and list the files that match.

On Fri, Jan 31, 2020 at 4:30 AM Matt Welland <mattrwell...@gmail.com> wrote:

> For linenoise I was not able to get saving history to work.
>
> I'm having trouble getting breadline to install on Ubuntu on this old
> laptop. I have libreadline-dev installed but when I do chicken-install
> breadline I get:
>
> matt@matt-HP-EliteBook-6930p:~$ chicken-install breadline
> building breadline
>    /home/matt/.cache/chicken-install/breadline/build-breadline -host -D
> compiling-extension -J -s -regenerate-import-libraries -setup-mode -I
> /home/matt/.cache/chicken-install/breadline -C
> -I/home/matt/.cache/chicken-install/breadline -O2 -d1 breadline.scm -o
> /home/matt/.cache/chicken-install/breadline/breadline.so
> Package readline was not found in the pkg-config search path.
> Perhaps you should add the directory containing `readline.pc'
> to the PKG_CONFIG_PATH environment variable
> No package 'readline' found
> Package readline was not found in the pkg-config search path.
> Perhaps you should add the directory containing `readline.pc'
> to the PKG_CONFIG_PATH environment variable
> No package 'readline' found
> Package readline was not found in the pkg-config search path.
> Perhaps you should add the directory containing `readline.pc'
> to the PKG_CONFIG_PATH environment variable
> No package 'readline' found
> Package readline was not found in the pkg-config search path.
> Perhaps you should add the directory containing `readline.pc'
> to the PKG_CONFIG_PATH environment variable
> No package 'readline' found
> /usr/bin/ld: cannot find -lncurses
> collect2: error: ld returned 1 exit status
>
> Error: shell command terminated with non-zero exit status 256: 'gcc'
> '/home/matt/.cache/chicken-install/breadline/breadline.o' -o
> '/home/matt/.cache/chicken-install/breadline/breadline.so' -shared
> -lreadline -lncurses -L/opt/chicken/5.1.0_WW45/lib
> -Wl,-R/opt/chicken/5.1.0_WW45/lib -lchicken -lm -ldl
>    /home/matt/.cache/chicken-install/breadline/build-breadline
> -regenerate-import-libraries -setup-mode -static -I
> /home/matt/.cache/chicken-install/breadline -emit-link-file
> /home/matt/.cache/chicken-install/breadline/breadline.link -host -D
> compiling-extension -c -unit breadline -D compiling-static-extension -C
> -I/home/matt/.cache/chicken-install/breadline -O2 -d1 breadline.scm -o
> /home/matt/.cache/chicken-install/breadline/breadline.static.o
> Package readline was not found in the pkg-config search path.
> Perhaps you should add the directory containing `readline.pc'
> to the PKG_CONFIG_PATH environment variable
> No package 'readline' found
> Package readline was not found in the pkg-config search path.
> Perhaps you should add the directory containing `readline.pc'
> to the PKG_CONFIG_PATH environment variable
> No package 'readline' found
> Package readline was not found in the pkg-config search path.
> Perhaps you should add the directory containing `readline.pc'
> to the PKG_CONFIG_PATH environment variable
> No package 'readline' found
> Package readline was not found in the pkg-config search path.
> Perhaps you should add the directory containing `readline.pc'
> to the PKG_CONFIG_PATH environment variable
> No package 'readline' found
>    /opt/chicken/5.1.0_WW45/bin/csc -setup-mode -s -host -I
> /home/matt/.cache/chicken-install/breadline -C
> -I/home/matt/.cache/chicken-install/breadline -O2 -d0 breadline.import.scm
> -o /home/matt/.cache/chicken-install/breadline/breadline.import.so
>    /opt/chicken/5.1.0_WW45/bin/csc -host -D compiling-extension -J -s
> -regenerate-import-libraries -setup-mode -I
> /home/matt/.cache/chicken-install/breadline -C
> -I/home/matt/.cache/chicken-install/breadline -O2 -d1
> breadline-scheme-completion.scm -o
> /home/matt/.cache/chicken-install/breadline/breadline-scheme-completion.so
>    /opt/chicken/5.1.0_WW45/bin/csc -regenerate-import-libraries
> -setup-mode -static -I /home/matt/.cache/chicken-install/breadline
> -emit-link-file
> /home/matt/.cache/chicken-install/breadline/breadline-scheme-completion.link
> -host -D compiling-extension -c -unit breadline-scheme-completion -D
> compiling-static-extension -C -I/home/matt/.cache/chicken-install/breadline
> -O2 -d1 breadline-scheme-completion.scm -o
> /home/matt/.cache/chicken-install/breadline/breadline-scheme-completion.static.o
>    /opt/chicken/5.1.0_WW45/bin/csc -setup-mode -s -host -I
> /home/matt/.cache/chicken-install/breadline -C
> -I/home/matt/.cache/chicken-install/breadline -O2 -d0
> breadline-scheme-completion.import.scm -o
> /home/matt/.cache/chicken-install/breadline/
> breadline-scheme-completion.import.so
>   installing breadline
> install: cannot stat
> '/home/matt/.cache/chicken-install/breadline/breadline.so': No such file or
> directory
>
> Error: shell command terminated with nonzero exit code
> 256
> "sh /home/matt/.cache/chicken-install/breadline/breadline.install.sh"
>
>
>
> On Fri, Jan 31, 2020 at 12:21 AM Vasilij Schneidermann <m...@vasilij.de>
> wrote:
>
>> Hello Matt,
>>
>> > I've read the docs on linenoise and breadline but I'm not seeing how to
>> get
>> > a useful editable repl.
>> >
>> > Any pointers or suggestions would be appreciated.
>>
>> I've developed breadline.  Its wiki page has an examples section which
>> shows how to create a custom REPL for programs and points to
>> <https://github.com/wasamasa/breadline/tree/master/examples> for two
>> more examples, a `.csirc` (for your other scenario of customizing `csi`)
>> and how a simple completer can be created.
>>
>> The story is similar with linenoise, its wiki page has an example
>> section for general use and a "Using linenoise in csi" one.  Did you
>> have issues with setting either up?
>>
>> Vasilij
>>
>
>
> --
> --
> Complexity is your enemy. Any fool can make something complicated.
> It is hard to keep things simple. - Richard Branson.
>


-- 
--
Complexity is your enemy. Any fool can make something complicated.
It is hard to keep things simple. - Richard Branson.

Reply via email to