Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] zsh x font family completion
- X-seq: zsh-workers 38439
- From: Marko Myllynen <myllynen@xxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] zsh x font family completion
- Date: Mon, 9 May 2016 15:54:41 +0300
- 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
- Organization: Red Hat
- Reply-to: Marko Myllynen <myllynen@xxxxxxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author