freeride-devel
[Top][All Lists]
Advanced

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

Re: [FR-devel] Newbie to freeride.


From: Baptiste Lepilleur
Subject: Re: [FR-devel] Newbie to freeride.
Date: Wed, 8 May 2002 21:41:49 +0200

----- Original Message -----
From: "Yohanes Santoso" <address@hidden>
To: <address@hidden>
Sent: Wednesday, May 08, 2002 4:36 AM
Subject: Re: [FR-devel] Newbie to freeride.


> "Baptiste Lepilleur" <address@hidden> writes:
>
> > Indeed, those functionnalities are already provided by Scintilla with
some
> > limitation (I'm not sure what Region and Rectangle are).
>
> region is almost like a selection. rectangle is a rectangle-shaped
> selection over some content. so, region and rectange difers only by
> their shapes (region follows the topography of the content).
>
> region differs from selection found in many editors by the number of
> operations it supports. typically, selection can only be cut, copied,
> and pasted. With region, for the content within the region, you can
> apply special indentation, sort, count lines (within that very
> region), count words, etc. Especially, sorting within region is useful
> for rearranging a collection of methods.

Ahah, that's sound a lot like the 'abstraction layer' on top of Scintilla I
was talking about: being able to manipulate text with 'high' level funcion
(I noticed Rich and I wrote a similar function to change a line indentation
but keep the caret on the same letter for example). Though count word is
fairly specific, but a generic sort or reorder line could make sense.

The asbtraction layer should provide abstractions for:
Document:
- text (each line of text)
- style (syntax coloring for each character and indicator (red underline
like in MS Word for bad spelling))
- fold data: line that are fold point, blank lines and fold level
- markers (bookmark/debug/... symbols in the margin)

View:
- folding:
    - visible lines
    - folder status for a line (is the folder expanded ?)
- caret movement
- selection

I'm probably missing some stuff but that the idea. With an abstraction layer
of that kind, we could easily write a lexer that style the text using the
document layer. There could be an implementation of the layer for Scintilla
and another one for a text mode (which would need to manage its one buffer
for text and styling).

[...]
> You striked the gold mine! Emacs's main problem to newcomer is that
> it's too flexible and too rich. There is no difference between the UI
> presented to an expert user and a beginner (everyone is assumed to be
> a regular emacs user). There are too many commands (or rather lisp
> functions) to understand and memorise their names for a beginner (even
> regular users keep finding new commands).
[...]
> What I'm proposing is to put a sane UI on top of that flexibility. A
> UI so sane that even beginner can use it without being overwhelmed by
> its flexibility. A keybinding so simple and sane that even beginner
> can understand. An alternative keybinding that is not so sane to help
> people transition from emacs, etc.

Beyond keybinding, there is also customization: you need a good UI to help
the user customize the tools. I can see something were command would be
categorized, could be filtered (adds a set of keywords to each command)...
Also, you may want to use different keybindings depending on the task you
are doing: I decided to do some heavy refactoring => I switch to the
'refactoring' profile... Some profile switch may be automatized (depends on
the document type for example). They would also probably have a common base
(unless you like headache you likely want the same keybindings to move the
caret around, copy/cut/paste...)

[...]
> The other reason for leaving behind emacs is its lisp dependancy. How
> many people still understand lisp? It used to be a very popular
> language, now it is just a niche language. It's hardly being taught in
> CS program anymore and it has grown too complicated too. I bet given a
> choice, people would readily choose to learn ruby than lisp. I learned
> lisp only because my company is one of the few companies that still
> use lisp.

> I checked out Scintilla. I think it is great! But I had difficulty in
> imagining it being easily extendible by user. Although it provides

What extension are you talking about ? I found few limitiation (see below)

> lexer for many languages, they are written in C++, so it can't be
> extended from within the freeride environment. Also, it is tied too

Styling can be done by the container (the ruby part): Scintilla send a
styleNeeded event and you are supposed to style the specified text. You can
also completly disable styling. I did this for a console output and I
colorize the text as I print it!

The main limitation I run into was the marker symbols: there is little
choice (a lot of symbol for folding/tree, but few for other purpose). But
It's fairly easy to add other symbols to Scintilla (a few line of C++), with
enough diversity, it would not be a problem anymore.

[...]
> Now for implementation issue: Curt is right in saying this could be a
> waste of time or it could be a wonderful thing. I'd go do parallel
> devel but there are two problems: 1. I have never done extensive UI
> programming much less UI designing. 2. I can't do the engine by myself
> (not enough skill, time, etc). 3. I am afraid that even after this
> long talk trying to convince people and myself, this is going to be a
> waste of time because perhaps in reality there are better ways to have
> a sane UI and capabilities of emacs without this much work.

The abstraction layer could probably done incrementaly, with only an
implementation for Scintilla to start with (basically very little work,
mainly forward to one or more Scintilla function). That layer would also
help for testing (You can have a mock implementation). It could be as simple
as:

def setTextStyles( position, styles )            # styles is an integer
array
def textStyles( position, length )                # return an integer array
def setTextIndicators( position, indicators )        #idem, but for special
marking of the text (underline...)
def textIndicators( position, length )

Those abstractions could be later used for higher level function, such
addStyledText... Implementation of those methods for Scintilla is simple (a
combination of StartStyling and SetStyling). Text manipulation could
probably be abstracted with a few methods too...

> Oh well, I guess I'll go on until I think my work is useless.

Far from being useless, I think you're experience with emacs internal will
be very enlightening...

Baptiste.
---
Baptiste Lepilleur <address@hidden>
http://gaiacrtn.free.fr/





reply via email to

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