From: bradb
Subject: Newbie with some GUI questions
Date: 
Message-ID: <1129911553.935695.185810@f14g2000cwb.googlegroups.com>
Hi all, I searched the list & found a few tidbits of GUI info, but a
lot of it seemed old.  So I thought that I'd ask the question again and
see if things had changed
I am learning Lisp & would like to build a very simple text editor.
Initially I looked at ncurses & got something simple going, but
developing with that was a bit of a pain because the editor ran in the
same console window as the Lisp REPL & when it crashed the REPL window
would be screwed up.
But using ncurses is not very Lispy & mostly this little editor project
is so I can learn Lisp.
I found McClim, which looks pretty cool from a glance over the docs,
and various bindings for GTK (gtk-cells, lambda-gtk, etc)

My requirements are pretty simple, I just need a single window that can
be split into multiple panes that contain text.

My questions
1) Which GUI is the easiest to get up and running with?  (I am using
SBCL on Linux)
2) Which GUI is the "most Lispy"
3) Which is the easiest to do something useful with?

Thanks
Brad

From: vishnuvyas
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <1129916297.454048.309490@z14g2000cwz.googlegroups.com>
> 1) Which GUI is the easiest to get up and running with?  (I am using
>SBCL on Linux)
>2) Which GUI is the "most Lispy"
>3) Which is the easiest to do something useful with?

Have you tried LTK?
http://www.peter-herth.de/ltk/
That answers your question 1.

cheers
Vishnu
From: Thomas F. Burdick
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <xcvirvqd6dq.fsf@conquest.OCF.Berkeley.EDU>
"vishnuvyas" <··········@gmail.com> writes:

> > 1) Which GUI is the easiest to get up and running with?  (I am using
> >SBCL on Linux)
> >2) Which GUI is the "most Lispy"
> >3) Which is the easiest to do something useful with?
> 
> Have you tried LTK?
> http://www.peter-herth.de/ltk/
> That answers your question 1.

I'd second this recommendation.  It's the perfect answer to numbers 1
and 3.  It's not the most Lispy, but it's Lispy enough to stay out of
your way and let you get things done.  Just type:

  (require :asdf-install)
  (asdf-install:install :ltk)

and you have it.  Peter's improved the documentation recently, so you
don't really need to look at the Tk documentation anymore.  Between
that and the examples in ltk.lisp, you should be back to worrying
about your application logic after an hour or two.

-- 
           /|_     .-----------------------.                        
         ,'  .\  / | Free Mumia Abu-Jamal! |
     ,--'    _,'   | Abolish the racist    |
    /       /      | death penalty!        |
   (   -.  |       `-----------------------'
   |     ) |                               
  (`-.  '--.)                              
   `. )----'                               
From: Tayssir John Gabbour
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <1130006624.663376.211820@g44g2000cwa.googlegroups.com>
Thomas F. Burdick wrote:
> "vishnuvyas" <··········@gmail.com> writes:
> > > 1) Which GUI is the easiest to get up and running with?  (I am using
> > >SBCL on Linux)
> > >2) Which GUI is the "most Lispy"
> > >3) Which is the easiest to do something useful with?
> >
> > Have you tried LTK?
> > http://www.peter-herth.de/ltk/
> > That answers your question 1.
>
> I'd second this recommendation.  It's the perfect answer to numbers 1
> and 3.  It's not the most Lispy, but it's Lispy enough to stay out of
> your way and let you get things done.  Just type:
>
>   (require :asdf-install)
>   (asdf-install:install :ltk)
>
> and you have it.  Peter's improved the documentation recently, so you
> don't really need to look at the Tk documentation anymore.  Between
> that and the examples in ltk.lisp, you should be back to worrying
> about your application logic after an hour or two.

I agree that LTK is pretty cool.. but was the mysterious showstopper
fixed where it completely fails to run depending on what programs are
running?

If not, absolutely fine, but then every recommendation probably needs
to point that out. Because it's extremely difficult to detect unless
you're "lucky" enough for it to not work on one of your machines. And
it doesn't seem mentioned in the docs or website.

Tayssir
From: Peter Herth
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <dje2lt$38t$00$1@news.t-online.com>
Tayssir John Gabbour wrote:

> I agree that LTK is pretty cool.. but was the mysterious showstopper
> fixed where it completely fails to run depending on what programs are
> running?

There is no mysterious showstopper. Ltk works absolutely reliably on
all unix platforms I encountered (Mac OS X, Solaris,  Linux). However,
there are some problem reports concerning Windows. I have documented
the reports that reached me in the troubleshooting.txt provided with
the Ltk tarball. But unless someone donates a windows box to me or
volunteers to help to track the issue down, windows certainly is
to be cathegorized under YMMW. Notice though, that some troublemakers
are known (AOL, certain tray programs) and when disabled, Ltk runs
flawlessly there.

> If not, absolutely fine, but then every recommendation probably needs
> to point that out. Because it's extremely difficult to detect unless
> you're "lucky" enough for it to not work on one of your machines. And
> it doesn't seem mentioned in the docs or website.

As I said, there is no "luck" involved on sane platforms, and since
the original poster mentioned that he was running Linux, there is
absolutely no reason, that Ltk doesn't work for him.

Peter

-- 
Ltk, the easy lisp gui http://www.peter-herth.de/ltk/
From: Tayssir John Gabbour
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <1130014664.840334.186230@g49g2000cwa.googlegroups.com>
Peter Herth wrote:
> Tayssir John Gabbour wrote:
> > I agree that LTK is pretty cool.. but was the mysterious showstopper
> > fixed where it completely fails to run depending on what programs are
> > running?
>
> There is no mysterious showstopper. Ltk works absolutely reliably on
> all unix platforms I encountered (Mac OS X, Solaris,  Linux). However,
> there are some problem reports concerning Windows. I have documented
> the reports that reached me in the troubleshooting.txt provided with
> the Ltk tarball.

Do you happen to remember any freely-downloadable tray programs which
exhibits this problem? I don't use AOL and would like to try hunting
this issue down again.

Maybe I'm totally blind but I don't see troubleshooting.txt in either
of the following releases on the LTK site:
http://www.peter-herth.de/ltk/ltk-0.8.7.tgz
http://www.peter-herth.de/ltk/ltk-0.8786.tgz


> As I said, there is no "luck" involved on sane platforms

I wish other platforms were much saner than Windows. ;)

They seem to have much more in common than differences... But I like
using my Mac OS X and Ubuntu machines more than Win2k, I think.


Tayssir
From: Edi Weitz
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <uy84lp7ic.fsf@agharta.de>
On 22 Oct 2005 13:57:44 -0700, "Tayssir John Gabbour" <···········@yahoo.com> wrote:

> Do you happen to remember any freely-downloadable tray programs
> which exhibits this problem? I don't use AOL and would like to try
> hunting this issue down again.

I seem to remember that the Babylon tray app was one of the culprits.
It's not free but you can probably get a trial version that lasts long
enough to identify the problem.

> Maybe I'm totally blind but I don't see troubleshooting.txt in
> either of the following releases on the LTK site:
> http://www.peter-herth.de/ltk/ltk-0.8.7.tgz
> http://www.peter-herth.de/ltk/ltk-0.8786.tgz

I don't see it either.

Cheers,
Edi.

-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: Peter Herth
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <djed0h$28h$04$1@news.t-online.com>
Tayssir John Gabbour wrote:

> Do you happen to remember any freely-downloadable tray programs which
> exhibits this problem? I don't use AOL and would like to try hunting
> this issue down again.

Hey, it was you from whom I got the report about AOL..., besides that,
I have "Babylon" and "The Wonderful Icon" on record as troublemakers.

> Maybe I'm totally blind but I don't see troubleshooting.txt in either
> of the following releases on the LTK site:
> http://www.peter-herth.de/ltk/ltk-0.8.7.tgz
> http://www.peter-herth.de/ltk/ltk-0.8786.tgz

I only checked my uploading script - its listed there. But I have not
updated the official Ltk release for a while - too many distractions.
So before any more Lisp user gets hurt by Ltk, here is a copy:

========
Known issues with using Ltk:

Windows

It seems to be impossilbe to use Ltk while internet via AOL is active.
Similiarly, some programs that hook into the system (like tray utilities)
seem to hinder Ltk. (Ltk needs pipes to communicate with the Tk process,
so programs fiddling with low level operations may influence that)

  List of programs, which can prevent Ltk from running:

  o babylon
  o The Wonderful Icon


Mac OS X

In general TkAqua runs very nicely and behaves very well as a
native program should, using Aqua widgets and even putting the
menues in the Mac menu bar. Only caveat with TkAqua is, that
the screen updates only in intervals, so programs which require
very fast interactions with the user seem laggy (cpu usage is
still very low, so I assume it has something to do with the
update frequency). A way to mostly remedy the problem is
to use the X11 Tk (which looks as old-fashioned as every
Unix Tk does, but has faster response times. It can be
installed via Fink. To use it, the lisp program only needs
to set *wish-pathname* to /sw/bin/wish. You might need
to put export DISPLAY=:0.0 into your .bashrc.

========



-- 
Ltk, the easy lisp gui http://www.peter-herth.de/ltk/
From: bradb
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <1130024062.778427.140120@g44g2000cwa.googlegroups.com>
I've just started playing with Ltk - it looks really pretty nice.  So
I'm going to run with it for a while & see how things turn out.

Thanks for the input
Brad
From: Peter Herth
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <djfdif$u8g$00$1@news.t-online.com>
bradb wrote:
> I've just started playing with Ltk - it looks really pretty nice.  So
> I'm going to run with it for a while & see how things turn out.

And please, whenever you run into troubles, drop me an email (use the 
address on the Ltk page).

Peter

-- 
Ltk, the easy lisp gui http://www.peter-herth.de/ltk/
From: bradb
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <1130136043.684883.248030@f14g2000cwb.googlegroups.com>
Peter Herth wrote:
> And please, whenever you run into troubles, drop me an email (use the
> address on the Ltk page).
Thanks - you probably shouldn't have offered that! :)
A couple of Tk-ish questions that hopefully you can help with

1) What is a good efficient way of displaying text?  Currently I am
creating a canvas & then I output my text line at a time, each line
being a new text widget.  There is a function on top of this that wraps
lines for me.  Each redraw I clear the canvas & start again.  Is this
horribly bad?  So far it looks OK, even for large text, but if there is
an easier/better way it would be nice to know.

2) How do I display a text cursor?  I see lots of mention of
insert/on/off/time/width but can't get anything working - am I missing
something here?  Should I just make my own cursor?

If this is too far off topic, please let me know.

Thanks
Brad
From: Peter Herth
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <djjdaa$fn0$02$1@news.t-online.com>
bradb wrote:
> Peter Herth wrote:
> 
>>And please, whenever you run into troubles, drop me an email (use the
>>address on the Ltk page).
> 
> Thanks - you probably shouldn't have offered that! :)
> A couple of Tk-ish questions that hopefully you can help with
> 
> 1) What is a good efficient way of displaying text?  Currently I am
> creating a canvas & then I output my text line at a time, each line
> being a new text widget.  There is a function on top of this that wraps
> lines for me.  Each redraw I clear the canvas & start again.  Is this
> horribly bad?  So far it looks OK, even for large text, but if there is
> an easier/better way it would be nice to know.
> 
> 2) How do I display a text cursor?  I see lots of mention of
> insert/on/off/time/width but can't get anything working - am I missing
> something here?  Should I just make my own cursor?
> 

What about using the "text" widget? :p
It is a very powerful text displaying/editing widget. Each text you 
append to the widget can be given a tag, and via tag-configure for each 
such used tag, the font, color and all other conceivable attributes can
be customized. Furthermore, you can insert other widgets and even images 
into the text widget. To set a cursor for a widget, use
(configure widget :cursor :clock)
if you want to set a clock style cursor, for all portably supported 
options, check the value of *cursors*.

Peter


-- 
Ltk, the easy lisp gui http://www.peter-herth.de/ltk/
From: bradb
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <1130183968.572247.55830@g44g2000cwa.googlegroups.com>
Peter Herth wrote:

> What about using the "text" widget? :p
Ah! :)  Does the text widget allow me to trap keypresses before they
get displayed on the screen?  Athough that may actually not matter
anyhow...
Perhaps I should play with the text widget some more - as I said I'm
just using it as a dumb display widget right now.

> It is a very powerful text displaying/editing widget. Each text you
> append to the widget can be given a tag, and via tag-configure for each
> such used tag, the font, color and all other conceivable attributes can
> be customized. Furthermore, you can insert other widgets and even images
> into the text widget. To set a cursor for a widget, use
> (configure widget :cursor :clock)
> if you want to set a clock style cursor, for all portably supported
> options, check the value of *cursors*.
Are you talking about mouse cursors here?  I am wanting to place a text
cursor, the flashy line/block where text will be inserted.

Cheers
Brad
From: Peter Herth
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <djocnh$39r$01$1@news.t-online.com>
bradb wrote:
> Peter Herth wrote:
> 
> 
>>What about using the "text" widget? :p
> 
> Ah! :)  Does the text widget allow me to trap keypresses before they
> get displayed on the screen?  Athough that may actually not matter
> anyhow...
> Perhaps I should play with the text widget some more - as I said I'm
> just using it as a dumb display widget right now.

Yes, you should be able to bind keypress events. (Haven't tried it yet, 
but I don't see any reason why this shouln't work).

> Are you talking about mouse cursors here?  I am wanting to place a text
> cursor, the flashy line/block where text will be inserted.

Yes, sorry, I misread your question. To modify the insertion cursor, try
the insertwidth (width of the insert cursor) and insertborderwidth 
(width of its 3d border) properties via configure.

Peter


-- 
Ltk, the easy lisp gui http://www.peter-herth.de/ltk/
From: bradb
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <1130349791.334714.209350@g43g2000cwa.googlegroups.com>
I had a bit of a play with the text widget, it looks extremely
powerful.  At the moment the path of least resistance appears to be
using a canvas & inserting text items onto it.  I'll probably move to a
the text widget when I learn Ltk a little better & run into limitations
of the dumb canvas system I currently have.  On the upside, I can
currently display text & capture keypresses :)
One thing I have noticed though is: I want to load a file to my window,
in order to display text on a canvas I manually implement line wrapping
- which you need the canvas width & height for.  To get the width &
height you need the window open.
So I need to register an event to fire after (main-loop) is called, but
the usual suspects (Configure, etc) appear to not work.  At the moment
I am calling (after 1000 full-redraw) to display my loaded file.  Any
tips on how to do this better?

Thanks
Brad
From: Peter Herth
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <djonak$mq9$00$1@news.t-online.com>
bradb wrote:
> I had a bit of a play with the text widget, it looks extremely
> powerful.  At the moment the path of least resistance appears to be
> using a canvas & inserting text items onto it.  I'll probably move to a
> the text widget when I learn Ltk a little better & run into limitations
> of the dumb canvas system I currently have.  On the upside, I can
> currently display text & capture keypresses :)
> One thing I have noticed though is: I want to load a file to my window,
> in order to display text on a canvas I manually implement line wrapping
> - which you need the canvas width & height for.  To get the width &
> height you need the window open.
> So I need to register an event to fire after (main-loop) is called, but
> the usual suspects (Configure, etc) appear to not work.  At the moment
> I am calling (after 1000 full-redraw) to display my loaded file.  Any
> tips on how to do this better?

I had the same kind of problem, and after is really your friend in this
case. Besides (after 1000...) you might try after-idle, which fires when
Tk has done everything else on schedule.

Peter

-- 
Ltk, the easy lisp gui http://www.peter-herth.de/ltk/
From: bradb
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <1130357841.607676.236280@g49g2000cwa.googlegroups.com>
I think that I tried after-idle (am at work right now, but I'll check
at home later) and found that SBCL started frantically GCing.  When I
close the window the REPL fills with something like
Postponing event : NIL
and I need to abort it.  I didn't mess with (after-idle) very much so I
am possibly missing something obvious.
I'll probably look at it more tonight.

Brad
From: ··············@hotmail.com
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <1129919756.676941.279410@f14g2000cwb.googlegroups.com>
bradb wrote:

> I am learning Lisp & would like to build a very simple text editor.

This seems like an exceedingly strange task for learning Lisp. Can you
be a little clearer about your goals?

Is it to put a text-editing widget up on the screen that follows the
standards of your platform of choice, and capture the text within? Or
is it to implement the infrastructure for the editing of text? I.e. the
data structures and methods needed to take raw GUI events and update a
display?

Is this something you have done or believe you could do quickly in some
other language environment?

> Initially I looked at ncurses & got something simple going, but
> developing with that was a bit of a pain because the editor ran in the
> same console window as the Lisp REPL & when it crashed the REPL window
> would be screwed up.
> But using ncurses is not very Lispy & mostly this little editor project
> is so I can learn Lisp.

I'm not familiar with ncurses, but how would you go about separating
the display from, say, output to stderr in a C program? Would something
like http://www.vexus.ca/CDK.html help?
From: bradb
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <1129920823.600532.50150@f14g2000cwb.googlegroups.com>
··············@hotmail.com wrote:
> This seems like an exceedingly strange task for learning Lisp. Can you
> be a little clearer about your goals?
Well the _main_ goal is really just to get some experiance coding in
Lisp.  The secondary goal, if this goes beyond a learning exercise, is
to create a Vi like editor that has close integration with Lisp.
Ultimately it would be nice to have a Vi-like editor that is useful as
a Lisp IDE.

> Is it to put a text-editing widget up on the screen that follows the
> standards of your platform of choice, and capture the text within? Or
> is it to implement the infrastructure for the editing of text? I.e. the
> data structures and methods needed to take raw GUI events and update a
> display?
I would like to write a full editor, not just a simple widget.

>
> Is this something you have done or believe you could do quickly in some
> other language environment?
Nope :)  I'm learning Lisp, and I like Vim.  I think it would be cool
to have a Vim clone that works nicely with Lisp.

>
> > Initially I looked at ncurses & got something simple going, but
> > developing with that was a bit of a pain because the editor ran in the
> > same console window as the Lisp REPL & when it crashed the REPL window
> > would be screwed up.
> > But using ncurses is not very Lispy & mostly this little editor project
> > is so I can learn Lisp.
>
> I'm not familiar with ncurses, but how would you go about separating
> the display from, say, output to stderr in a C program? Would something
> like http://www.vexus.ca/CDK.html help?
Perhaps.  Vim is a very plain editor in terms of display & really
doesn't have very sophisticated widgets - basically just multiple pane
support within a window.  I suspect that CDK implements widgets like
menus & buttons on a text interface, I don't really need those widgets.

Thanks
Brad
From: ··············@hotmail.com
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <1129933479.485078.213730@f14g2000cwb.googlegroups.com>
bradb wrote:
> ··············@hotmail.com wrote:
> > This seems like an exceedingly strange task for learning Lisp. Can you
> > be a little clearer about your goals?
> Well the _main_ goal is really just to get some experiance coding in
> Lisp.  The secondary goal, if this goes beyond a learning exercise, is
> to create a Vi like editor that has close integration with Lisp.
> Ultimately it would be nice to have a Vi-like editor that is useful as
> a Lisp IDE.

I think that's relatively clear.

> Nope :)  I'm learning Lisp, and I like Vim.  I think it would be cool
> to have a Vim clone that works nicely with Lisp.

How about emacs's viper-mode? :-)

> >
> > > Initially I looked at ncurses & got something simple going, but
> > > developing with that was a bit of a pain because the editor ran in the
> > > same console window as the Lisp REPL & when it crashed the REPL window
> > > would be screwed up.

I think the main thing to realize is that a vi-type editor is a program
which takes keypresses (or a character stream) as input and produces
display events (i.e. ncurses calls) as output.

The only tricky thing is to create such a connection in a way that
preserves the interactivity. I'm not enough of a UNIX expert to give
much advice, but it shouldn't be too hard to puzzle out.

One possibility for development is to either do the editing or
debugging over a socket connection.

 The Common Lisp variables *debug-io*, *error-io*, and *trace-output*,
should be bindable to other sockets, which you can connect to from
different xterms or whatever. That should shut up your implementation.
*query-io* should be quiet if you avoid calling routines that use it.

  Or, you can have your Common Lisp vim-clone connect to a socket which
you connect to from a separate terminal as desired. You can rebind
*standard-input* and *standard-output* to the appropriate streams, so
your ncurses activity will go to those points. There are probably some
tricky details here, where your implementation runtime & socket
implementations meets Unix terminal stuff & file descriptors being used
by ncurses.
From: bradb
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <1129934735.975688.23910@z14g2000cwz.googlegroups.com>
··············@hotmail.com wrote:

> How about emacs's viper-mode? :-)
:)
I actually did try this, and I wanted to also use Slime, but
 1 - Emacs is heavy weight (which is why ncurses would be nice to use)
 2 - Viper emulates closer to Vi, and is pretty broken on my default
Ubuntu install
 3 - Slime + Viper is painful because the slime mode keys are in line
with the Emacs multiple keypress philosophy.

> I think the main thing to realize is that a vi-type editor is a program
> which takes keypresses (or a character stream) as input and produces
> display events (i.e. ncurses calls) as output.
>
> The only tricky thing is to create such a connection in a way that
> preserves the interactivity. I'm not enough of a UNIX expert to give
> much advice, but it shouldn't be too hard to puzzle out.
That is a good idea, and as mentioned Clisp supports exactly that - I
may need to look at the Clisp implementation & steal it.  If I can get
a nice terminal window open, perhaps I should go that way.  Though I am
sure there will be devils in the details :)

Thanks
Brad
From: jonathon
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <1130204718.008219.297330@g44g2000cwa.googlegroups.com>
Brad, if you get a decent IDE that uses VIM-like commands, please keep
up the good work and post it here!

I had finally given up on Xemacs when I found Lisp, and I refuse to go
back just for one language tool.

More power to you!
From: Robert Uhl
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <m3wtk15lgj.fsf@4dv.net>
"bradb" <··············@gmail.com> writes:
>
>  1 - Emacs is heavy weight (which is why ncurses would be nice to use)

  emacs -nw

This will start emacs in ncurses mode, like vim.  Actually, I don't know
if it internally uses ncurses, but the effect is the same: a
character-cell interface.

>  3 - Slime + Viper is painful because the slime mode keys are in line
> with the Emacs multiple keypress philosophy.

  M-x h f global-set-key
  M-x h f define-key

You can rebind the keys however you like:-)

-- 
Robert Uhl <http://public.xdi.org/=ruhl>
The mome rath isn't born that could outgrabe me.  --Nicol Williamson
From: David Steuber
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <877jc0zzuc.fsf@david-steuber.com>
Robert Uhl <·········@NOSPAMgmail.com> writes:

> "bradb" <··············@gmail.com> writes:
> >
> >  1 - Emacs is heavy weight (which is why ncurses would be nice to use)
> 
>   emacs -nw
> 
> This will start emacs in ncurses mode, like vim.  Actually, I don't know
> if it internally uses ncurses, but the effect is the same: a
> character-cell interface.

It still takes Emacs considerably longer to start up than vim.  When I
run Emacs remotely I do it in -nw mode because X11 is not so light
weight either, especially from 16 internet hops away.

Vim is great for quick edits of /etc files and even programming in
Perl or C.  But I would never use it for Lisp.  SLIME doesn't seem to
support vim very well ;-)

-- 
http://www.david-steuber.com/
The UnBlog: An island of conformity in a sea of quirks.
The lowest click through rate in Google's AdSense program.
----------------------------------------------------------------------
From: bradb
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <1130308520.753644.133340@g47g2000cwa.googlegroups.com>
David Steuber wrote:

> Vim is great for quick edits of /etc files and even programming in
> Perl or C.  But I would never use it for Lisp.  SLIME doesn't seem to
> support vim very well ;-)

I generally use Vim for everything :)  It appears that my mindset just
works well with Vim - I have tried Emacs, but never got to be useful
with it.
Since starting this little project I've been thinking a lot about how I
edit code.  If I can get to the Useful Editor stage with my code then I
have a number of ideas I'd like to try and implement - mostly small
stuff but would probably make me faster at browsing/editing code.

Brad
From: Robert Uhl
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <m3y84g2gnt.fsf@4dv.net>
"bradb" <··············@gmail.com> writes:
>
> I generally use Vim for everything :) It appears that my mindset just
> works well with Vim - I have tried Emacs, but never got to be useful
> with it.

I used to be exactly there.  I used vi, it worked for me and I saw no
reason to use emacs.  But eventually I saw that an awful lot of smart
folks were using emacs, and figured that I might try to learn it
properly.  To make a very long story overly short, I could never go back
now.

There's a fair amount of mindset changing--e.g. one doesn't open a file
in emacs, close emacs, do something else, fire up emacs again, close it,
go on and do something else; rather, one lives within emacs the entire
time.

Don't let that discourage you from writing a text editor.  It should be
a very fun little exercise--and who knows, you might end up creating an
emacs for the vi crowd:-)

-- 
Robert Uhl <http://public.xdi.org/=ruhl>
Man, the creature who knows he must die, who has dreams larger than his
destiny, who is forever working a confidence trick on himself, needs an
ally.  Mine has been tobacco.                  --John Boynton Priestley
From: Greg Menke
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <m3irvkvxaz.fsf@athena.pienet>
Robert Uhl <·········@NOSPAMgmail.com> writes:

> "bradb" <··············@gmail.com> writes:
> >
> 
> Don't let that discourage you from writing a text editor.  It should be
> a very fun little exercise--and who knows, you might end up creating an
> emacs for the vi crowd:-)
> 

Thats a tough job though- you'll first have to get them to stop
correcting typos by painting whiteout on the monitor screen...

;)

Gregm
From: bradb
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <1130359369.773386.59310@g43g2000cwa.googlegroups.com>
Haha!  Although I didn't actually google your name, you've come up
before in a Vi/Emacs war -
http://www.newsforge.com/article.pl?sid=01/12/04/0326236 :)
I'll admit that I am probably stupid not using Emacs & Slime - but hey
you can only lead a horse to water, right :)
If I do manage to code up anything useful, I'll personally buy screen
cleaner for any vi user that needs it!

Brad
From: Greg Menke
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <m3br1bhq8i.fsf@athena.pienet>
"bradb" <··············@gmail.com> writes:

> Haha!  Although I didn't actually google your name, you've come up
> before in a Vi/Emacs war -

Well somebody's got to keep the whips swinging... ;)


> http://www.newsforge.com/article.pl?sid=01/12/04/0326236 :)
> I'll admit that I am probably stupid not using Emacs & Slime - but hey
> you can only lead a horse to water, right :)
>
> If I do manage to code up anything useful, I'll personally buy screen
> cleaner for any vi user that needs it!

As far as I'm concerned if you're writing it, do it up however you like,
I'm totally in favor of editors and/or text boxes written with Lisp.

But do go easy on the vi people, be sure to include the "beep" and the
"beep and mess up text" modes, it'll make them feel more comfortable.

:)

Gregm
From: Surendra Singhi
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <acgv7s46.fsf@netscape.net>
"bradb" <··············@gmail.com> writes:

> David Steuber wrote:
>
>> Vim is great for quick edits of /etc files and even programming in
>> Perl or C.  But I would never use it for Lisp.  SLIME doesn't seem to
>> support vim very well ;-)
>
> I generally use Vim for everything :)  It appears that my mindset just
> works well with Vim - I have tried Emacs, but never got to be useful
> with it.

I think [X]Emacs has a viper or vi mode, you can try that.

-- 
Surendra Singhi
http://www.public.asu.edu/~sksinghi/index.html

The best-laid plans of mice and men go oft astray.
From: Rob Warnock
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <8t2dne4XEsgbAP3enZ2dnUVZ_smdnZ2d@speakeasy.net>
Surendra Singhi  <·········@netscape.net> wrote:
+---------------
| I think [X]Emacs has a viper or vi mode, you can try that.
+---------------

The problem I've had with [X]Emacs (the several times I tried to
use it) is that the vi-like modes are all *major* modes, suitable
only for editing plaintext. As soon as you want to edit, say, Lisp,
you enter "Lisp mode" and you *lose* the vi-like behavior entirely.

That is, "vi mode" needs to be a *mixin*, not a major mode itself!


-Rob

-----
Rob Warnock			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607
From: Robert Uhl
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <m3pspqsjug.fsf@4dv.net>
····@rpw3.org (Rob Warnock) writes:
>
> The problem I've had with [X]Emacs (the several times I tried to use
> it) is that the vi-like modes are all *major* modes, suitable only for
> editing plaintext. As soon as you want to edit, say, Lisp, you enter
> "Lisp mode" and you *lose* the vi-like behavior entirely.
>
> That is, "vi mode" needs to be a *mixin*, not a major mode itself!

Yeah, but it really wouldn't work so well as a minor mode--most of the
SLIME orlisp-mode bindings would conflict or just be weird in vi-mode.
You can configure emacs to use viper for everything and not use
lisp-mode or slime-mode.

-- 
Robert Uhl <http://public.xdi.org/=ruhl>
Love wouldn't be blind if the braille wasn't so damned much fun.
                                             --Armistead Maupin
From: Tim Lavoie
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <dtu433-6hi.ln1@theasylum.dyndns.org>
On 2005-10-26, David Steuber <·····@david-steuber.com> wrote:
> Robert Uhl <·········@NOSPAMgmail.com> writes:
>
>> "bradb" <··············@gmail.com> writes:
>> >
>> >  1 - Emacs is heavy weight (which is why ncurses would be nice to use)
>> 
>>   emacs -nw
>> 
>> This will start emacs in ncurses mode, like vim.  Actually, I don't know
>> if it internally uses ncurses, but the effect is the same: a
>> character-cell interface.
>
> It still takes Emacs considerably longer to start up than vim.  When I
> run Emacs remotely I do it in -nw mode because X11 is not so light
> weight either, especially from 16 internet hops away.
>
> Vim is great for quick edits of /etc files and even programming in
> Perl or C.  But I would never use it for Lisp.  SLIME doesn't seem to
> support vim very well ;-)

Emacs can be quick for small edits too, if you are willig to leave it
running. Start XEmacs once, and have the EDITOR variable set to
'gnuclient -nw'. You might still use vim for tasks which require you
to su first, such as editing those /etc files.
From: Ivan Boldyrev
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <ndf733-kbu.ln1@ibhome.cgitftp.uiggm.nsc.ru>
On 9275 day of my life Tim Lavoie wrote:
> 'gnuclient -nw'. You might still use vim for tasks which require you
> to su first, such as editing those /etc files.

Or use Tramp <http://savannah.nongnu.org/projects/tramp/> :)

-- 
Ivan Boldyrev

       Assembly of a Japanese bicycle requires greatest peace of spirit.
From: GP lisper
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <1130015037.1f3878f24c7dac4637c0976eeec82471@teranews>
On 21 Oct 2005 11:35:56 -0700, <············@gmail.com> wrote:
>
> bradb wrote:
>
>> I am learning Lisp & would like to build a very simple text editor.
>
> This seems like an exceedingly strange task for learning Lisp. Can you
> be a little clearer about your goals?

It's a troll.

Anyone sane would use emacs+slime and not reinvent the wheel, and a
big wheel at that.  It's hard to miss the clim based emacs replacement
project too.

-- 
If you don't like LOOP, how do you feel about DOLIST ?
From: bradb
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <1130021209.350224.174010@f14g2000cwb.googlegroups.com>
GP lisper wrote:
> It's a troll.
>
> Anyone sane would use emacs+slime and not reinvent the wheel, and a
> big wheel at that.  It's hard to miss the clim based emacs replacement
> project too.
>

What the hell???
What trollish things did I specifically say?  I state quite clearly
that I am learning Lisp, that I had already searched for GUI stuff &
found some answers but they were a bit old.
I state that I am learning Lisp, and this is a little project that I
can play with while learning.  I did not say I wanted to re-invent the
wheel - my code will probably never see the light of day.
I'm also quite sane - even to the point of not finding trolls in every
post I read - I just happen to prefer Vi style editors, which means
that Slime+Emacs is not a comfortable solution for me.  But lets not
start a Vi/Emacs thing - that is something that I wanted to avoid from
the beginning as I know how thin skinned some people are about their
editors.
And I didn't miss Climacs, I've even talked to those guys, but
generating a Vim-clone frontend for Climacs is not what I want to do
right now.

So in short, if you can't be bothered posting something constructive,
don't bother at all.

Brad

PS - if every new Lisper got this kind of message early in their
learning it would be very easy to get turned off from a language.  The
community around a language goes a long way to whether or not you will
be willing to try and learn the it.
From: Christophe Rhodes
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <sqek6cfuuo.fsf@cam.ac.uk>
"bradb" <··············@gmail.com> writes:

> PS - if every new Lisper got this kind of message early in their
> learning it would be very easy to get turned off from a language.  The
> community around a language goes a long way to whether or not you will
> be willing to try and learn the it.

Yeah.  Do not judge the various pockets of lisp communities by what
you see on comp.lang.lisp, where there are few checks and balances on
antisocial behaviour or incorrect information.

Christophe
From: Cameron MacKinnon
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <fYWdnX2I0K1mLcfenZ2dnUVZ_s2dnZ2d@rogers.com>
GP lisper wrote:
> On 21 Oct 2005 11:35:56 -0700, <············@gmail.com> wrote:
> 
>>bradb wrote:
>>
>>
>>>I am learning Lisp & would like to build a very simple text editor.
>>
>>This seems like an exceedingly strange task for learning Lisp. Can you
>>be a little clearer about your goals?

Back in the day (WAAAY back), building a simple text editor was a fairly 
common programming exercise. Text editors manipulate lists. Lisp 
manipulates (among other things) lists, and better than most other 
languages. The text editor which arouses the most passion in programmers 
is written in Lisp, and happens to be the most successful (in terms of 
user base) Lisp application ever. If you can do a text editor in a GUI 
environment, you can probably do anything, and if you can't do a GUI 
text editor, you probably can't do a GUI anything. Design Patterns (a CS 
bestseller, like it or not) devotes 45 pages to its only case study... a 
document editor.

> It's a troll.
> 
> Anyone sane would use emacs+slime and not reinvent the wheel, and a
> big wheel at that.  It's hard to miss the clim based emacs replacement
> project too.

The OP did NOT say that all editors sucked and therefore he wanted to 
write his own. Few people have the brains to do original work while 
learning a language; the majority spend time reinventing wheels as 
learning exercises, just as in any other craft.

And finally, what's with the recent inevitability of every 
non-obsequious post here eventually being labelled a troll? In my book, 
questions with hard or embarassing answers aren't automatically trolls 
(not that the OP fell into that category). Further, anyone who thinks 
"That guy's a troll, but I didn't fall for it because -- IN MY FOLLOWUP 
POST -- I clearly pointed out that he was a troll" doesn't understand 
the Zen of the troll.
From: ··············@hotmail.com
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <1130188155.833887.320590@g47g2000cwa.googlegroups.com>
Cameron MacKinnon wrote:
> > On 21 Oct 2005 11:35:56 -0700, <············@gmail.com> wrote:
> >
> >>bradb wrote:
> >>
> >>
> >>>I am learning Lisp & would like to build a very simple text editor.
> >>
> >>This seems like an exceedingly strange task for learning Lisp. Can you
> >>be a little clearer about your goals?
>
> Back in the day (WAAAY back), building a simple text editor was a fairly
> common programming exercise. Text editors manipulate lists. Lisp
> manipulates (among other things) lists, and better than most other
> languages. The text editor which arouses the most passion in programmers
> is written in Lisp, and happens to be the most successful (in terms of
> user base) Lisp application ever. If you can do a text editor in a GUI
> environment, you can probably do anything, and if you can't do a GUI
> text editor, you probably can't do a GUI anything. Design Patterns (a CS
> bestseller, like it or not) devotes 45 pages to its only case study... a
> document editor.

I see your point (and, just to be clear, *I* don't consider the
original guy a troll). In-this-day-and-age, though, any environment
supporting a Lisp implementation also supports multiple suitable text
editors. Emacs itself,  through multiple generations, has developed
into something of a mature state, and text-editing in all its Unicode &
multiple font size & multiple script & mouse navigation seems like a
real complicated problem space, even ignoring the (solved?) problems of
efficient buffer implementation and redisplay. Seeing multiple
accomplished Lispers give up re-implementing GNU Emacs in Common Lisp
has, I suppose, made me think those grapes must be sour anyhow.

To me, as a novice in text editing, it would seem harder to get a grip
on the problem than on the Lisp language. Or, in general, harder to
learn a GUI toolkit than the Lisp language.

I suppose I also don't understand the apparent urge (or perhaps this
has tapered off) for so many Java newbies to implement a skinnable MP3
player. And to post it on SourceForge for all to bask in its alpha
state.

For the record, my first Lisp code (as I recall) was for a
(REPL-interface) solitaire game, partly to convince myself that the
Windows version I was addicted to had poor random-number generation.
From: Michael Ferrador
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <rMd6f.2108$fn.776@fe08.lga>
bradb wrote:

> developing with that was a bit of a pain because the editor ran in the
> same console window as the Lisp REPL & when it crashed the REPL window
> would be screwed up.

clisp posix "system call"/X specific
http://clisp.cons.org/impnotes/syscalls.html#mk-xterm-io
From: bradb
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <1129933396.890947.250680@g47g2000cwa.googlegroups.com>
That looks interesting, but clisp specific.  Is there something similar
to this for SBCL?  After all ncurses is pretty darn easy :)
From: Pascal Bourguignon
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <87vezq326y.fsf@thalassa.informatimago.com>
"bradb" <··············@gmail.com> writes:

> That looks interesting, but clisp specific.  Is there something similar
> to this for SBCL?  After all ncurses is pretty darn easy :)

It's open source and one small function.  Can't you port it to SBCL?

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
You never feed me.
Perhaps I'll sleep on your face.
That will sure show you.
From: bradb
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <1129935887.054590.6960@g43g2000cwa.googlegroups.com>
Pascal Bourguignon wrote:
> "bradb" <··············@gmail.com> writes:
>
> > That looks interesting, but clisp specific.  Is there something similar
> > to this for SBCL?  After all ncurses is pretty darn easy :)
>
> It's open source and one small function.  Can't you port it to SBCL?

Yup, if it is small, doesn't rely on anything clisp specific & doesn't
tax my Lisp skills (which is very easy to do) - then porting this very
function to SBCL might be a good option to follow up on.
Of course, using the function first under CLisp is probably also a good
idea :)

Brad
From: Pascal Bourguignon
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <874q7a4htb.fsf@thalassa.informatimago.com>
"bradb" <··············@gmail.com> writes:

> Hi all, I searched the list & found a few tidbits of GUI info, but a
> lot of it seemed old.  So I thought that I'd ask the question again and
> see if things had changed
> I am learning Lisp & would like to build a very simple text editor.
> Initially I looked at ncurses & got something simple going, but
> developing with that was a bit of a pain because the editor ran in the
> same console window as the Lisp REPL & when it crashed the REPL window
> would be screwed up.

You need to learn about UNWIND-PROTECT !

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

This is a signature virus.  Add me to your signature and help me to live
From: bradb
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <1129934881.718503.36350@z14g2000cwz.googlegroups.com>
That is also a very good suggestion, presumably when I get a bug that
would throw me back the the REPL, unwind-protect can call the ncurses
endwin function so that my REPL isn't garbage?

Brad
From: bradb
Subject: Re: Newbie with some GUI questions
Date: 
Message-ID: <1129935306.451944.73870@z14g2000cwz.googlegroups.com>
Sorry - after actually reading about unwind-protect I understand it
more.  Should have looked it up before asking stupid questions.

Brad