> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: 12 May 2006 21:45
> To: Eric Arnold
> Cc: vim-dev@vim.org
> Subject: Re: updated strtrans() patch for special keys
> 
> 
> Eric Arnold wrote:
> 
> > The doc page really only talks about regular control chars, leaving
> > the problem of special keys to the imagination.  Are they to be
> > considered a string of characters which are to be evaluated
> > individually against 'isprint', or are they a 
> meta-character which is
> > to be evaluated against 'isprint'?
> > 
> > 
> > strtrans({expr})                                    *strtrans()*
> >             The result is a String, which is {expr} with 
> all unprintable
> >             characters translated into printable characters 
> |'isprint'|.
> >             Like they are shown in a window.  Example: >
> >                     echo strtrans(@a)
> > <           This displays a newline in register a as "^@" instead of
> >             starting a new line
> > 
> > 
> > However, if you have a <s-leftmouse>,  then having
> > 
> > €ü=02€ý,
> > 
> > show up in your window doesn't seem to be in the spirit of "all
> > unprintable characters translated".  Yes, the individual 
> components of
> > the string are in the @,~-255 range, but the key represented (left
> > mouse) is not.
> 
> The function does not have the purpose of showing key codes.  It is
> really only to turn a string into something without non-printable
> characters.  That's it.
> 
> The byte sequences used for a special character may also appear in a
> file or in a file name, they must not be interpreted as a special key
> then.
> 
> If you really want to convert a byte sequence to special key names
> another function would need to be used.

But why? Is it really the best choice to have different
function names for things that are so similar in their substance?
IMHO, the options to strtrans as suggested by E.A. would
fit the bill well and I would have to remember another
function name, another :h, etc.

---Zdenek

Reply via email to