RE: avoid Press Enter... with new z= from function

2006-05-08 Thread Bram Moolenaar

Suresh Govindachar wrote:
 
  Actually I was trying to avoid writing all the wrapper code that this
  code omits. :)  z= does more than this snippet, it figures out what
  word it is, displays the list, requests user input, processes user
  input, and changes the word.
  
  The only thing I couldn't make it do is work from a function call, 
 
   I tried 
 
  :normal ic-vc-oz=
   
   and it almost worked.  So the question for Bram is whether (from
   in input mode) i_CTRL-O z= is supposed to work!

I suppose that c-v isn't there, otherwise you are inserting a CTRL-O
character in your text.  Using CTRL-O z= in Insert mode works fine.
What was the problem?

-- 
The 50-50-90 rule: Anytime you have a 50-50 chance of getting
something right, there's a 90% probability you'll get it wrong.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: avoid Press Enter... with new z= from function

2006-05-08 Thread Suresh Govindachar
   Bram Moolenaar wrote:

   Suresh Govindachar wrote:
   
   Actually I was trying to avoid writing all the wrapper code
   that this code omits. :)  z= does more than this snippet, it
   figures out what word it is, displays the list, requests user
   input, processes user input, and changes the word.
   
   The only thing I couldn't make it do is work from a function
   call, 
   
 I tried 
   
:normal ic-vc-oz=
 
 and it almost worked.  So the question for Bram is whether
 (from in input mode) i_CTRL-O z= is supposed to work!
  
   I suppose that c-v isn't there, otherwise you are inserting a
   CTRL-O character in your text.  
  
  Yes.

   Using CTRL-O z= in Insert mode works fine.  What was 
   the problem?

  Short answer -- it works.  [Long answer:  Yesterday, I could 
  not get it to work;  today, the very first time I tried it, 
  the word was replaced by funny (non-aplha, non-numeric)
  characters.  Since then, it has always worked whenever I tried 
  it.] 

  --Suresh



Re: avoid Press Enter... with new z= from function

2006-05-06 Thread Steve Hall
On Fri, 2006-05-05 at 09:22 +0200, Bram Moolenaar wrote:
 Steve Hall wrote:

  Is there a way to avoid the Press ENTER or type command to
  continue when requesting spelling suggestions from a :normal z=
  call in a function?
 
  I'm not able to make any of the usual tricks (shm, raising the
  command height) work, and this statement blocks user input.

 Why not use spellsuggest()?

That seems a lot of overhead to process the list and make a
menu/popup, especially given z= usefulness.

 It works when you set the maximum number of entries in
 'spellsuggest' to less than the value of 'cmdheight'.

I keep cmdheight small so my editing area is large. z= usefully
expands it except...

 :silent normal z= also works. That's probably what you should do
 if you want to catch the output with a redirection.

I'm not trying to capture anything, but when called in a function the
screen refresh happens after the function has already terminated.

  1: function! MySpellAlts()
  2: let mycmdheight = cmdheight
  3: set cmdheight=13
  4: set spellsuggest=10
  5: silent normal z=
  6: let cmdheight = mycmdheight
  7: endfunction
  8: imap M-F7 C-o:call MySpellAlts()CR

I can find no way to configure line 5 to make this work, I've tried
omitting the silent, using a literal key C-o...


-- 
Steve Hall  [ digitect mindspring com ]



Re: avoid Press Enter... with new z= from function

2006-05-05 Thread Bram Moolenaar

Steve Hall wrote:

 Is there a way to avoid the Press ENTER or type command to continue
 when requesting spelling suggestions from a :normal z= call in a
 function?
 
 I'm not able to make any of the usual tricks (shm, raising the
 command height) work, and this statement blocks user input.

Why not use spellsuggest()?

It works when you set the maximum number of entries in 'spellsuggest' to
less than the value of 'cmdheight'.

:silent normal z= also works.  That's probably what you should do if
you want to catch the output with a redirection.

-- 
Making it up?  Why should I want to make anything up?  Life's bad enough
as it is without wanting to invent any more of it.
-- Marvin, the Paranoid Android in Douglas Adams'
   The Hitchhiker's Guide to the Galaxy

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


avoid Press Enter... with new z= from function

2006-05-04 Thread Steve Hall

Is there a way to avoid the Press ENTER or type command to continue
when requesting spelling suggestions from a :normal z= call in a
function?

I'm not able to make any of the usual tricks (shm, raising the
command height) work, and this statement blocks user input.


-- 
Steve Hall  [ digitect mindspring com ]