From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 8692 invoked from network); 1 Sep 2023 16:34:06 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 1 Sep 2023 16:34:06 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1693586046; b=gzMzz4/DOHYtr9Ig3N/8zl8tIsA4p+HtTeV9H/aj4p+CoIAyqiKzuRZGwfxamWH47TFDxa8GDf t8JPFrcHvoR1YZtIxl6p2nS6JVsn83xVlO/NCz9BQrCj8HVIoRTxBns5oh7yLAuKk7S7LVts9d 14Xan4OOw/28SRwIuM8/tn/hMZAy2czJy6op7Vas1Q15qW9iWkp2emMnUMIqZAFU0gNAt+g//D 6Qqt2quGyodtvz0EWU7WCPIKf2bzvi9Wkyn3KUdTg+P+Xg/XF59d80zLE1VZWoYqzfeeyYbpJJ /1JmsIpu8D310BR2tcTgUUw9Me6vhKK6UB/Sz1YH9XNR2w==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (snd01006-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.22; dmarc=none header.from=kba.biglobe.ne.jp; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1693586046; bh=1d/hUSzvO/Ap15r1P5FG+gyVLo1dPI6sSkfaQn/MWkU=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Message-ID:In-Reply-To:To:References:Date:Subject: MIME-Version:Content-Transfer-Encoding:Content-Type:From:DKIM-Signature; b=bfqY8ov2/XSCZiE7SaZ6PiZeDFTCH722dNni7Na0R7JKdk9X8EwADOzWiR9DQ1W5sDBRP4qdMe K7RbwDwuKO/DiEO0OoScdq2NzaWLCF6xnLE7AWNaFiZpz7Ku3cXsfC3jUn1SV6ODJpHu6vWsiA pvlVPbu/Q6LjSJd8EvGGQOgTjonFteBsRiUVOsoeX+fvb8B8PM47fYeVryY5YFHrl+hzZlZRHl NqUT+c1xGD78/nqXer1lF6uXPBklux7zG/VxxGOqqxoau7RyYsENC44xAbZg+4G+OOGWeSod9c PboxXZO8Cw+ggo3OlCyM9sJeu0e9YLFXJzIuOYh7ibQUdQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Message-Id:In-Reply-To:To:References: Date:Subject:Mime-Version:Content-Transfer-Encoding:Content-Type:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=D8hwOTzJlj0vAsAo6v1WqNg79IeYfkIPQOo2lg9xQOU=; b=cJJb38G/W9wFfxWlvAUHPjoAPp MTNsNsV5t9PMmgtH13cxw9XIFTp6GU9G3svX1nzkYpwHG/mOQ9dxK5W2u3qpiT2LRG4HQMjF47QD+ O/zcTqOdAP8ZALimwIVJMgClsGKl/LU8LpwJ47/vR+iXEAOSoEDYpuBUQSjL3bwRtL0BthDfPUV9T YV2Ty/qlzvif3NySEnnliZg8wHTWVmOzG35X4E0OjKPcqkHOWo2NnMW5DaKauW5gpC2kiTx6yR5JA hV1VKEgZ23wG14ydYxFrtyWseK0s8LOqNCN73iOXvEbco0ulOB+OtibsaodkiKDmjjArVfbiKqzwh dQriz9fQ==; Received: by zero.zsh.org with local id 1qc75w-000G0r-RS; Fri, 01 Sep 2023 16:34:04 +0000 Authentication-Results: zsh.org; iprev=pass (snd01006-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.22; dmarc=none header.from=kba.biglobe.ne.jp; arc=none Received: from snd01006-bg.im.kddi.ne.jp ([27.86.113.22]:58881 helo=dfmta1014.biglobe.ne.jp) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1qc75M-000Fhv-0x; Fri, 01 Sep 2023 16:33:30 +0000 Received: from mail.biglobe.ne.jp by omta1014.biglobe.ne.jp with ESMTP id <20230901163321711.NZEZ.60167.mail.biglobe.ne.jp@biglobe.ne.jp> for ; Sat, 2 Sep 2023 01:33:21 +0900 From: "Jun. T" Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.3\)) Subject: Re: adding '-p precmd' to _normal Date: Sat, 2 Sep 2023 01:33:20 +0900 References: <9A3B6734-18A2-4F18-9536-C8B5A9C535BA@kba.biglobe.ne.jp> To: zsh-workers@zsh.org In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3696.120.41.1.3) X-Biglobe-Sender: takimoto-j@kba.biglobe.ne.jp X-Seq: 52112 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: > 2023/08/30 9:25, dana dana: >=20 > On Mon 28 Aug 2023, at 22:55, Jun T wrote: >> If anyone knows any reason that this two-step method is >> better than '_normal -p precmd' then please let me know. >=20 > I don't think there's a reason to break them out like this any more, > usually, thanks to workers/44200 and workers/44201. Thanks. It seems I didn't read the thread carefully. > Matthew updated (...) but must have missed the ones you mentioned,=20 I think he has updated only those that had 'precommands+=3D( precmd )'. Below are the files that I think '-p $service' needs be added. # _cmdstring still offers alias etc. Should we fix this also? _nice also uses _normal but it has some other problems; I will send a patch for it later. Completion/BSD/Command/_jexec | 2 +- Completion/Linux/Command/_chrt | 2 +- Completion/Linux/Command/_cpupower | 2 +- Completion/Linux/Command/_ionice | 2 +- Completion/Linux/Command/_setpriv | 2 +- Completion/Linux/Command/_sysstat | 2 +- Completion/Unix/Command/_chroot | 2 +- Completion/Unix/Command/_mosh | 4 ++-- Completion/Unix/Command/_route | 2 +- Completion/Unix/Command/_screen | 2 +- Completion/Unix/Command/_script | 2 +- Completion/Unix/Command/_ssh | 4 ++-- Completion/Unix/Command/_stdbuf | 2 +- Completion/Unix/Command/_timeout | 2 +- 14 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Completion/BSD/Command/_jexec = b/Completion/BSD/Command/_jexec index 6a2d05a81..cd99ebe91 100644 --- a/Completion/BSD/Command/_jexec +++ b/Completion/BSD/Command/_jexec @@ -6,7 +6,7 @@ _jexec_normal() { # relative paths are relative to the jail's root path=3D( "$(_call_program paths jls -j $words[1] path)"/$^path ) shift 1 words; (( CURRENT-- )) - _normal + _normal -p $service } =20 _jexec() { diff --git a/Completion/Linux/Command/_chrt = b/Completion/Linux/Command/_chrt index 6789b66cf..5431b0799 100644 --- a/Completion/Linux/Command/_chrt +++ b/Completion/Linux/Command/_chrt @@ -62,7 +62,7 @@ elif (( CURRENT =3D=3D 1 )); then else shift words (( CURRENT-- )) - _normal && ret=3D0 + _normal -p $service && ret=3D0 fi =20 return ret diff --git a/Completion/Linux/Command/_cpupower = b/Completion/Linux/Command/_cpupower index 6763bdd12..d342b69d9 100644 --- a/Completion/Linux/Command/_cpupower +++ b/Completion/Linux/Command/_cpupower @@ -95,7 +95,7 @@ case $state in '-i+[measurement interval]:interval (seconds)' '-c[schedule on every core]' '-v[increase verbosity]' - '*:::command: _normal' + '*:::command: _normal -p $service' ) ;; esac diff --git a/Completion/Linux/Command/_ionice = b/Completion/Linux/Command/_ionice index ba403ca56..9989cd6a9 100644 --- a/Completion/Linux/Command/_ionice +++ b/Completion/Linux/Command/_ionice @@ -28,7 +28,7 @@ if [[ -n $state ]]; then elif (( $+opt_args[args--u] || $+opt_args[args---uid] )); then _message -e uids 'user id' else - _normal && ret=3D0 + _normal -p $service && ret=3D0 fi fi =20 diff --git a/Completion/Linux/Command/_setpriv = b/Completion/Linux/Command/_setpriv index 196f2f627..9e38152b9 100644 --- a/Completion/Linux/Command/_setpriv +++ b/Completion/Linux/Command/_setpriv @@ -96,7 +96,7 @@ _arguments -C -S -s \ '--selinux-label[request a selinux label]:SELinux labels: ' \ '--apparmor-profile[request an apparmor profile]:AppArmor profiles: ' = \ '--reset-env[set environment as for a classic login shell]' \ - '*:::command:_normal' \ + '*:::command: _normal -p $service' \ && return 0 =20 case $state in diff --git a/Completion/Linux/Command/_sysstat = b/Completion/Linux/Command/_sysstat index 5620da73d..0baae0764 100644 --- a/Completion/Linux/Command/_sysstat +++ b/Completion/Linux/Command/_sysstat @@ -130,7 +130,7 @@ _pidstat() { _arguments -s : \ '-C[filter tasks by string]:task filter' \ '-d[report I/O statistics]' \ - '-e[execute specified program and monitor it with = pidstat]:*::command: _normal' \ + '-e[execute specified program and monitor it with = pidstat]:*::command: _normal -p $service' \ '-H[display timestamp in seconds since the epoch]' \ '-h[display horizontally]' \ '-I[divide CPU usage by number of processors]' \ diff --git a/Completion/Unix/Command/_chroot = b/Completion/Unix/Command/_chroot index 516992694..a9c577bd7 100644 --- a/Completion/Unix/Command/_chroot +++ b/Completion/Unix/Command/_chroot @@ -33,7 +33,7 @@ case $variant in ;; esac =20 -args+=3D( '1:new root directory:_directories' '*:::command:_normal' ) +args+=3D( '1:new root directory:_directories' '*::: : _normal -p = $service' ) =20 _arguments -s -S : $args && ret=3D0 =20 diff --git a/Completion/Unix/Command/_mosh = b/Completion/Unix/Command/_mosh index 7d1250320..6d0f746f8 100644 --- a/Completion/Unix/Command/_mosh +++ b/Completion/Unix/Command/_mosh @@ -7,7 +7,7 @@ _arguments -C \ '(-)--help[display help information]' \ '(-)--version[display version information]' \ "--no-init[don't set terminal init string]" \ - '--ssh=3D[specify ssh command to setup session]:ssh command:_normal' = \ + '--ssh=3D[specify ssh command to setup session]:ssh command: = _cmdstring' \ '--port=3D[specify server-side port range]:port:_sequence -n 2 -s \: = _ports' \ '(-a -n)--predict=3D[control speculative local echo]:mode:(adaptive = always never)' \ '(--predict -n)-a[synonym for --predict=3Dalways]' \ @@ -22,7 +22,7 @@ _arguments -C \ '--local[run mosh-server locally without using ssh]' \ '--experimental-remote-ip=3D[select method for discovering remote IP = address to use for mosh]:method:(local remote proxy)' \ '1:remote host name:->userhost' \ - '*:::args:_normal' && ret=3D0 + '*::: : _normal -p $service' && ret=3D0 =20 case $state in userhost) diff --git a/Completion/Unix/Command/_route = b/Completion/Unix/Command/_route index 95df6d936..f0775a5d2 100644 --- a/Completion/Unix/Command/_route +++ b/Completion/Unix/Command/_route @@ -196,7 +196,7 @@ if [[ -n $state ]]; then if [[ $line[1] =3D exec ]]; then shift words (( CURRENT-- )) - _normal + _normal -p $service && return elif [[ $line[1] =3D (flush|monitor) ]]; then sequential=3D() fi diff --git a/Completion/Unix/Command/_screen = b/Completion/Unix/Command/_screen index 6d47d2638..9336ae82d 100644 --- a/Completion/Unix/Command/_screen +++ b/Completion/Unix/Command/_screen @@ -107,7 +107,7 @@ if [[ -n $state ]]; then elif (( CURRENT > 2 )) && [[ ${words[1]} =3D=3D /dev/* ]]; then _message "no more parameters" else - _normal + _normal -p $service fi ;; attached-sessions) diff --git a/Completion/Unix/Command/_script = b/Completion/Unix/Command/_script index 7a3960be0..f39cfe535 100644 --- a/Completion/Unix/Command/_script +++ b/Completion/Unix/Command/_script @@ -68,7 +68,7 @@ case $OSTYPE in '-F[send output to specified named pipe]:fifo:_files -g "*(p)"' '-t+[specify interval of data flushing]:interval (seconds)' '-k[log keys sent to the program as well as output]' - '*:::arguments: _normal' + '*:::arguments: _normal $service' ) ;| darwin*|freebsd*) diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh index fd2a90b59..0ba1f3775 100644 --- a/Completion/Unix/Command/_ssh +++ b/Completion/Unix/Command/_ssh @@ -136,7 +136,7 @@ _ssh () { '(-k -c)-s[force sh-style shell]' \ '-t+[set default maximum lifetime for identities]: :_numbers -u = seconds "maximum lifetime" \:s\:seconds m\:minutes h\:hours d\:days = w\:weeks' \ '-v[verbose mode]' \ - '*::command: _normal' + '*::command: _normal -p $service' return ;; ssh-keygen) @@ -738,7 +738,7 @@ _ssh () { local -a _comp_priv_prefix shift 1 words (( CURRENT-- )) - _normal + _normal -p $service return ;; destinations) diff --git a/Completion/Unix/Command/_stdbuf = b/Completion/Unix/Command/_stdbuf index 4b7d98ba0..32b3cae2f 100644 --- a/Completion/Unix/Command/_stdbuf +++ b/Completion/Unix/Command/_stdbuf @@ -27,6 +27,6 @@ for ((i=3D1;i<=3D3;i++)); do "(${short[i]})${long[i]}=3D${(e)opt}" ) done -(( CURRENT > 2 )) && args+=3D( '*::command:_normal' ) +(( CURRENT > 2 )) && args+=3D( '*::command: _normal -p $service' ) =20 _arguments -s -S $args diff --git a/Completion/Unix/Command/_timeout = b/Completion/Unix/Command/_timeout index c041283ac..9c7f1a004 100644 --- a/Completion/Unix/Command/_timeout +++ b/Completion/Unix/Command/_timeout @@ -17,4 +17,4 @@ _arguments -S -A "-" $args \ '(-s --signal)'{-s,--signal}'[specify the signal to send on = timeout]:signal:_signals' \ '(-k --kill-after)'{-k,--kill-after}'[followup first signal with = SIGKILL if command persists after specified time]:time' \ '1: :_numbers -f -u seconds duration :s:seconds m:minutes h:hours = d:days' \ - '*:::command:_normal' + '*:::command: _normal -p $service'