Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] avoid localized output from external commands in a few completion



Jun T wrote on Wed, Dec 27, 2017 at 20:51:30 +0900:
> +++ b/Doc/Zsh/compsys.yo
> @@ -4299,6 +4311,18 @@ This function completes words that are valid at command position: names of
> +item(tt(_comp_locale))(
> +This function resets all the locale categories other than tt(LC_CTYPE) to
> +`tt(C)' so that the output from external commands can be easily analyzed by
> +the completion system. tt(LC_CTYPE) retains the current value (either
> +explicitly set or inherited from tt(LC_ALL) or tt(LANG)), ensuring that
> +non-ASCII characters in file names are still handled properly.
> +

Thanks for adding this!

One comment: the language "inherited" could be confusing in this usage.
(Normally inheritance works from a parent class to a subclass, but here LC_ALL
and LANG are a parent and a child of LC_CTYPE.)  How about, for example:

diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
index a0e99f2e4..336a7ec37 100644
--- a/Doc/Zsh/compsys.yo
+++ b/Doc/Zsh/compsys.yo
@@ -4315,8 +4315,8 @@ findex(_comp_locale)
 item(tt(_comp_locale))(
 This function resets all the locale categories other than tt(LC_CTYPE) to
 `tt(C)' so that the output from external commands can be easily analyzed by
-the completion system. tt(LC_CTYPE) retains the current value (either
-explicitly set or inherited from tt(LC_ALL) or tt(LANG)), ensuring that
+the completion system. tt(LC_CTYPE) retains the current value (taking
+tt(LC_ALL) and tt(LANG) into account), ensuring that
 non-ASCII characters in file names are still handled properly.
 
 This function should normally be run only in a subshell, because the new

Cheers,

Daniel

> +This function should normally be run only in a subshell, because the new
> +locale is exported to the environment. Typical usage would be
> +`tt($LPAR()_comp_locale; )var(command) ...tt(RPAR())'.
> +)
>  findex(_completers)
>  item(tt(_completers) [ tt(-p) ])(
>  This function completes names of completers.
> 
> 
> 
> 
> 



Messages sorted by: Reverse Date, Date, Thread, Author