zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Oliver Kiddle <okiddle@yahoo.co.uk>
Cc: Zsh workers <zsh-workers@zsh.org>
Subject: Re: PATCH: completion of dates
Date: Fri, 10 Jul 2015 20:37:23 +0200	[thread overview]
Message-ID: <CAHYJk3SwiyDXxQD4kfGUdEq+K2hn3F5TY2eBOxo30cph+OLVqg@mail.gmail.com> (raw)
In-Reply-To: <27798.1436519486@thecus.kiddle.eu>

On Fri, Jul 10, 2015 at 11:11 AM, Oliver Kiddle <okiddle@yahoo.co.uk> wrote:
> Mikael Magnusson wrote:
>> I don't really like this change. I usually forget the order for m3M+
>> glob qualifiers, so it's handy to just press tab to see when which is
>> valid, but now it starts autofilling stuff instead, and scrolling off
>> everything else on my terminal. It also doesn't seem to insert
>> anything actually sensible... but even if the bugs are fixed I would
>> prefer to turn the whole thing off. :)
>
> It can be turned off with:
>   zstyle ':completion:*:dates' max-matches-length 0
> If the function stays, I can add some documentation for that.
>
> The line of _dates which causes the autofilling is:
>   compstate[insert]=menu:$(( compstate[nmatches] + $#disp ))
>
> Other places where we set compstate[insert] in a similar manner include
> _pids and _mpc where we have insert-ids and insert-song-numbers styles
> to control this. I could do something similar here. Any thoughts
> on a style name: I think it is better to reuse generic names (i.e.
> insert-ids) rather than name it insert-dates? Would you be happy with
> that as a way forward? I wish it was possible to simply colour the
> current date but a pattern to do that would match, e.g. the 10th of
> every month.
>
> Could you elaborate on "the bugs"? Issues could be reliant on your
> timezone/setup/terminal and so not obvious to me. The issue mentioned by
> Bart is a general menu selection thing.
>
> Oliver

Before the patch, I get output like this:
% *(m<tab>
---- time specifier
M  -- months
d  -- days
h  -- hours
m  -- minutes
s  -- seconds
w  -- weeks
---- sense
+  -- more than
-  -- less than
---- digit (days)

With the patch and the max-matches-length 0 style set, I get this:
% *(m<tab>
---- time specifier
seconds  hours    weeks    seconds  hours    weeks    seconds  hours
 weeks
minutes  days     Months   minutes  days     Months   minutes  days
 Months
---- sense
before    exactly   since     before    exactly   since     before
exactly   since
---- ---- digit (days)

Pressing tab further times cycles through smhdwM three times before
moving on to +-+-+-. The output is not super helpful either since it
doesn't tell me what the syntax is without selecting the entry itself
to see what gets inserted. I suppose it does fit my stated goal of
seeing which order I should write the stuff in though.

I think the other "bug" I was thinking of was just me not knowing what
format find expects arguments to -mtime to be in.

-- 
Mikael Magnusson


  parent reply	other threads:[~2015-07-10 18:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-07 15:32 Oliver Kiddle
2015-07-07 16:32 ` Bart Schaefer
2015-07-07 22:09   ` Oliver Kiddle
2015-07-07 22:38     ` Bart Schaefer
2015-07-10  0:00 ` Mikael Magnusson
2015-07-10  9:11   ` Oliver Kiddle
2015-07-10 18:22     ` Daniel Shahaf
2015-07-10 18:37     ` Mikael Magnusson [this message]
2015-07-10 23:37       ` Bart Schaefer
2015-07-11 23:25         ` Oliver Kiddle
2015-07-13  5:44           ` Bart Schaefer
2015-07-13 22:08             ` Oliver Kiddle
2015-07-14  4:04               ` Bart Schaefer

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=CAHYJk3SwiyDXxQD4kfGUdEq+K2hn3F5TY2eBOxo30cph+OLVqg@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=okiddle@yahoo.co.uk \
    --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).