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


Groups > comp.arch.embedded > #13265

Re: Editor recommendation

From Hans-Bernhard Bröker <HBBroeker@t-online.de>
Newsgroups comp.arch.embedded
Subject Re: Editor recommendation
Date 2013-08-31 02:17 +0200
Message-ID <b8cr1hFo8d9U1@mid.dfncis.de> (permalink)
References (6 earlier) <kvoe7l$1bk$1@speranza.aioe.org> <10620464-8d66-4b18-b344-b466079bbc27@googlegroups.com> <kvoqup$uo4$1@speranza.aioe.org> <b8bdjcFel7tU1@mid.dfncis.de> <kvr4ld$4nl$1@speranza.aioe.org>

Show all headers | View raw


On 31.08.2013 00:00, Don Y wrote:
> 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.

It very nearly is ... and it's pretty much guaranteed to be faster than 
even you can write a filter program to do exactly the same job.  If only 
because it's fewer key presses end-to-end.

> 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.

Looks like you haven't had enough exposure to Emacs ;-) Emacs will 
happily edit files at the remote end of just about any type of remote 
file transfer connection.

> 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.

Thus the notion of a programmer's editor, which just so happens to be 
the actual topic of this thread.  That's exactly the one tool you use in 
all those cases where simple editors (including those found inside other 
programs) just don't cut it.

And the reason it's called a programmer's editor these days is that most 
other users have almost forgotten what a text file even is, to the point 
that you have to start C textbooks with a full-page warning message 
that, no, you're not supposed to use MS Word to edit source code.

> 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*.

Or, for crying out loud, just copy the common portion before you make 
two separate versions.

> 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?")

Sorry, but I'll have to call BS on that one.

>> :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.

And your "piece of code to walk through ...", which is probably an order 
of magnitude longer than the RE, never has oopses.  Sure.  Oh, and if 
you're so worried about the editor corrupting the original, you can 
always do it outside. 'sed' is wonderful for such jobs.

Usable editors have undo, and better ones have interactive RE-replace 
that lets you watch the change made step by step.  And a history of the 
RE-strings you tried before.  And parenthesis highlighting of the RE 
while you type it.

> Do you *only* deal with "programmer's editors"?

No.  But if an editing job gets hairy, at some point it simply doesn't 
make sense any more to fight yet another inferior editor's peculiarities.

> What's the keystroke sequence to cut/paste/fill a rectangular region
> while composing in Thunderbird?

I don't know (yet), because that hasn't come up often enough to bother 
looking it up.  If that ever really matters, I'll probably just move the 
editing job to the proper tool instead.

So I don't follow the Unix principle of "One task <==> One tool" really 
strictly, but I'll return to it eventually.  In the case at hand, that 
translates into: _one_ full-blown text editor is, ultimately, all you 
need.  If only because it's a waste of brain capacity to memorize a 
dozen editors' key combinations and specialties.

> (or, do you never share code fragments with colleagues
> electronically)

Happens often enough. But if that's going to be worth it, that code has 
to be in the real editor, too, either before or after the transmission. 
  So it's just a question of making the sequence edit-copy-paste-send 
instead of copy-paste-edit-send-copy-paste.

> 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?

If the editor in whatever application doesn't hack it, that's one 
option.  Another is to get whatever application to use emacs-client as 
its editor.

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