Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] zsh: fix man completion
@ 2022-10-07 21:26 balejk
  2022-10-07 21:34 ` [PR PATCH] [Updated] " balejk
  2022-10-08  0:26 ` [PR PATCH] [Closed]: " ahesford
  0 siblings, 2 replies; 3+ messages in thread
From: balejk @ 2022-10-07 21:26 UTC (permalink / raw)
  To: ml

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

There is a new pull request by balejk against master on the void-packages repository

https://github.com/balejk/void-packages zsh_man_completion
https://github.com/void-linux/void-packages/pull/39798

zsh: fix man completion
Fixes #39797.


A patch file from https://github.com/void-linux/void-packages/pull/39798.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-zsh_man_completion-39798.patch --]
[-- Type: text/x-diff, Size: 3014 bytes --]

From 2eac3bd4beb693624ff22cf40a26079df498a4f1 Mon Sep 17 00:00:00 2001
From: Karel Balej <balejk@matfyz.cz>
Date: Fri, 7 Oct 2022 23:20:12 +0200
Subject: [PATCH] zsh: backport https://zsh.org/workers/50278

---
 srcpkgs/zsh/patches/50278.patch | 76 +++++++++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)
 create mode 100644 srcpkgs/zsh/patches/50278.patch

diff --git a/srcpkgs/zsh/patches/50278.patch b/srcpkgs/zsh/patches/50278.patch
new file mode 100644
index 000000000000..48c09ef6df07
--- /dev/null
+++ b/srcpkgs/zsh/patches/50278.patch
@@ -0,0 +1,76 @@
+commit 1e52cd968d7ffd9da3249ef01f6c41f8b29e4df3
+Author: Bart Schaefer <schaefer@zsh.org>
+Date:   Sun May 22 15:50:45 2022 -0700
+
+    50278: use `man -w` in preference to `manpath`; fix caching and precedence of -M
+
+diff --git a/Completion/Unix/Command/_man b/Completion/Unix/Command/_man
+index dba1d13dc..190811e41 100644
+--- a/Completion/Unix/Command/_man
++++ b/Completion/Unix/Command/_man
+@@ -16,7 +16,7 @@
+ _man() {
+   local dirs expl mrd awk variant noinsert
+   local -a context line state state_descr args modes
+-  local -aU sects
++  local -aU sects _manpath
+   local -A opt_args val_args sect_descs
+ 
+   if [[ $service == man ]]; then
+@@ -168,29 +168,40 @@ _man() {
+   _arguments -s -S : $args '*::: :->man' && return 0
+   [[ -n $state ]] || return 1
+ 
++  # Override man path
++  [[ -n ${opt_args[-M]} ]] &&
++  _manpath=( ${(s<:>)opt_args[-M]} )
++
++  # Restore cached man path to avoid $(manpath) if we can
+   if (( ! $#_manpath )); then
+-    local mp
+-    mp=( ${(s.:.)$(manpath 2>/dev/null)} )
+-    [[ "$mp" == *:* ]] && mp=( ${(s.:.)mp} )
+-    if (( $#mp )); then
+-      _manpath=( $mp )
+-    elif (( $#manpath )); then
+-      _manpath=( $manpath )
++    if (( ! $+_manpath_cache )); then
++      typeset -gHA _manpath_cache
+     fi
++    if [[ -z $_manpath_cache[$MANPATH] ]]; then
++      local mp
++      mp=( ${(s.:.)$({ command man -w || manpath } 2>/dev/null)} )
++      [[ "$mp" == *:* ]] && mp=( ${(s.:.)mp} )
++      if (( $#mp )); then
++        _manpath_cache[$MANPATH]=${(j.:.)mp}
++      elif (( $#manpath )); then
++        _manpath_cache[$MANPATH]=$MANPATH
++      fi
++    fi
++    _manpath=( ${(s.:.)_manpath_cache[$MANPATH]} )
++  fi
++
++  # Augment man path
++  if [[ -n ${opt_args[-m]} ]]; then
++    [[ $variant == (netbsd|openbsd)* ]] &&
++    _manpath+=( ${(s<:>)opt_args[-m]} )
++  elif [[ $variant == aix* ]]; then
++    # _manpath declared -U so no need to test
++    _manpath+=( /usr/share/man )
+   fi
+ 
+   (( $#_manpath )) ||
+       _manpath=( /usr/man(-/) /(opt|usr)/(pkg|dt|share|X11R6|local)/(cat|)man(-/) )
+ 
+-  # Override man path
+-  [[ -n ${opt_args[-M]} ]] &&
+-  _manpath=( ${(s<:>)opt_args[-M]} )
+-
+-  # Augment man path
+-  [[ $variant == (netbsd|openbsd)* ]] &&
+-  [[ -n ${opt_args[-m]} ]] &&
+-  _manpath+=( ${(s<:>)opt_args[-m]} )
+-
+   # `sman' is the SGML manual directory for Solaris 7.
+   # 1M is system administrator commands on SVR4
+ 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PR PATCH] [Updated] zsh: fix man completion
  2022-10-07 21:26 [PR PATCH] zsh: fix man completion balejk
@ 2022-10-07 21:34 ` balejk
  2022-10-08  0:26 ` [PR PATCH] [Closed]: " ahesford
  1 sibling, 0 replies; 3+ messages in thread
From: balejk @ 2022-10-07 21:34 UTC (permalink / raw)
  To: ml

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

There is an updated pull request by balejk against master on the void-packages repository

https://github.com/balejk/void-packages zsh_man_completion
https://github.com/void-linux/void-packages/pull/39798

zsh: fix man completion
Fixes #39797.


A patch file from https://github.com/void-linux/void-packages/pull/39798.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-zsh_man_completion-39798.patch --]
[-- Type: text/x-diff, Size: 3406 bytes --]

From c0fda7247b5ae90ca3c3f90f3a162f25e1126413 Mon Sep 17 00:00:00 2001
From: Karel Balej <balejk@matfyz.cz>
Date: Fri, 7 Oct 2022 23:20:12 +0200
Subject: [PATCH] zsh: backport https://zsh.org/workers/50278

---
 srcpkgs/zsh/patches/50278.patch | 76 +++++++++++++++++++++++++++++++++
 srcpkgs/zsh/template            |  2 +-
 2 files changed, 77 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/zsh/patches/50278.patch

diff --git a/srcpkgs/zsh/patches/50278.patch b/srcpkgs/zsh/patches/50278.patch
new file mode 100644
index 000000000000..48c09ef6df07
--- /dev/null
+++ b/srcpkgs/zsh/patches/50278.patch
@@ -0,0 +1,76 @@
+commit 1e52cd968d7ffd9da3249ef01f6c41f8b29e4df3
+Author: Bart Schaefer <schaefer@zsh.org>
+Date:   Sun May 22 15:50:45 2022 -0700
+
+    50278: use `man -w` in preference to `manpath`; fix caching and precedence of -M
+
+diff --git a/Completion/Unix/Command/_man b/Completion/Unix/Command/_man
+index dba1d13dc..190811e41 100644
+--- a/Completion/Unix/Command/_man
++++ b/Completion/Unix/Command/_man
+@@ -16,7 +16,7 @@
+ _man() {
+   local dirs expl mrd awk variant noinsert
+   local -a context line state state_descr args modes
+-  local -aU sects
++  local -aU sects _manpath
+   local -A opt_args val_args sect_descs
+ 
+   if [[ $service == man ]]; then
+@@ -168,29 +168,40 @@ _man() {
+   _arguments -s -S : $args '*::: :->man' && return 0
+   [[ -n $state ]] || return 1
+ 
++  # Override man path
++  [[ -n ${opt_args[-M]} ]] &&
++  _manpath=( ${(s<:>)opt_args[-M]} )
++
++  # Restore cached man path to avoid $(manpath) if we can
+   if (( ! $#_manpath )); then
+-    local mp
+-    mp=( ${(s.:.)$(manpath 2>/dev/null)} )
+-    [[ "$mp" == *:* ]] && mp=( ${(s.:.)mp} )
+-    if (( $#mp )); then
+-      _manpath=( $mp )
+-    elif (( $#manpath )); then
+-      _manpath=( $manpath )
++    if (( ! $+_manpath_cache )); then
++      typeset -gHA _manpath_cache
+     fi
++    if [[ -z $_manpath_cache[$MANPATH] ]]; then
++      local mp
++      mp=( ${(s.:.)$({ command man -w || manpath } 2>/dev/null)} )
++      [[ "$mp" == *:* ]] && mp=( ${(s.:.)mp} )
++      if (( $#mp )); then
++        _manpath_cache[$MANPATH]=${(j.:.)mp}
++      elif (( $#manpath )); then
++        _manpath_cache[$MANPATH]=$MANPATH
++      fi
++    fi
++    _manpath=( ${(s.:.)_manpath_cache[$MANPATH]} )
++  fi
++
++  # Augment man path
++  if [[ -n ${opt_args[-m]} ]]; then
++    [[ $variant == (netbsd|openbsd)* ]] &&
++    _manpath+=( ${(s<:>)opt_args[-m]} )
++  elif [[ $variant == aix* ]]; then
++    # _manpath declared -U so no need to test
++    _manpath+=( /usr/share/man )
+   fi
+ 
+   (( $#_manpath )) ||
+       _manpath=( /usr/man(-/) /(opt|usr)/(pkg|dt|share|X11R6|local)/(cat|)man(-/) )
+ 
+-  # Override man path
+-  [[ -n ${opt_args[-M]} ]] &&
+-  _manpath=( ${(s<:>)opt_args[-M]} )
+-
+-  # Augment man path
+-  [[ $variant == (netbsd|openbsd)* ]] &&
+-  [[ -n ${opt_args[-m]} ]] &&
+-  _manpath+=( ${(s<:>)opt_args[-m]} )
+-
+   # `sman' is the SGML manual directory for Solaris 7.
+   # 1M is system administrator commands on SVR4
+ 
diff --git a/srcpkgs/zsh/template b/srcpkgs/zsh/template
index 44550da3b66e..ae3b90fbca30 100644
--- a/srcpkgs/zsh/template
+++ b/srcpkgs/zsh/template
@@ -1,7 +1,7 @@
 # Template file for 'zsh'
 pkgname=zsh
 version=5.9
-revision=1
+revision=2
 build_style=gnu-configure
 make_build_target="all info"
 make_install_args="install.info"

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PR PATCH] [Closed]: zsh: fix man completion
  2022-10-07 21:26 [PR PATCH] zsh: fix man completion balejk
  2022-10-07 21:34 ` [PR PATCH] [Updated] " balejk
@ 2022-10-08  0:26 ` ahesford
  1 sibling, 0 replies; 3+ messages in thread
From: ahesford @ 2022-10-08  0:26 UTC (permalink / raw)
  To: ml

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

There's a closed pull request on the void-packages repository

zsh: fix man completion
https://github.com/void-linux/void-packages/pull/39798

Description:
Fixes #39797.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-08  0:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-07 21:26 [PR PATCH] zsh: fix man completion balejk
2022-10-07 21:34 ` [PR PATCH] [Updated] " balejk
2022-10-08  0:26 ` [PR PATCH] [Closed]: " ahesford

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).