Gary Johnson wrote:

> When starting Vim on a Linux system, 'fileencodings' is set to
> "ucs-bom,utf-8,default,latin1".  But, after executing
> 
>     set fileencodings&
> 
> or
> 
>     set all&
> 
> the value changes to "usc-bom" even though the value of 'encoding'
> has remained "utf-8".  ":help fileencodings" says:
> 
>     'fileencodings' 'fencs' string (default: "ucs-bom",
>                                     "ucs-bom,utf-8,default,latin1" when
>                                     'encoding' is set to a Unicode value)
> 
> I think the behavior of ":set fileencodings&" and ":set all&" is
> contrary to the documentation and is a bug.
> 
> Example:
> 
>     $ vim -N -u NONE -i NONE
>     :verbose set encoding? fileencodings?
>       encoding=utf-8
>       fileencodings=ucs-bom,utf-8,default,latin1
>     :set all&
>     :verbose set encoding? fileencodings?
>       encoding=utf-8
>       fileencodings=ucs-bom

The generic options code only handles a static default value.  In this
case the default value depends on the 'encoding' option.  That requires
some extra code to handle the exception.  I think it's worth it.

-- 
This computer is so slow, it takes forever to execute and endless loop!

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            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

--- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202106131828.15DIS6k7663804%40masaka.moolenaar.net.

Raspunde prin e-mail lui