From: Marko Myllynen <myllynen@redhat.com>
To: zsh-workers@zsh.org
Subject: [PATCH] zsh x font family completion
Date: Mon, 9 May 2016 15:54:41 +0300 [thread overview]
Message-ID: <57308891.6070906@redhat.com> (raw)
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,
--
Marko Myllynen
next reply other threads:[~2016-05-09 12:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-09 12:54 Marko Myllynen [this message]
2016-05-09 13:04 ` Mikael Magnusson
2016-05-11 11:53 ` Marko Myllynen
2016-05-11 15:01 ` Oliver Kiddle
2016-05-12 13:02 ` Marko Myllynen
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=57308891.6070906@redhat.com \
--to=myllynen@redhat.com \
--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).