zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: zsh-workers@zsh.org
Subject: Re: X font completion is buggy
Date: Sat, 25 Jul 2015 00:50:19 +0200	[thread overview]
Message-ID: <10638.1437778219@thecus.kiddle.eu> (raw)
In-Reply-To: <20150724214952.GA15359@zira.vinc17.org>

Vincent Lefevre wrote:
> 
> zira:~> xterm -fn fixed--

Trying to fix this without understanding what _x_font is doing would lead me
to the following patch. 
But this will still result in stuff like:
Warning: Cannot convert string "-adobe-courier-bold-o-normal--" to type FontStruct

Anyone know what might be special about two dashes or was it just an
attempt to reduce the number of matches?. It is also passing -S ''
to compadd which backs up that theory: it only makes sense with the
incomplete fonts. The line is little changed since it was added in 7480
(Aug 1999).

These days, xft fonts tend to be more useful so you might instead want to try
the -fa option to xterm. e.g: xterm -fa Inconsolata

Oliver

diff --git a/Completion/X/Type/_x_font b/Completion/X/Type/_x_font
index a363b27..368b6a6 100644
--- a/Completion/X/Type/_x_font
+++ b/Completion/X/Type/_x_font
@@ -9,7 +9,7 @@ _tags fonts || return 1
 if (( ! $+_font_cache )); then
   typeset -gU _font_cache
 
- _font_cache=( "${(@)^${(@f)$(_call_program fonts xlsfonts 2> /dev/null)}%%--*}--" )
+ _font_cache=( ${${(f)"$(_call_program fonts xlsfonts)"}/--*/--} )
 fi
 
 _wanted fonts expl font \


  reply	other threads:[~2015-07-24 22:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-24 21:49 Vincent Lefevre
2015-07-24 22:50 ` Oliver Kiddle [this message]
2015-07-24 23:31   ` Bart Schaefer
2015-07-25  8:30     ` Oliver Kiddle
2015-07-26 21:10       ` Vincent Lefevre
2015-07-26 21:41         ` Bart Schaefer
2015-07-26 22:29           ` Mikael Magnusson
2015-07-26 23:01           ` Vincent Lefevre
2015-07-27  3:19             ` Bart Schaefer
2015-07-27  5:11               ` Mikael Magnusson
2015-07-27 15:40                 ` Bart Schaefer
2015-07-25  1:28   ` Vincent Lefevre
2015-07-24 23:07 ` Bart Schaefer
2015-07-25  0:47   ` Vincent Lefevre

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=10638.1437778219@thecus.kiddle.eu \
    --to=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).