GNU bug report logs - #16815
24.3.50; Provide completion for `describe-font' (enhancement request)

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Wed, 19 Feb 2014 21:05:02 UTC

Severity: wishlist

Tags: fixed

Found in version 24.3.50

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 16815 in the body.
You can then email your comments to 16815 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#16815; Package emacs. (Wed, 19 Feb 2014 21:05:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 19 Feb 2014 21:05:03 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; Provide completion for `describe-font' (enhancement request)
Date: Wed, 19 Feb 2014 13:03:43 -0800 (PST)
Subject line says it all.  Please do.

In GNU Emacs 24.3.50.1 (i686-pc-mingw32)
 of 2014-02-11 on ODIEONE
Bzr revision: 116410 lekktu <at> gmail.com-20140211204823-l9l2s6tktfitq266
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/Devel/emacs/binary --enable-checking=yes,glyphs
 'CFLAGS=-O0 -g3' LDFLAGS=-Lc:/Devel/emacs/lib
 CPPFLAGS=-Ic:/Devel/emacs/include'




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16815; Package emacs. (Fri, 29 Apr 2016 17:36:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 16815 <at> debbugs.gnu.org
Subject: Re: bug#16815: 24.3.50;
 Provide completion for `describe-font' (enhancement request)
Date: Fri, 29 Apr 2016 19:35:14 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

> Subject line says it all.  Please do.

Hm...  would that be completion over this?

(fontset-list)
=>
("-DAMA-Ubuntu Mono-normal-normal-normal-*-24-*-*-*-m-0-fontset-startup" "-*-fixed-medium-r-normal-*-16-*-*-*-*-*-fontset-standard" "-*-*-*-*-*-*-*-*-*-*-*-*-fontset-default")

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16815; Package emacs. (Fri, 29 Apr 2016 18:41:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 16815 <at> debbugs.gnu.org
Subject: RE: bug#16815: 24.3.50; Provide completion for `describe-font'
 (enhancement request)
Date: Fri, 29 Apr 2016 11:39:59 -0700 (PDT)
> Hm...  would that be completion over this?
> 
> (fontset-list)
> =>
> ("-DAMA-Ubuntu Mono-normal-normal-normal-*-24-*-*-*-m-0-fontset-startup"
> "-*-fixed-medium-r-normal-*-16-*-*-*-*-*-fontset-standard" "-*-*-*-*-*-*-
> *-*-*-*-*-*-fontset-default")

No.  That is a list of fontsets, not fonts.

The completion candidates should be the installed fonts.

This is what I use, FWIW:

(let ((fonts        (make-hash-table :test #'equal))
      (fontset-lst  (fontset-list)))
  (setq fontset-lst  (delete "-*-*-*-*-*-*-*-*-*-*-*-*-fontset-default"
                             fontset-lst))
  (dolist (ft  (append fontset-lst (x-list-fonts "*"))  fonts)
    (puthash ft t fonts)))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16815; Package emacs. (Fri, 29 Apr 2016 19:24:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: larsi <at> gnus.org, 16815 <at> debbugs.gnu.org
Subject: Re: bug#16815: 24.3.50;
 Provide completion for `describe-font' (enhancement request)
Date: Fri, 29 Apr 2016 22:23:11 +0300
> Date: Fri, 29 Apr 2016 11:39:59 -0700 (PDT)
> From: Drew Adams <drew.adams <at> oracle.com>
> Cc: 16815 <at> debbugs.gnu.org
> 
> This is what I use, FWIW:
> 
> (let ((fonts        (make-hash-table :test #'equal))
>       (fontset-lst  (fontset-list)))
>   (setq fontset-lst  (delete "-*-*-*-*-*-*-*-*-*-*-*-*-fontset-default"
>                              fontset-lst))
>   (dolist (ft  (append fontset-lst (x-list-fonts "*"))  fonts)
>     (puthash ft t fonts)))

IMO, this is madness: you are bloating the Emacs session with hundreds
of fonts, most of which Emacs will never need to use, or even know
about.  We certainly shouldn't do anything like that in Emacs.

The doc string of describe-font clearly says that the font must be one
which Emacs already loaded, so completing on all the _installed_ fonts
is definitely not TRT.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16815; Package emacs. (Fri, 29 Apr 2016 19:35:01 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: larsi <at> gnus.org, 16815 <at> debbugs.gnu.org
Subject: RE: bug#16815: 24.3.50;	Provide completion for `describe-font'
 (enhancement request)
Date: Fri, 29 Apr 2016 12:33:50 -0700 (PDT)
> IMO, this is madness: you are bloating the Emacs session with hundreds
> of fonts, most of which Emacs will never need to use, or even know
> about.  We certainly shouldn't do anything like that in Emacs.

I don't think it is madness.  I (and others) have been taking
advantage of it for a long time.

> The doc string of describe-font clearly says that the font must be one
> which Emacs already loaded, so completing on all the _installed_ fonts
> is definitely not TRT.

I certainly wouldn't have a problem with that: completing against
the installed fonts is fine by me.  My reply to Lars was to make
the point that this is about choosing a font, not choosing a
fontset - completion should be against font names.

[Note: Things are a lot different if you can complete against
parts of the font name, and especially if you can do so
progressively, to narrow down the matching candidates.  If
all you have is a single pattern-match attempt then the
completion behavior is much less helpful/interesting.]




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16815; Package emacs. (Sat, 02 Nov 2019 16:24:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 16815 <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#16815: 24.3.50; Provide completion for `describe-font'
 (enhancement request)
Date: Sat, 02 Nov 2019 17:23:01 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> This is what I use, FWIW:
>> 
>> (let ((fonts        (make-hash-table :test #'equal))
>>       (fontset-lst  (fontset-list)))
>>   (setq fontset-lst  (delete "-*-*-*-*-*-*-*-*-*-*-*-*-fontset-default"
>>                              fontset-lst))
>>   (dolist (ft  (append fontset-lst (x-list-fonts "*"))  fonts)
>>     (puthash ft t fonts)))
>
> IMO, this is madness: you are bloating the Emacs session with hundreds
> of fonts, most of which Emacs will never need to use, or even know
> about.  We certainly shouldn't do anything like that in Emacs.
>
> The doc string of describe-font clearly says that the font must be one
> which Emacs already loaded, so completing on all the _installed_ fonts
> is definitely not TRT.

I'm not sure I understand the objection here.  The form suggested by
Drew just gets a list of font names -- it doesn't load anything, so it
should be harmless?

And the doc string of describe-font seems to be wrong.  You can ask it
to describe a font that's not loaded.  Or at least it seems that way
when I test it.  

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16815; Package emacs. (Sat, 02 Nov 2019 17:26:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 16815 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: Re: bug#16815: 24.3.50; Provide completion for `describe-font'
 (enhancement request)
Date: Sat, 02 Nov 2019 19:25:16 +0200
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: Drew Adams <drew.adams <at> oracle.com>,  16815 <at> debbugs.gnu.org
> Date: Sat, 02 Nov 2019 17:23:01 +0100
> 
> I'm not sure I understand the objection here.  The form suggested by
> Drew just gets a list of font names -- it doesn't load anything, so it
> should be harmless?

A list of many hundreds of long strings is not cheap.  However, ...

> And the doc string of describe-font seems to be wrong.  You can ask it
> to describe a font that's not loaded.  Or at least it seems that way
> when I test it.  

... yes, you are right, sorry.  So please also fix the doc string of
describe-font and the comments inside it, and also the doc string of
font-info, which it calls.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16815; Package emacs. (Sun, 03 Nov 2019 15:34:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: drew.adams <at> oracle.com, 16815 <at> debbugs.gnu.org
Subject: Re: bug#16815: 24.3.50; Provide completion for `describe-font'
 (enhancement request)
Date: Sun, 03 Nov 2019 16:33:29 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> And the doc string of describe-font seems to be wrong.  You can ask it
>> to describe a font that's not loaded.  Or at least it seems that way
>> when I test it.  
>
> ... yes, you are right, sorry.  So please also fix the doc string of
> describe-font and the comments inside it, and also the doc string of
> font-info, which it calls.

OK; done.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 03 Nov 2019 15:34:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 16815 <at> debbugs.gnu.org and Drew Adams <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 03 Nov 2019 15:34:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 02 Dec 2019 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 258 days ago.

Previous Next


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