Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] zsh x font family completion
- X-seq: zsh-workers 38443
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Marko Myllynen <myllynen@xxxxxxxxxx>
- Subject: Re: [PATCH] zsh x font family completion
- Date: Mon, 9 May 2016 15:04:24 +0200
- Cc: zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=i/miHMonm3vQWuEFkUatlgyHMdPtKHGT1wa9WzkEXi0=; b=emFTmbuqLKjAnBnVD+GTj9yTTytr4CNFUazLM4j3uZAFM8pWcRblbORfFKOEIdw1oa VIWzTb9bTytyw43r+TKtfIE/pqvn07YF3ZRDbopA7w+F+clgNckkKB+5L/jfni+rgES1 xKcRwgyLLJ3DAWh1d9RhWfLQ3oR40u7AzQrwNwld7J9Csn6BuPtXgTsi8+Kcr1MsC767 ZDJu//akd5FfyotTKbjINKLBOPuuhOEvtChXBlNu2Jg5M0jja1hKPL4qsR1tPrnfN6AY MHICKDfbwT8YF1/B2IX8mzk3YuasuBq7DZNSTy/1cSYMn6CHNRRzDfOWtH9/fQPlI/R1 zo4Q==
- In-reply-to: <57308891.6070906@redhat.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <57308891.6070906@redhat.com>
On Mon, May 9, 2016 at 2:54 PM, Marko Myllynen <myllynen@xxxxxxxxxx> wrote:
> Hi,
>
> I'm working on completions for a command which has an option to select
> the font family to use, I was wondering whether X font family
> completions would be worthwhile to add for others to use as well?
>
> Currently there's no any kind of caching, not sure would that be needed
> on modern systems? When I looked at x_font for inspiration, it had a
> big fat sign that its caching "*has* to be improved" so not sure what
> would be considered elegant or optimal here.
>
> Tested on RHEL 7.
>
> ---
> Completion/X/Type/_x_font_family | 6 ++++++
> 1 file changed, 6 insertions(+)
> create mode 100644 Completion/X/Type/_x_font_family
>
> diff --git a/Completion/X/Type/_x_font_family b/Completion/X/Type/_x_font_family
> new file mode 100644
> index 0000000..48a1f23
> --- /dev/null
> +++ b/Completion/X/Type/_x_font_family
> @@ -0,0 +1,6 @@
> +#autoload
> +
> +local expl
> +
> +_wanted font-families expl 'font family' compadd "$@" \
> + ${(f)"$(fc-list : -f "%{family|downcase|delete( )|translate(\,,\n)}\n")"}
>
> Thanks,
It would probably be less confusing if this was called
_fc_font_family, since X fonts are something else. This one should
probably not even be in the X/ directory.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author