lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 16 June 2015 at 10:21, Dimitris Papavasiliou <dpapavas@gmail.com> wrote:
> I've looked into fixing most of these.  The implementation is ready but I
> haven't pushed anything yet.
>
> On 06/15/2015 08:38 PM, Brigham Toskin wrote:
>>
>> On Sun, Jun 14, 2015 at 9:05 PM, Daurnimator <quae@daurnimator.com
>> <mailto:quae@daurnimator.com>> wrote:
>>
>>        - How is it recommended to install luaprompt for different lua
>>     versions side by side?
>>          i.e. How can I switch between 5.1 and 5.3?
>>
>> I had to build luarocks from source for the different versions of lua on
>> my system, using the configure options, e.g.:
>>
>>      ./configure  --lua-version=5.1 --versioned-rocks-dir
>>
>> will configure the build for lua 5.1 (and luajit), and will sequester
>> the rocks config files under a 5.1 subdirectories. That second one is
>> necessary because when you also do 5.2 and/or 5.3, you don't want the
>> different versions clobbering each other's data. Then you make and
>> install as usual according to the instructions.
>
>
> The problem here is that the all versions will install the standalone
> interpreter under /usr/local/bin/luap, or whatever the configured prefix is,
> each one overwriting the previous.
>
> There's no graceful way to handle this with LuaRocks as far as I can tell.
> One solution is to have a separate rockfile for each version (I implemented
> and submitted a patch for version-specific overrides similar to platform
> overrides, but it won't make it into LuaRocks until the next major version,
> if then, due to compatibility concerns).  Each rockfile can then install two
> versions of the standalone script, one under the name luap-5.2, say, and one
> under luap.  The plain luap file will be overwritten, but the versioned file
> will still be available.
>
> In addition to the rockfile duplication, which is no major issue, this has
> the effect that the same file will be installed multiple times, instead of
> the usual practice of using symlinks.  I dislike that, but I can't think of
> another way.
>
>>        - Why do I need to press Ctrl+C twice to exit?
>>
>>
>> What OS are you on? For Linux, OS X, and other Unices, use Ctrl+D
>> instead. On Windows, I think it might be Ctrl+Z if you're in cmd or
>> powershell?
>
>
>
> Ctrl-D can indeed be used to quit the prompt, but the double Ctrl-C behavior
> is still erratic.  This happened when luap became a lua script instead of
> being a binary.  The Lua interpreter installs a signal handler for Ctrl-C,
> so that one can interrupt long-running commands and it interferes with luap.
>
> I've implemented a fix, which provides the usual behavior where Ctrl-C
> cancels the currently edited line and starts a fresh one.  When not editing
> a line, Ctrl-C can still be used to interrupt a long-running command.  One
> should still use Ctrl-D to quit.
>
>>        - Could you do rotating tab completion instead of only to the
>> prefix?
>>          i.e. pr<tab> might complete to 'prompt', but pressing <tab> again
>>     would change to 'print'
>
>
> See my other reply in regard to the above.
>
> D.
>
>

Thanks for the response + fixes.

Any update on the extra tab completions that are not available?
This is what I get if I try and do a tab completion with no prefix:

$ luap
Lua 5.3.0  Copyright (C) 1994-2015 Lua.org, PUC-Rio
luap 0.6 Copyright (C) 2012-2015 Dimitris Papavasiliou, Boris Nagaev
>
_               break           error           load            module
         print           setmetatable    type
_G              collectgarbage  false           loadfile        next
         prompt          socket          unpack
_VERSION        coroutine       for             loadstring      nil
         rawequal        spawn           until
_cqueues        cqueues         function        local           not
         rawget          ssl             utf8
_openssl        debug           getmetatable    lpeg
openssl         rawlen          string          while
and             dkjson          if              ltn12           or
         rawset          systemd         xpcall
arg             do              in              luatz           os
         re              table
argparse        dofile          io              lxp             p
         repeat          then
assert          else            ipairs          lxsh
package         require         tonumber
base64          elseif          lfs             math            pairs
         return          tostring
bit32           end             lgi             mime            pcall
         select          true


Many of them seem to be libraries that I have installed, but not loaded...