bug-zile
[Top][All Lists]
Advanced

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

Re: [Bug-zile] Zile Lua: Gary, please feel free to look after the branch


From: Brian Maher
Subject: Re: [Bug-zile] Zile Lua: Gary, please feel free to look after the branch for now
Date: Tue, 9 Aug 2011 06:19:28 -0700

Response is inline...

On Wed, Aug 3, 2011 at 10:50 PM, Gary V. Vaughan <address@hidden> wrote:
> Hi Brian,
>
> On 4 Aug 2011, at 11:38, Brian Maher wrote:
>> On Sat, Jul 30, 2011 at 9:58 PM, Gary V. Vaughan <address@hidden> wrote:
>>>  - replacing lrex-gnu with LPEG's re module;
>>>    Obviously this breaks emacs compatibility, but GNU regex is huge and
>>>    lrex in general is still a source of build problems for me.
>>
>> FWIW, lrex-gnu didn't build on OS X...
>
> It can be built on OS X, but you have to do it all manually from the command
> line, which is no fun at all :(

I prefer to build from the command line :)

> The trick is to manually build a libgnu.a from -fpic objects of regex.o and
> supporting files from a recent gnulib clone, extract those objects from the
> archive into the lrex_gnu directory, and then create a shared library from
> them and the objects from lrex_gnu itself.  It's painful and error prone
> but can be done.  Ping me if you'd like me to look up the recipe I used in
> my shell history.

Ya, I'm interested... perhaps you could check-in your script complete
with a curl command to download gnulib?

>> plus, I'm more comfortable with
>> the more expressive PCRE regular expression library, so I've got a
>> "hacked" (maybe 2 line change) so that my Zile (or Zee if that is what
>> we are calling the Lua version) which uses lrex-pcre.
>
> PCRE is more expressive for sure, but it is just as much of a lumbering beast
> as the gnu regex code.  Lua Zile and Lua C should remain in lockstep 
> functionality
> wise IMHO, and both of them are trying to emulate Emacs' regular expression
> functions according to the principle of least surprise.

That makes sense.

> Zee was a cut down version of C Zile hosted on sourceforge several years ago,
> and since I'm more interested in a nice editor written in and extensible in
> Lua, I thought we might create third branch in git for a Zee inspired luaish
> flavour of Zile that is not so worried about following Emacs lead...
> i.e. 'master' is C Zile, 'lua' is Lua Zile, and 'zee' would branch from 'lua'
> but replace all the elisp emulation with lua scripting, and the giant GNU
> regexp dependency with native Lua regexps, or if they turn out not to be
> powerful enough, then maybe LPEG expressions too.

IMHO, the biggest problem I've ran into with Lua regexps is the lack
of supporting "|"... I know I can work around this problem by matching
multiple regexps against the same string, but it is a PITA, especially
if you want to put a regex in a config or other places where you
expect to only specify a single regex.

>> I can't comment on using LPEG's re module since I don't have
>> experience with that, but something more like PCRE would be a welcome
>> change to me :-).
>
> On reflection, it ought not to be much of a problem to add a configure
> switch that allows Zile to use PCRE rather than GNU regexps... care to
> submit a patch?

Sure, I've attached the patch.  FWIW, I've also got a patch to make it
easier to get stack traces if zile crashes:

commit 6067dfadb0ff71ef3641691c393e1ebfef25015b
Author: Brian Maher <address@hidden>
Date:   Wed Jul 6 21:59:48 2011 -0700

    xpcall(main) so we can see lua stack traces if there is an error.

diff --git a/src/zile.lua.in b/src/zile.lua.in
old mode 100644
new mode 100755
index cbf1617..0cd3fe0
--- a/src/zile.lua.in
+++ b/src/zile.lua.in
@@ -36,4 +36,14 @@ PATH_DATA = "@pkgdatadir@"
 package.path = PATH_DATA .. "/?.lua;" .. package.path
 require "loadlua"
 ldb = require "ldb"
-main ()
+
+
+local function err(err)
+    curses.endwin()
+    print("Internal error.  Please report this bug with steps to
reproduce the problem")
+    print(debug.traceback(err, 2))
+end
+
+if xpcall(main, err) then
+    curses.endwin()
+end

Thanks,
-Brian

>
> Cheers,
> --
> Gary V. Vaughan (gary AT gnu DOT org)



-- 
Brian Maher >> Glory to God <<

Attachment: rex_pcre.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]