Subject: Re: Regression: broken completion on modification time
From: Oliver Kiddle <[email-masked]>
To: Dima Kogan <[email-masked]>, zsh-workers <[email-masked]>
Date: Tue, 14 Jun 2016 00:00:45 +0200
List-Id: Zsh Workers List <zsh-workers.zsh.org>

Bart wrote:
> There was some controversy about this when it was added and discussion
> of how to keep it from kicking in if menu selection was NOT enabled,
> but I guess it never got fully resolved.

It should probably at least bail out if the complist module isn't loaded as
per this patch. Or have you got any better ideas on what to check for?

> In the meantime, to mostly get your old behavior back:
>
>     zstyle ':completion:*:dates' max-matches-length 0

You might also want to try enabling menu selection. At a minimum, that
would be:
  zmodload zsh/complist
  zstyle ':completion*:default' menu 'select=0'

Oliver

diff --git a/Completion/Unix/Type/_dates b/Completion/Unix/Type/_dates
index 83397b4..549bab2 100644
--- a/Completion/Unix/Type/_dates
+++ b/Completion/Unix/Type/_dates
@@ -9,7 +9,7 @@
 #   max-matches-length : maximum number or percentage of lines to use for
 #                        completion listing, if both are specified, the
 #                        lowest takes precedence.
-#   format             : override date format
+#   date-format        : override date format
 
 local -a disp cand expl
 local userformat format spacer=1 spacing month monstart skip match
@@ -37,6 +37,7 @@ _tags dates || return 0
 _comp_mesg=yes
 _description -2V -x dates expl date
 compadd "${@:/-X/-x}" "$expl[@]" -
+zmodload -e zsh/complist || return 0
 [[ -n $PREFIX$SUFFIX ]] && return 0
 (( rows )) || return 0
 compstate[list]='packed rows'