GNU bug report logs - #74362
31.0.50; Add completions for font names

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Thu, 14 Nov 2024 22:50:02 UTC

Severity: normal

Found in version 31.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #32 received at 74362 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 74362 <at> debbugs.gnu.org
Subject: Re: bug#74362: 31.0.50; Add completions for font names
Date: Sat, 16 Nov 2024 18:32:31 +0200
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: 74362 <at> debbugs.gnu.org
> Date: Sat, 16 Nov 2024 10:12:21 -0500
> 
> >> > Also, the doc string of customize-face should be amended to say that
> >> > it offers completion on fonts.
> >> Hmm... the docstring currently doesn't describe the UI at all (and
> >> I can't think of a reason why it should).  Similarly the manual doesn't
> >> seem to describe any part of the UI of `customize-face`.
> >> Apparently, we presume the UI is self-explanatory.  If we want to fix
> >> that, I think it's beyond the scope of this patch submission.
> > How about mentioning the completion in the help-echo of this field?
> 
> I don't understand why you'd want that, so I don't know how it should be
> phrased.  Can you point to some other help-echo which states such
> a thing, for inspiration?

It is unusual, yes.  But it is also unusual to expect completion in
any such field, since it is not the minibuffer.

Anyway, it isn't worth the argument, just forget it.  I can make such
a change myself if I think it's a good thing.

> > Btw, could set-face-font also benefit from this improvement?
> 
> AFAICT `set-face-font` already has its own completion.

Right, it just expects an unusual character as the first character of
a font's name.

> >> +        ;; Cache the list for a max of 60s.
> >> +        (let ((time (float-time)))
> >> +         (if (and lastlist (eq (selected-frame) lastframe)
> >> +                  (> 60 (- time lasttime)))
> > Maybe the 60 thing should be a defvar?
> 
> I doubt it's worth the trouble, but if you insist I'll do that.

Someone will ask for that even if I don't ;-)

> >> +	     :completions custom-face--font-completion
> >>  	     :help-echo "Font family or fontset alias name."))
> >
> > I'm curious: how come :foreground and :background don't need a
> > :completions specifier, and yet they provide completion OOTB?
> 
> Because those use the `color` widget defined in `wid-edit.el`:

Got it, thanks.

(Maybe we should have a 'font' widget, then, in some distant future.)




This bug report was last modified 242 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.