zsh-workers
 help / color / mirror / code / Atom feed
From: Marc Chantreux <eiro@phear.org>
To: Oliver Kiddle <opk@zsh.org>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: 2 new patches for _surfraw
Date: Sat, 10 Apr 2021 10:38:31 +0200	[thread overview]
Message-ID: <YHFkB2PYXxZ2kIm0@prometheus.u-strasbg.fr> (raw)
In-Reply-To: <84376-1618005187.938917@aiYa.Xwq7.uanX>

[-- Attachment #1: Type: text/plain, Size: 450 bytes --]

hello,

> This mostly looks all good so there's not much I can say.

yet: i want to read carefully and learn about the completion primitives
before submitting a new version so let's focus on the second patch
for the moment (easier and actually fixing a bug).

i propose 2 versions of the patch. the second one also

* remove the other tailing spaces
* remove some tabs in the indentation
* declare the correct indentation in a vim mode

regards
marc

[-- Attachment #2: 0001-fix-ebay-completion-bug-due-to-tailing-space.patch --]
[-- Type: text/x-diff, Size: 4952 bytes --]

From 6367f7dae6bfe27d6580d68ecc87eece8caa845b Mon Sep 17 00:00:00 2001
From: Marc Chantreux <eiro@phear.org>
Date: Sat, 10 Apr 2021 10:25:02 +0200
Subject: [PATCH] fix ebay completion bug due to tailing space

also
* remove the other tailing spaces
* remove some tabs in the indentation
* declare the correct indentation in a vim mode
---
 Completion/Unix/Command/_surfraw | 61 ++++++++++++++++----------------
 1 file changed, 31 insertions(+), 30 deletions(-)

diff --git a/Completion/Unix/Command/_surfraw b/Completion/Unix/Command/_surfraw
index f945f1ca9..b480e3c28 100644
--- a/Completion/Unix/Command/_surfraw
+++ b/Completion/Unix/Command/_surfraw
@@ -1,4 +1,5 @@
 #compdef surfraw sr
+# vim: et ts=2
 
 local curcontext="$curcontext" expl state line args ret=1
 
@@ -64,10 +65,10 @@ case $state in
           '*:search string' && ret=0
       ;;
       ctan)
-	_arguments $args \
-	'-name[search by filename]' \
-	'-desc[search descriptions (default)]'\
-	'-doc[search documentation]'
+    _arguments $args \
+    '-name[search by filename]' \
+    '-desc[search descriptions (default)]'\
+    '-doc[search documentation]'
       ;;
       currency)
         _arguments \
@@ -165,7 +166,7 @@ case $state in
       ;;
       debsec)
         _message -e string 'package name, bug number or CVE ID'
-      ;; 
+      ;;
       deja)
         _arguments $args \
           '-results=-:[number of results to return]' \
@@ -183,7 +184,7 @@ case $state in
       ;;
       ebay)
         _arguments $args \
-          '-country=-:country:(com de uk fr)' \ 
+          '-country=-:country:(com de uk fr)' \
           '-results=-:[number of results to return]:number' && ret=0
       ;;
       etym)
@@ -220,7 +221,7 @@ case $state in
         _deb_packages avail && ret=0
       ;;
       fsfdir)
-	_arguments $args
+    _arguments $args
       ;;
       google)
         _arguments $args \
@@ -229,19 +230,19 @@ case $state in
           '-search=-:topic:(bsd linux mac unclesam)' && ret=0
       ;;
       gutenberg)
-	_arguments $args \
-	  '-title[search titles (default)]'
-	  '-author[search authors]'
-	  '-num[search etext numbers]'
-      ;;       
+    _arguments $args \
+      '-title[search titles (default)]'
+      '-author[search authors]'
+      '-num[search etext numbers]'
+      ;;
       imdb)
         _arguments $args \
           '-category=-:category:(All Titles MyMovies People Characters Quotes Bios Plots)' && ret=0
       ;;
       ixquick)
-	_arguments $args \
-	  '-search=-:search type:(web pics)' \
-	  '-lang=-:language:(english dansk deutsch espanol francais italiano nederlands norsk polski portugues suomi svenska turkce jiantizhongwen nihongo fantizhengwen hangul)'
+    _arguments $args \
+      '-search=-:search type:(web pics)' \
+      '-lang=-:language:(english dansk deutsch espanol francais italiano nederlands norsk polski portugues suomi svenska turkce jiantizhongwen nihongo fantizhengwen hangul)'
       ;;
       jake)
         _arguments $args \
@@ -386,20 +387,20 @@ case $state in
           :URL:_urls && ret=0
       ;;
       wayback)
-	_arguments $args \
-	  '-syear=-[start search from this year]:year' \
-	  '-smonth=-:[start search from this month]:month:(jan feb mar apr may jun jul aug sep oct nov dec)' \
-	  '-sday=-[start search from this day]:number' \
-	  '-eyear=-[end search in this year]:year' \
-	  '-emonth=-[end search in this month]:month:(jan feb mar apr may jun jul aug sep oct nov dec)' \
-	  '-eday=-[end search in this day]:number' \
-	  '-list[list all pages that match search criteria]' \
-	  '-dups[show dups]' \
-	  '-compare[compare pages]' \
-	  '-pdf[show as PDF]' \
-	  '-alias=-[how to handle site aliases]:alias:(merge show hide)' \
-	  '-redir=-[how to handle redirections]:redir:(hide flag show)' \
-	  '-type=-[file type to search for]:type:(image audio video binary text pdf)'
+    _arguments $args \
+      '-syear=-[start search from this year]:year' \
+      '-smonth=-:[start search from this month]:month:(jan feb mar apr may jun jul aug sep oct nov dec)' \
+      '-sday=-[start search from this day]:number' \
+      '-eyear=-[end search in this year]:year' \
+      '-emonth=-[end search in this month]:month:(jan feb mar apr may jun jul aug sep oct nov dec)' \
+      '-eday=-[end search in this day]:number' \
+      '-list[list all pages that match search criteria]' \
+      '-dups[show dups]' \
+      '-compare[compare pages]' \
+      '-pdf[show as PDF]' \
+      '-alias=-[how to handle site aliases]:alias:(merge show hide)' \
+      '-redir=-[how to handle redirections]:redir:(hide flag show)' \
+      '-type=-[file type to search for]:type:(image audio video binary text pdf)'
       ;;
       wetandwild)
         _arguments \
@@ -430,6 +431,6 @@ case $state in
     _wanted elvi expl elvi compadd \
       ${${${(f)"$(_call_program elvi surfraw -elvi)"}%%[[:space:]]##--*}%:*} && ret=0
   ;;
-esac  
+esac
 
 return ret
-- 
2.30.2


[-- Attachment #3: 0001-fix-ebay-completion-bug-due-to-tailing-space.patch~ --]
[-- Type: text/plain, Size: 1573 bytes --]

From dc4484bac85609faf5cc8057fc5d2b991f9b1c91 Mon Sep 17 00:00:00 2001
From: Marc Chantreux <eiro@phear.org>
Date: Sat, 10 Apr 2021 10:25:02 +0200
Subject: [PATCH] fix ebay completion bug due to tailing space

also remove the other tailing spaces
---
 Completion/Unix/Command/_surfraw | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Completion/Unix/Command/_surfraw b/Completion/Unix/Command/_surfraw
index f945f1ca9..b8a3033c0 100644
--- a/Completion/Unix/Command/_surfraw
+++ b/Completion/Unix/Command/_surfraw
@@ -165,7 +165,7 @@ case $state in
       ;;
       debsec)
         _message -e string 'package name, bug number or CVE ID'
-      ;; 
+      ;;
       deja)
         _arguments $args \
           '-results=-:[number of results to return]' \
@@ -183,7 +183,7 @@ case $state in
       ;;
       ebay)
         _arguments $args \
-          '-country=-:country:(com de uk fr)' \ 
+          '-country=-:country:(com de uk fr)' \
           '-results=-:[number of results to return]:number' && ret=0
       ;;
       etym)
@@ -233,7 +233,7 @@ case $state in
 	  '-title[search titles (default)]'
 	  '-author[search authors]'
 	  '-num[search etext numbers]'
-      ;;       
+      ;;
       imdb)
         _arguments $args \
           '-category=-:category:(All Titles MyMovies People Characters Quotes Bios Plots)' && ret=0
@@ -430,6 +430,6 @@ case $state in
     _wanted elvi expl elvi compadd \
       ${${${(f)"$(_call_program elvi surfraw -elvi)"}%%[[:space:]]##--*}%:*} && ret=0
   ;;
-esac  
+esac
 
 return ret
-- 
2.30.2


  parent reply	other threads:[~2021-04-10  8:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09 19:49 Marc Chantreux
2021-04-09 21:53 ` Oliver Kiddle
2021-04-09 23:10   ` Daniel Shahaf
2021-04-10  0:05     ` Oliver Kiddle
2021-04-10  8:38   ` Marc Chantreux [this message]
2021-04-11 20:23     ` Oliver Kiddle
2021-04-12  8:23       ` Marc Chantreux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YHFkB2PYXxZ2kIm0@prometheus.u-strasbg.fr \
    --to=eiro@phear.org \
    --cc=opk@zsh.org \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).