~martanne/devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 3

[PATCH vis v2] vis-complete: complete words containing unicode

Details
Message ID
<20240218195931.63026-1-florian.fischer@muhq.space>
DKIM signature
permerror
Download raw message
Sorry for the confusion I caused with the first version of this patch containing
an old local change of mine changing tr(1) to sed(1).

v1 -> v2: actually use awk(1)

[PATCH] vis-complete: split words using awk(1) instead of tr(1)

Details
Message ID
<20240218195931.63026-2-florian.fischer@muhq.space>
In-Reply-To
<20240218195931.63026-1-florian.fischer@muhq.space> (view parent)
DKIM signature
permerror
Download raw message
Patch: +1 -1
Similar to d3e4af1f0a33849b36196b035fddf64037e0c282 the
lack of unicode support in GNU's tr(1) implementation prevents
word completions for word containing unicode glyphs.

Apparently, most awk implementations support unicode.

Signed-off-by: Florian Fischer <florian.fischer@muhq.space>
---
 vis-complete | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vis-complete b/vis-complete
index db925f69..e7bf5796 100755
--- a/vis-complete
+++ b/vis-complete
@@ -48,7 +48,7 @@ fi
PATTERN="$1"

if [ $COMPLETE_WORD = 1 ]; then
	tr -s '\t {}()[],<>%^&.\\' '\n' |
	awk '{gsub(/([^[:alnum:]_])/,"\n")}1' |
		grep "^$(basic_regex_quote "$PATTERN")." |
		sort -u
else
-- 
2.43.2

Re: [PATCH] vis-complete: split words using awk(1) instead of tr(1)

Details
Message ID
<3Q555VN2KRZNI.3KPZV36GSSGX2@homearch.localdomain>
In-Reply-To
<20240218195931.63026-2-florian.fischer@muhq.space> (view parent)
DKIM signature
missing
Download raw message
Florian Fischer <florian.fischer@muhq.space> wrote:
> Similar to d3e4af1f0a33849b36196b035fddf64037e0c282 the
> lack of unicode support in GNU's tr(1) implementation prevents
> word completions for word containing unicode glyphs.
> 
> Apparently, most awk implementations support unicode.
> 
> Signed-off-by: Florian Fischer <florian.fischer@muhq.space>

LGTM, thanks for the patch!

Cheers,
Silvan


> ---
>  vis-complete | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/vis-complete b/vis-complete
> index db925f69..e7bf5796 100755
> --- a/vis-complete
> +++ b/vis-complete
> @@ -48,7 +48,7 @@ fi
>  PATTERN="$1"
>  
>  if [ $COMPLETE_WORD = 1 ]; then
> -	tr -s '\t {}()[],<>%^&.\\' '\n' |
> +	awk '{gsub(/([^[:alnum:]_])/,"\n")}1' |
>  		grep "^$(basic_regex_quote "$PATTERN")." |
>  		sort -u
>  else

Re: [PATCH] vis-complete: split words using awk(1) instead of tr(1)

Details
Message ID
<33HZSH9TLGVWL.1YJ1U1GABCIYB@rnpnr.xyz>
In-Reply-To
<20240218195931.63026-2-florian.fischer@muhq.space> (view parent)
DKIM signature
permerror
Download raw message
Florian Fischer <florian.fischer@muhq.space> wrote:
> Similar to d3e4af1f0a33849b36196b035fddf64037e0c282 the
> lack of unicode support in GNU's tr(1) implementation prevents
> word completions for word containing unicode glyphs.
> 
> Apparently, most awk implementations support unicode.
> 
> Signed-off-by: Florian Fischer <florian.fischer@muhq.space>
> ---
>  vis-complete | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/vis-complete b/vis-complete
> index db925f69..e7bf5796 100755
> --- a/vis-complete
> +++ b/vis-complete
> @@ -48,7 +48,7 @@ fi
>  PATTERN="$1"
>  
>  if [ $COMPLETE_WORD = 1 ]; then
> -	tr -s '\t {}()[],<>%^&.\\' '\n' |
> +	awk '{gsub(/([^[:alnum:]_])/,"\n")}1' |
>  		grep "^$(basic_regex_quote "$PATTERN")." |
>  		sort -u
>  else

Sorry for the delay in response but I wanted to have a better
solution prepared before replying. I will reject this because the
character classes still don't work properly with onetrueawk even
though unicode is supported.

I sent a different patch to the list which works with all the
examples given. I would appreciate any review!

- Randy

-- 
https://rnpnr.xyz/
GPG Fingerprint: B8F0 CF4C B6E9 415C 1B27 A8C4 C8D2 F782 86DF 2DC5
Reply to thread Export thread (mbox)