zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Oliver Kiddle <okiddle@yahoo.co.uk>, zsh workers <zsh-workers@zsh.org>
Subject: Re: PATCH 3/5: _imagemagick: complete all files if image files didn't match
Date: Thu, 13 Aug 2015 13:27:43 -0700	[thread overview]
Message-ID: <150813132743.ZM28791@torch.brasslantern.com> (raw)
In-Reply-To: <12099.1439460739@thecus.kiddle.eu>

On Aug 13, 12:12pm, Oliver Kiddle wrote:
}
} Had I been paying enough attention in 2008 to be opinionated then, I
} would have questioned why we need a special style corresponding to a
} specific user preference that ought to be covered by file-patterns.

As I think I've mentioned elsewhere, file-patterns seems to take
precedence over list-dirst-first anyway.  So I suppose it could be
interpreted as a shorthand, except for the other-files business.

} _files does:
}   [[ "$type" = */* ]] && glob="$glob,*(-/)"
} 
} Either comma was at one time special to _path_files or this was never
} tested. In the patch below, I just remove it.

That bit is probably trying to do the trick of merging together glob
qualifiers, and just gets it wrong.  I.e. here:

    # add `^-/' after `#q' glob qualifier if not there already
    if [[ "$glob" = (#b)(*\(\#q)(*\)) ]]; then
      [[ $match[2] != \^-/* ]] &&
      glob="${match[1]}^-/,${match[2]}"
    else
      glob="$glob(#q^-/)"
    fi

} I would actually be inclined to suggest that other-files should be
} globbed-files: _files is defining three defaults for file-patterns
} corresponding to whether -g, -/ or neither was specified. So how do you
} override just one of those file patterns? If we define _files without a
} -g as being equivalent to _files -g '*(-.)' then a single file-patterns
} default would suffice. It'd also mean all-files would only be used as a
} fallback and globbed-files would be the tag for all the files when no
} glob is specified.

Does it ever make sense to use  _files -g '*(/)' ?  Or should -/ always
be used in that case?

} It would probably be a good
} thing if we can avoid every little completion function needing to do
} stuff like _files -g '*.png(-.)". -/ would mean we actually want to
} select directories. Any opinions?

I'm not sure I understand that part of the issue, yet.

-- 
Barton E. Schaefer


  reply	other threads:[~2015-08-13 20:27 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-12  3:04 PATCH 1/5: _git: various fixes Mikael Magnusson
2015-08-12  3:05 ` PATCH 2/5: _wget: complete headers for --header and add --no-use-server-timestamps Mikael Magnusson
2015-08-12  3:05 ` PATCH 3/5: _imagemagick: complete all files if image files didn't match Mikael Magnusson
2015-08-12 17:20   ` Oliver Kiddle
2015-08-12 18:12     ` Mikael Magnusson
2015-08-12 18:59       ` Bart Schaefer
2015-08-12 19:35         ` Mikael Magnusson
2015-08-12 19:42           ` Bart Schaefer
2015-08-12 20:05         ` Mikael Magnusson
2015-08-12 20:57           ` Bart Schaefer
2015-08-12 21:15             ` Mikael Magnusson
2015-08-12 21:44               ` Bart Schaefer
2015-08-12 22:34                 ` Mikael Magnusson
2015-08-12 22:46                   ` Bart Schaefer
2015-08-12 23:37                     ` Mikael Magnusson
2015-08-13 10:12                     ` Oliver Kiddle
2015-08-13 20:27                       ` Bart Schaefer [this message]
2015-08-14  8:44                         ` Oliver Kiddle
2015-08-14 16:18                           ` Mikael Magnusson
2015-08-14 16:24                             ` Bart Schaefer
2015-08-14 22:31   ` Mikael Magnusson
2015-08-15  0:05     ` Bart Schaefer
2015-08-15  0:52       ` Mikael Magnusson
2015-08-12  3:05 ` PATCH 4/5: _sort: Fix syntax error Mikael Magnusson
2015-08-12  3:05 ` PATCH 5/5: _strftime: Add completion for zsh/datetime's strftime builtin Mikael Magnusson

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=150813132743.ZM28791@torch.brasslantern.com \
    --to=schaefer@brasslantern.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).