[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: PATCH: Lua 5.1 advanced readline support
- From: Mike Pall <mikelu-0602@...>
- Date: Sat, 18 Feb 2006 14:03:00 +0100
Hi,
I've updated my patch for Lua 5.1. Here is the download link:
http://luajit.luaforge.net/patches/lua-5.1-advanced-readline.patch
Advanced readline support
-------------------------
This patch adds the following features to the existing readline support
in Lua 5.x:
- Completion of keywords and global variable names.
- Recursive and metatable-aware completion of variable names.
- Context sensitive delimiter completion.
- Save/restore of the history to/from a file (LUA_HISTORY env variable).
- Setting a limit for the size of the history (LUA_HISTSIZE env variable).
- Setting the app name to allow for $if lua ... $endif in ~/.inputrc.
It has been verified to work with Lua 5.0, 5.0.2, 5.1 and GNU
readline 2.2.1, 4.0, 4.3, 5.0, 5.1 (caveat: under GPL, not LGPL)
or NETBSD libedit 2.6.5, 2.6.9 (BSD license).
These libraries require a POSIX environment and are already
installed on most open source operating systems (Linux, *BSD).
You need to modify src/Makefile for Mac OS X (10.4 or later).
Windows is only supported via Cygwin (untested).
After applying the patch start lua and try these (replace ~ with
the TAB key):
~~
fu~foo() ret~fa~end<CR>
io~~~s~~~o~~~w~"foo\n")<CR>
The ~~ are just for demonstration purposes (io~s~o~w~ suffices, of course).
If you are used to zsh/tcsh-style completion support, try adding
'TAB: menu-complete' and 'C-d: possible-completions' to your ~/.inputrc.
I've also updated:
http://lua-users.org/wiki/LuaPowerPatches
And the old patch against Lua 5.0 is still available, too:
http://luajit.luaforge.net/patches/lua-5.0-advanced-readline.patch
Bye,
Mike