:%s//\=@o/gce ignores c flag in key mapping

2014-11-14 Thread Graham Lawrence
In a key mapping I use the command ':%s//\=@o/gce'. The command executes as expected except that it behaves as if the c flag were not set. Is this flag unavailable in a key mapping, or is there some other option that needs to be set for it to work. It works as expected at the command line. --

Re: :%s//\=@o/gce ignores c flag in key mapping

2014-11-14 Thread Tim Chase
On 2014-11-14 16:02, Graham Lawrence wrote: > In a key mapping I use the command ':%s//\=@o/gce'. > > The command executes as expected except that it behaves as if the c > flag were not set. Is this flag unavailable in a key mapping, or > is there some other option that needs to be set for it to

Re: :%s//\=@o/gce ignores c flag in key mapping

2014-11-15 Thread porphyry5
On Friday, November 14, 2014 4:02:55 PM UTC-8, porphyry5 wrote: > In a key mapping I use the command ':%s//\=@o/gce'. > > The command executes as expected except that it behaves as if the c flag were > not set.  Is this flag unavailable in a key mapping, or is there some other > option that need

Re: :%s//\=@o/gce ignores c flag in key mapping

2014-11-17 Thread Tim Chase
On 2014-11-15 13:59, porphyry5 wrote: > On Friday, November 14, 2014 4:02:55 PM UTC-8, porphyry5 wrote: > > In a key mapping I use the command ':%s//\=@o/gce'. > > > > The command executes as expected except that it behaves as if the > > c flag were not set.  Is this flag unavailable in a key mapp

Re: :%s//\=@o/gce ignores c flag in key mapping

2014-11-17 Thread Ben Fritz
On Monday, November 17, 2014 5:27:47 AM UTC-6, Tim Chase wrote: > On 2014-11-15 13:59, porphyry5 wrote: > > On Friday, November 14, 2014 4:02:55 PM UTC-8, porphyry5 wrote: > > > In a key mapping I use the command ':%s//\=@o/gce'. > > > > > > The command executes as expected except that it behaves

Re: :%s//\=@o/gce ignores c flag in key mapping

2014-11-17 Thread Graham Lawrence
I thank you both, Tim and Ben, for your help. Let me explain the situation more fully. I'm testing the feasibility of semi-automated repair of texts that have been ocr-ed from less than ideal sources, most notably from books.google.com. To that end I've written two scripts; the first in sed to d

Re: :%s//\=@o/gce ignores c flag in key mapping

2014-11-17 Thread Ben Fritz
On Monday, November 17, 2014 12:57:31 PM UTC-6, porphyry5 wrote: > > Is there a method of getting the screen to constantly show the cursor as a > .vim script progresses? > > It should be doing it anyway, but the :redraw or :redraw! command can often force it. -- -- You received this message

Re: :%s//\=@o/gce ignores c flag in key mapping

2014-11-18 Thread Erik Christiansen
On 17.11.14 10:57, Graham Lawrence wrote: > For my test file the awk program tagged some 3500 words, with 1960 of them > unique, so this vim script must run within a loop to avoid the tedium and > 4000 odd keystrokes required to invoke it individually for each unique > error, Er, what script loop,

Re: :%s//\=@o/gce ignores c flag in key mapping

2014-11-18 Thread porphyry5
On Tuesday, November 18, 2014 2:37:22 AM UTC-8, Erik Christiansen wrote: > On 17.11.14 10:57, Graham Lawrence wrote: > > For my test file the awk program tagged some 3500 words, with 1960 of them > > unique, so this vim script must run within a loop to avoid the tedium and > > 4000 odd keystrokes r

Re: :%s//\=@o/gce ignores c flag in key mapping

2014-11-18 Thread John Little
Not much to the point, but I couldn't let this pass: porphyry5 said: >... I used a plain numeric index as I figured it must use an address array to >reference the words array, and with a numeric index I could use a binary >search pattern to locate the word. I think an associative array must use

Re: :%s//\=@o/gce ignores c flag in key mapping

2014-11-19 Thread Erik Christiansen
On 18.11.14 15:26, porphyry5 wrote: > I'm not sure how awk organizes arrays internally, but I used a plain > numeric index as I figured it must use an address array to reference > the words array, and with a numeric index I could use a binary search > pattern to locate the word. That is all unnece

Re: :%s//\=@o/gce ignores c flag in key mapping

2014-11-19 Thread porphyry5
On Wednesday, November 19, 2014 12:10:08 AM UTC-8, Erik Christiansen wrote: > On 18.11.14 15:26, porphyry5 wrote: > > I'm not sure how awk organizes arrays internally, but I used a plain > > numeric index as I figured it must use an address array to reference > > the words array, and with a numeric

Re: :%s//\=@o/gce ignores c flag in key mapping

2014-11-19 Thread porphyry5
On Tuesday, November 18, 2014 11:38:19 PM UTC-8, John Little wrote: > Not much to the point, but I couldn't let this pass: > porphyry5 said: > >... I used a plain numeric index as I figured it must use an address array > >to reference the words array, and with a numeric index I could use a binary

Re: :%s//\=@o/gce ignores c flag in key mapping

2014-11-19 Thread Erik Christiansen
On 19.11.14 12:21, porphyry5 wrote: > So if I read this hash table stuff correctly any data item that one > wants to look up in an associative array generates its own address in > memory, by using (a constant number of bytes of?) its value as a > single binary number and modifying that with some ar

Re: :%s//\=@o/gce ignores c flag in key mapping

2014-11-20 Thread porphyry5
On Wednesday, November 19, 2014 8:04:59 PM UTC-8, Erik Christiansen wrote: > On 19.11.14 12:21, porphyry5 wrote: > > So if I read this hash table stuff correctly any data item that one > > wants to look up in an associative array generates its own address in > > memory, by using (a constant number

Re: :%s//\=@o/gce ignores c flag in key mapping

2014-11-21 Thread Erik Christiansen
On 20.11.14 11:54, porphyry5 wrote: > Annoyingly, I cannot see any clear way to use an associative array in > this case, because of that pesky word suffix list. I believe 'if > (word in wd-list)' must either return "no match" or "exact match". In > the binary search I check for exact matches, on

Re: :%s//\=@o/gce ignores c flag in key mapping

2014-11-23 Thread porphyry5
On Friday, November 21, 2014 1:31:20 AM UTC-8, Erik Christiansen wrote: > On 20.11.14 11:54, porphyry5 wrote: > > Annoyingly, I cannot see any clear way to use an associative array in > > this case, because of that pesky word suffix list. I believe 'if > > (word in wd-list)' must either return "no

Re: :%s//\=@o/gce ignores c flag in key mapping

2014-11-24 Thread Erik Christiansen
On 23.11.14 12:01, porphyry5 wrote: > However I smell a rat, its so astonishingly fast, less than 2 seconds > vs ~20 seconds for the previous version, and reports only 1050 total > errors, against more than 3000 total before, though that did include > good words reported as

Re: :%s//\=@o/gce ignores c flag in key mapping

2014-11-29 Thread porphyry5
On Monday, November 24, 2014 4:05:08 AM UTC-8, Erik Christiansen wrote: > I am reminded of two quotes: > > There are two ways of constructing a software design. One way is to make > it so simple that there are obviously no deficiencies. And the other way > is to make it so complicated that there