On 13-Jul-2013 19:00 +0200, Albert Netymk wrote:

>> For a command called unmap this behavior is indeed intuitive: you
>> asked to perform an action (*delete* mapping, *unmap*) and if action
>> cannot be performed (no such mapping) reporting failure is expected.
>> If it was mapclear and it accepted argument like unmap I would call
>> *this* command's behavior counter-intuitive: you asked to clear the
>> mapping and if it is already cleared it is perfectly fine.
> 
> Since we don't have the mapclear that works on a single mapping,
> should unmap stands out and take this responsibility. It seems that
> E31 (no such mapping) is the only error that could happen inside
> unmap, so it's always safe to `silent! unmap <some-mapping>`
> regardless of the existence of one mapping. Therefore, unmap should
> take `silent!` as default behavior, I believe.

No, because you can't :unsilent (there's such a command, but it does not
change the error handling, only reenables output) such a modified :unmap
command if you're indeed interested in getting an error when the mapping
does not exist.

I don't see your point. Just prepend :silent! if you're not interested
in the error. Especially with :unmap, this is mostly used in personal
customizations. Some people like to be informed about an obsolete
unmapping (when they've uninstalled the plugin), others don't care about
this. The current behavior easily satisfies both, and it won't be
changed for backwards compatibility, anyway.

-- regards, ingo

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Raspunde prin e-mail lui