Christian Brabandt wrote:

> On Mon, October 1, 2012 13:16, Marcin Szamotulski wrote:
> > On 09:20 Sun 23 Sep     , Marcin Szamotulski wrote:
> >> Hello
> >>
> >> The c_CTRL-\_e (<C-\>e) maps inside expression register are not working.
> >> There is a very nice emacscommandline
> >> (http://www.vim.org/scripts/script.php?script_id=3554)
> >> plugin which defines lots of nice maps in this way, but then when one
> >> tries to write to expression register one gets errors. The minimal setup
> >> to reproduce this is:
> >>
> >> fun X()
> >>   return 'echo "X"'
> >> endfun
> >> cnoremap X <C-\>eX()<CR>
> >>
> >> Now please try in insert mode:
> >> <c-r>=X
> >> and after pressing X I get the following error:
> >> E15: invalid expression: ^eX()
> >> E15: invalid expression: ^eX()
> >>
> >> I got it twice. I think it would be nice to have the <C-\>e maps
> >> working inside expression register (and in this case it would be nice of
> >> vim script knew it, for example through including the '=' into to
> >> getcmdline()) or to disable the <C-\>e maps inside the expression
> >> register.
> >>
> >> Best regards,
> >> Marcin
> >
> > In case somebody will stumble across this post, the solution that
> > I found for this is to define another map:
> >     cnoremap <C-b> <C-R>
> > etc ... . It will not trigger the emacscommand line maps. One just has
> > to remember to not to use <C-W> while entering things into the
> > expression register (which is used rarely, so there is not much
> > opportunity to learn it, and lots of chances to forget it ;)
> >
> > But this is far from perfect.
> 
> Would it be enough to simply disallow mappings in expression evalution mode?

Would this not stop other mappings from working, e.g.:

        cnoremap <C-Y> yank()


-- 
A special law prohibits unmarried women from parachuting on Sunday or she
shall risk arrest, fine, and/or jailing.
                [real standing law in Florida, United States of America]

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui