• Welcome to OS2World OLD-STATIC-BACKUP Forum.
 

News:

This is an old OS2World backup forum for reference only. IT IS READ ONLY!!!

If you need help with OS/2 - eComStation visit http://www.os2world.com/forum

Main Menu

Toward a truly improved text editor.

Started by ddan, 2009.11.28, 18:52:03

Previous topic - Next topic

ddan

WELL, in answer to all complaints, and as defense against BEING childish that I
regret but still did deliberately, and that I now put behind, here's what I was
ACTUALLY working on last night, as part of long time text editor project. A new
DLL to get mouse info was a crucial part the week before, by the way.

Perhaps Yet Another Text Editor -- VIO fixed columns -- seems childish, too,
but I ain't yet satisified with 'em, certainly not GUI, though the ancient DOS
Celebrity, that you haven't heard of, is still fairly pleasing.

This is outlining the text search dialog. Hope you can unscramble as seen here.

- a possibly practical way to edit fairly complex search expressions:
   -----------------------  < imagine a box made with line draw chars
   |th* wor?, ##s phr*se?|   < the basic text
   |  *_   ? _^# &   a  ^     |   < char options, auto set to dependent default
   |s                             p|   < position options, generally two...
   -----------------------  <
in the basic text, *, ?, and # are particularly useful BUT equivocal, SO:
character options tell how char above (esp those 3) is to be viewed:
  ^ the one literal character that's above the caret (my "hat" is OFF to you)
  ? means any one of any character
  * means any # of any characters
  a, A, (alpha char) specifically lowercase, uppercase, or any alpha (english + foreign)
    have a separate switch to FIRST translate foreign to english via tables
  v, V, c, C mean lower/upper vowels and consonants
  e, f, d, p, s mean english or foreign alphas, delims, punctuation, stops
  o means operators, and if are any other categories such as english or
    foreign uppers only, that'd be E or F, add them as found useful
  # means any # of any in '0'..'9'; to match specific length or less, "1"-"9"
  _ mandatory space (probably auto set as phrase is typed in)
position and other options:
  w, s, p at left match start of word, sentence, paragraph; at right, the end
    (only allow two, I suppose) -- phrase always starts left-justified
    position finding probably takes precedence, and backwards-ish
├────────────────────────────────────────────────────────────────────────────
  & logical and when space above, always sentence oriented (for my purposes)
  |    "    or   "    "              "     "        "
  ¸ soundex match, likely to be SLOW... put it off to version 2
  ± proximity-ish, variable by separately specified #

furthermore, provide a "clear" button, BUT keep the 3 strings in a short list for recall.

RobertM

Sweet plan. I find tedit nice to have but a real pain to use for many things.


I would also love to see a new version of MED for OS/2... without all the horrendous Windows key remapping of the functions.


|
|
Kirk's 5 Year Mission Continues at:
Star Trek New Voyages
|
|


ddan

The overall plan is a bit difficult to describe because I'm cloning the
antique DOS Celebrity and I believe it's unique in its macro language and many
other operations. Here's a small but crucial example of the macros:

.open 1, edit C:\posts\post3e.txt, zoom
.open 1, edit C:\posts\post3f.txt, zoom

Those lines are held in window 2. I program its alt-x and alt-z keys thusly in
a default configuration file that runs on start-up:
.~X means open 2, down, exec
.~Z means open 2, up, exec

What happens is MAGIC. Alt-x and alt-z become next and previous file keys. I
can skim through files at literally the keyboard rate. If you've never had
that, you may not believe what a big help that alone is. Don't have to wade
through a file selector. (There isn't a built-in one, anyway! Have to type.)
True, it requires writing the second file, but I've long since mostly
automated that with a helper program and another macro. It's great to be able
to QUICKLY skim to find the file I want. (I type a lot. 35 million verifiable
characters. Many more in editing.)

So, the new program revolves around a file selector that allows next and
previous file keys. Therefore I began it first, and a -- outdated somewhat
buggy -- version has been on Hobbes a while (actually that's an _application_
using the file selector with a top level that implements fairly adequate
command line file associations). But projects are opened with macros (those
are nameable and executable on Celebrity's command line), so I can call up a
project by name and change the directory, besides configure things like margin
release for programming versus prose.

Second major item is the macro language. It's a bit clumsy, but easy enough to
ACTUALLY be usable, and compose-able on the fly for one-time needs. The macro
language KNOWS TEXT; what characters, words, sentences, and paragraphs are,
and has commands to select each of those, and arbitrary blocks too, of course.
If I want to uppercase this entire paragraph (you may have noticed a penchant
for YELLING; this facilitates it), all I do is F7, alt-u, and it's done. Isn't
reversible (in the sense of restoring, though can lowercase it all), and that
operation doesn't fit into its undo buffer, but global undo is another of many
features that I just don't use much in practice. Just makes ya careless. -- If
I am, and, say, transpose two characters, the designer of Celebrity already
had the BRILLIANT innovation of a key that swaps them. Little thing like that
is incredibly handy. I've no doubt that he actually USED an editor for PROSE
rather than just sat down to grind out another version of Wordstar. Some
programs of same period, though billed as "word processors", are so primitve
that you have to manually invoke re-formatting paragraphs. Just incredible.

By the way, though I've TRIED many text editors, I blissfully forget details,
so yes, transpose and other items may not be unique. Still think Celebrity was
WAY ahead of its time in 1987. Also includes an appointment calendar, "filing
cabinet", whatever that is, calculator, spell check, and adequate thesaurus.

I've both reduced and extended the macro language. Implementing it in REXX was
a breeze compared to a Turbo Pascal version. Virtual Pascal has huge strings
and other conveniences that'd help, but it's really a toss up between it and
REXX overall, so I'm sticking with REXX.

Anyhoo, FINDING words is another big area, because I do a lot of editing,
frequently consider, re-arrange, and even substitute my words, believe it or
not. I've extended the next/previous notion to finding, of course, and I
believe invented finding the next or previous instance of the word under the
cursor with just one key press, no fooling around changing it in a dialog box.
Searches will be both simple and complex, as I show above, both always
available on dedicated keys. Also, a HISTORY of search terms will be kept.
Finding includes section markers. I usually use a ■ (254) to mark sections,
not necessarily chapters. I can't have a "previous" capability for that in
Celebrity, but do have a specific key assigned for "next".

Key definitions by macro assignment is also vital. Came up with a method that
inherently allows redefining ANY key to ANY macro. -- But I absolutely INSIST
on the dozen or so STANDARD keys being STANDARD for my purposes, so they have
built-in defaults. -- So it'd be possible to emulate any keyboard layout
(easily assigned in plain English), except that the overall operation would
have many differences.

CURSOR MOVEMENT is the third most important area, I'd say, so I can for
instance program ctrl-up to move any number of lines. I've found that moving
on a diagonal is also fun, if not handy. But those are merely repeating
standard motions: I frequently want to jump to start of next or previous
sentence and so on, so I've a bunch of position keywords too. Then there are
possibilities in whether the cursor tracks end of line or moves straight up
and down; that was programmable and actually working in the TP version, but
I'm a bit shy of more fundamental items to worry about that currently. Also
missing at present is variable amount of overlap, or previously shown text
remaining on screen, when using page-up and page-down. Turns out there are
MANY items that just plain aren't changeable in text editors (nor more
generally, in GUIs), and it's at least fun to experiment with something REALLY
flexible. -- And programmable. GUIs are always just plain MANUAL labor.

JUMPING in each file is more cursor-ing. I'll be able to program a key to jump
back and forth by 10 or whatever percent of the file, or to jump by any number
of lines. And then to know where I am -- when HATE having a scroll bar taking
away from my always too FEW character cells -- have a routine that only puts
the position indication up after the shift key has been held down a couple
seconds. -- All timing and other numbers, key assignments, will be easily
changeable, in a PLAIN LANGUAGE configuration file. -- I'm looking for similar
uses for ctrl and alt held down, perhaps dictionary lookup of word under
cursor, and... hmm, possibly to pop up the usual status line, needed but don't
like it present all the time. So.

TROUBLE is that Celebrity is just darn near good enough (I've only been using
it 16 years), so the need isn't pressing, and programming is TOUGH going (for
me, not that what I want requires advancing the science!), and I REGRET time
away from USING an adequate tool to try and write a better one. ── Because I
actually USE a computer, don't just tinker and maintain. ── I'm having the
heck of a time getting text reflow to work right. (There's some primitive
flaws that I've built in, that might, in more capable hands, not be necessary,
but I've got to stick to what I can manage.) With the file selector and the
mouse DLL probably up to being wedged in, suppose I can resume on the main.

By the way, notice the differing dashes -- v ── above? Slipped and forgot that
I was writing for a web page rather than my usual prose. My interjection marks
are programmed on a key. I consider that and other little fillips to be among
MANY items sorely lacking from ALL other text editors that I've tried.

And, NO, modern GUIs don't even come close for REAL TEXT. Those are almost
entirely TYPESETTING. That's why text has become so lousy and disjointed: it's
WORK to do on-the-fly typesetting, entirely takes away from IDEAS, in my
opinion. Typing straight through in a proportional font is okay, but any
editing makes it hop around in an entirely distracting way, and trying to
distinguish between i, l, |, !, j, and 1 causes much trouble, and sometimes
mirth. You need lots of good plain text before you even think of typesetting.
That simple fact, along with many others, is being forgotten, and so...