Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch.embedded > #13262

Re: Editor recommendation

From Don Y <this@isnotme.com>
Newsgroups comp.arch.embedded
Subject Re: Editor recommendation
Date 2013-08-30 15:00 -0700
Organization Aioe.org NNTP Server
Message-ID <kvr4ld$4nl$1@speranza.aioe.org> (permalink)
References (5 earlier) <27db5a60-f58f-4b35-8f33-5690f84e3c3e@googlegroups.com> <kvoe7l$1bk$1@speranza.aioe.org> <10620464-8d66-4b18-b344-b466079bbc27@googlegroups.com> <kvoqup$uo4$1@speranza.aioe.org> <b8bdjcFel7tU1@mid.dfncis.de>

Show all headers | View raw


Hi Hans-Bernhard,

On 8/30/2013 4:22 AM, Hans-Bernhard Bröker wrote:
> On 30.08.2013 03:02, Don Y wrote:
>> Yes.  As I said, I tend to just rely on using existing mechanisms
>> instead of having to "think" about how to approach it.  E.g., should
>> I write a piece of code to go through a file and substitute references
>> of
>>       <Figure XX: (continued on Page YY)>
>> with
>>       <Illustration XX: <italic>(see page YY)<\italic>>
>> or, should I do this with a keystroke macro inside a text editor?
>
> Neither.  You should have an editor that supports search-and-replace via
> regular expressions, and use that.

Not all do.  And, using RE's isn't a panacea -- see below.

When I'm working under Inferno, I can either live with Acme's
notion of "what a programmer needs".  Or, access the file
in question from *outside* Inferno (assuming I am working in
a hosted environment), manipulate it with a generic tool
under the host OS, write it back to disk and *then* access the
resulting file from within Inferno.

This is true of lots of applications that maintain their documents
in some sort of "coded" ASCII.  The "native" tools are often only
designed with limited "text manipulation" capabilities.  If you
want to do something clever, you are forced to:
- understand the encoding being used
- use or develop an external tool to massage the file as desired

For example, I defined most of my gestures using Photoshop.  Very
easy to create complex Bezier curves and tweek them to form a
consistent representation -- that you can visually evaluate.

But, you have very limited precision!  E.g., "draw" a 'C' and a 'G'
and, ideally, the (obvious) shared portions of each figure (gesture)
should be identical.  Yet, you can't do this with the tools available
*in* Photoshop.  You simply can't position the mouse that accurately.

OTOH, Photoshop creates an ASCII representation of the document
containing those "drawings".  So, it's a relatively simple matter
to massage that ASCII text (in an editor or with a "tool") to
ensure the common portions of the two figures are *identical*.
Then, verify this by reexamining the document in Photoshop.

And, once these have been visually verified, the same ASCII document
provides the data that will reside in the source code to process
those gestures.

Similarly, I "proof" AutoCAD documents (esp templates) in "DXF
format" (department of redundancy department).  This lets me
verify that certain intended invariants do, in fact, exist in
the document/model which otherwise would have been tedious to
examine using the "conventional" user interface.

The example I was alluding to in my previous post came from a
lengthy document that I had prepared some time ago (10MB of
"text").  Much easier to write a piece of code to walk through
it and mechanically rewrite the portions of the files that
needed modification than to *hope* I came up with the right
RE to fix it all in one shot  ("Ooops!  Minor error, there.
Do I have a backup that I can try that on, again?")

> E.g., and just because this
> particular editor hasn't been mentioned yet: in plain old vi, that would be
>
> :1,$s/<Figure \([^:]*\): continued on Page \([^)]\)>/<Illustration \1:
> <italic>(see page \2)<\italic>>/g
>
> (all in one line, not really tested)

And *that* is the problem ^^^^^^^^^^^^!  Unless you want to invest
lots of time learning to be an RE guru (and then complaining when
some tool doesn't support them!), you're never quite sure you've
got it right when you hit ENTER.

Write a piece of code to perform the same sort of thing and you
can easily (i.e., with a high degree of success) change a stub
that emits "found <foo> at file offset <x>; replacing with <bar>"
(i.e., used to let you preview the actions that the code will
ultimately take) with one that writes <bar> directly to the desired
output file (without fear of overwriting the original input!).

So, when you view that document in it's *intended* application,
you don't have to manually proofread hundreds of pages to discover
instances of:
     Illustratin XX <
caused by writing "<<italic>" instead of "<italic>" -- or, failed
to double the '>' on the end (i.e., akin to mismatched parens), etc.
Then, find yourself trying to come up with an RE that will find those
superfluous delimiters and fix them, etc.

And, there are problems that just don't lend themselves to an RE
sort of solution (e.g., transposing a matrix is easy to do with
keystroke macros or "a piece of code" -- considerably harder
"out of the gate" with a set of RE's!)

>> I find myself often hammering away on "up, left" (or down, etc.)
>> with my right hand while pecking at some other key with my left.
>> E.g., "$ up left" to insert a bunch of '$' in front a column of
>> monetary figures, etc.
>
> And you really shouldn't be.  Any programmer's editor really worth
> having has some sort of "rectangle fill" feature.  E.g. in Notepad++,
> you would just <Alt>-mark the column (i.e. drag the mouse while holding
> <Alt>, or move the cursor from one end to the other while holding
> Alt+Shift), then type a single $.  Done.  For more complicated cases, it
> can even fill in a sequence of numbers

Do you *only* deal with "programmer's editors"?  E.g., when I type
code fragments into a FrameMaker document (to formally document
something that I've created), *where* the cursor ends up if I type
<down_arrow> depends on my position in the current line and
the "font" used on that line and the line that follows.  The
idea of a "rectangular fill/copy/delete" simply doesn't apply
(note that this isn't just the proportional/fixed width font
issue but also the *sizes* of the typefaces comes into play!)

What's the keystroke sequence to cut/paste/fill a rectangular region
while composing in Thunderbird?  (or, do you never share code
fragments with colleagues electronically)

Should I keep Emacs open in a second window, type whatever "code"
I want in that window (using the tools emacs makes available to
me) and then *paste* it into whatever application I happen to
be *actively* working in at the time?

Over the years, I've found that the more "features" you rely on,
the more you *need* those features in your normal workflow.

E.g., imagine how you would work if you could only do one or two
builds a day (because the toolchain was slow or some equipment
needed to do it was a scarce resource).  I have colleagues who
have become so accustomed to quick edit/compile/debug cycles
that they don't even NOTICE "foo = bar / 0.0;" but wait, instead,
for the compiler to *tell* them about it!  Then, correct *just*
that problem and wait for the compiler to tell them what else
*might* be wrong...

> In Emacs one would drop the mark (Ctrl-Space), move to the other end,
> then Ctrl-x r t $ <Ret>.

Back to comp.arch.embedded | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Editor recommendation Roberto Waltman <usenet@rwaltman.com> - 2013-08-28 16:18 -0400
  Re: Editor recommendation David Brown <david.brown@removethis.hesbynett.no> - 2013-08-28 22:46 +0200
    Re: Editor recommendation chris <meru@devnull.com> - 2013-08-28 22:10 +0000
      Re: Editor recommendation dp <dp@tgi-sci.com> - 2013-08-29 09:23 -0700
        Re: Editor recommendation Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> - 2013-08-29 17:15 +0000
          Re: Editor recommendation dp <dp@tgi-sci.com> - 2013-08-29 10:38 -0700
            Re: Editor recommendation Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> - 2013-08-29 17:49 +0000
              Re: Editor recommendation dp <dp@tgi-sci.com> - 2013-08-29 12:19 -0700
          Re: Editor recommendation Paul Rubin <no.email@nospam.invalid> - 2013-08-29 12:16 -0700
        Re: Editor recommendation Don Y <this@isnotme.com> - 2013-08-29 11:32 -0700
          Re: Editor recommendation Paul Rubin <no.email@nospam.invalid> - 2013-08-29 12:15 -0700
          Re: Editor recommendation dp <dp@tgi-sci.com> - 2013-08-29 14:04 -0700
            Re: Editor recommendation Don Y <this@isnotme.com> - 2013-08-29 14:25 -0700
              Re: Editor recommendation Robert Wessel <robertwessel2@yahoo.com> - 2013-08-29 17:05 -0500
                Re: Editor recommendation Don Y <this@isnotme.com> - 2013-08-29 16:32 -0700
              Re: Editor recommendation dp <dp@tgi-sci.com> - 2013-08-29 15:44 -0700
                Re: Editor recommendation Don Y <this@isnotme.com> - 2013-08-29 18:02 -0700
                Re: Editor recommendation Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2013-08-30 13:22 +0200
                Re: Editor recommendation Don Y <this@isnotme.com> - 2013-08-30 15:00 -0700
                Re: Editor recommendation Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2013-08-31 02:17 +0200
                Re: Editor recommendation Stefan Reuther <stefan.news@arcor.de> - 2013-08-31 11:36 +0200
          Re: Editor recommendation Randy Yates <yates@digitalsignallabs.com> - 2013-08-30 20:30 -0400
            Re: Editor recommendation Don Y <this@isnotme.com> - 2013-08-31 00:50 -0700
              Re: Editor recommendation Stefan Reuther <stefan.news@arcor.de> - 2013-08-31 11:54 +0200
                Re: Editor recommendation Randy Yates <yates@digitalsignallabs.com> - 2013-08-31 10:17 -0400
                Re: Editor recommendation Randy Yates <yates@digitalsignallabs.com> - 2013-08-31 10:20 -0400
        Re: Editor recommendation chris <meru@devnull.com> - 2013-08-30 13:29 +0000
          Re: Editor recommendation dp <dp@tgi-sci.com> - 2013-08-30 15:04 -0700
    Re: Editor recommendation George Neuner <gneuner2@comcast.net> - 2013-08-30 13:05 -0400
      Re: Editor recommendation chris <meru@devnull.com> - 2013-08-30 22:55 +0000
  Re: Editor recommendation Les Cargill <lcargill99@comcast.com> - 2013-08-28 21:22 -0500
    Re: Editor recommendation Don Y <this@isnotme.com> - 2013-08-28 19:54 -0700
      Re: Editor recommendation Les Cargill <lcargill99@comcast.com> - 2013-08-28 22:28 -0500
        Re: Editor recommendation Don Y <this@isnotme.com> - 2013-08-28 22:38 -0700
    Re: Editor recommendation George Neuner <gneuner2@comcast.net> - 2013-08-30 12:42 -0400
      Re: Editor recommendation Paul Urbanus <urb@urbonix.com> - 2013-09-02 21:20 -0500
        Re: Editor recommendation Paul Urbanus <urb@urbonix.com> - 2013-09-04 01:20 -0500
        Re: Editor recommendation Randy Yates <yates@digitalsignallabs.com> - 2013-09-04 07:22 -0400
  Re: Editor recommendation Don Y <this@isnotme.com> - 2013-08-28 19:52 -0700
  Re: Editor recommendation bbhack <bbhack@gmail.com> - 2013-08-28 22:41 -0500
    Re: Editor recommendation chris <meru@devnull.com> - 2013-08-29 12:19 +0000
      Re: Editor recommendation bbhack <bbhack@gmail.com> - 2013-08-31 11:54 -0500
        Re: Editor recommendation chris <meru@devnull.com> - 2013-09-03 15:32 +0000
  Re: Editor recommendation Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2013-08-29 09:19 +0300
  Re: Editor recommendation Roberto Waltman <usenet@rwaltman.com> - 2013-08-29 10:01 -0400
    Re: Editor recommendation Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2013-08-29 18:45 +0300
    Re: Editor recommendation Don Y <this@isnotme.com> - 2013-08-29 12:04 -0700
      Re: Editor recommendation Robert Wessel <robertwessel2@yahoo.com> - 2013-08-29 16:31 -0500
        Re: Editor recommendation Don Y <this@isnotme.com> - 2013-08-29 15:00 -0700
        Re: Editor recommendation Randy Yates <yates@digitalsignallabs.com> - 2013-08-30 20:50 -0400
      Re: Editor recommendation Randy Yates <yates@digitalsignallabs.com> - 2013-08-30 20:37 -0400
        Re: Editor recommendation Don Y <this@isnotme.com> - 2013-08-30 21:15 -0700
          Re: Editor recommendation Stefan Reuther <stefan.news@arcor.de> - 2013-08-31 12:05 +0200
            Re: Editor recommendation Don Y <this@isnotme.com> - 2013-08-31 11:26 -0700
              Re: Editor recommendation Stefan Reuther <stefan.news@arcor.de> - 2013-09-01 20:21 +0200
                Re: Editor recommendation Don Y <this@isnotme.com> - 2013-09-01 17:02 -0700
                Re: Editor recommendation Stefan Reuther <stefan.news@arcor.de> - 2013-09-02 19:55 +0200
                Re: Editor recommendation Don Y <this@isnotme.com> - 2013-09-02 16:22 -0700
                Re: Editor recommendation Randy Yates <yates@digitalsignallabs.com> - 2013-09-02 19:39 -0400
                Re: Editor recommendation Don Y <this@isnotme.com> - 2013-09-02 17:51 -0700
                Re: Editor recommendation Don Y <this@isnotme.com> - 2013-09-02 18:49 -0700
          Re: Editor recommendation Randy Yates <yates@digitalsignallabs.com> - 2013-08-31 15:13 -0400
            Re: Editor recommendation Don Y <this@isnotme.com> - 2013-08-31 13:45 -0700
  Re: Editor recommendation Habib Bouaziz-Viallet <h.bouazizviallet@free.fr> - 2013-08-29 16:31 +0200
    Re: Editor recommendation bbhack <bbhack@gmail.com> - 2013-08-31 12:03 -0500
      Re: Editor recommendation Randy Yates <yates@digitalsignallabs.com> - 2013-08-31 13:27 -0400
        Re: Editor recommendation bbhack <bbhack@gmail.com> - 2013-08-31 13:17 -0500
      Re: Editor recommendation Habib Bouaziz-Viallet <h.bouazizviallet@free.fr> - 2013-09-01 19:16 +0200
        Re: Editor recommendation Randy Yates <yates@digitalsignallabs.com> - 2013-09-01 19:52 -0400
          Re: Editor recommendation chris <meru@devnull.com> - 2013-09-03 14:41 +0000
  Re: Editor recommendation jhallen@TheWorld.com (Joseph H Allen) - 2013-08-29 20:09 +0000
  Re: Editor recommendation stephenXXX@mpeforth.com (Stephen Pelc) - 2013-09-04 12:10 +0000

csiph-web