GNU bug report logs - #1562
23.0.60; modify-frame-parameters in Emacs 23 for fonts

Previous Next

Packages: emacs, w32;

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

Date: Sat, 13 Dec 2008 19:10:04 UTC

Severity: normal

Tags: fixed

Merged with 119

Found in version 23.0.60

Done: Jason Rumney <jasonr <at> gnu.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 1562 in the body.
You can then email your comments to 1562 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-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1562; Package emacs. 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 Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: <emacs-pretest-bug <at> gnu.org>
Subject: 23.0.60; modify-frame-parameters in Emacs 23 for fonts
Date: Sat, 13 Dec 2008 11:02:30 -0800
[Message part 1 (text/plain, inline)]
See bug #119. Both I and Jason have sent followups to this bug, but
they do not appear in the Outstanding bugs list, AFAICT.

This bug is Outstanding. It was mistakenly put in the "Resolved" (closed?) list.
The bug still exists.
 
In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
 of 2008-11-24 on LENNART-69DE564
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --no-opt --cflags -Ic:/g/include
-fno-crossjumping'

Below is the last mail I sent about this bug. Attached are other mails that seem
to be missing from the bug tracker.


-----Original Message-----
From: Drew Adams Sent: Friday, November 28, 2008 2:36 PM
To: 'Stephen Berman' Cc: 119 <at> debbugs.gnu.org
Subject: bug#119: modify-frame-parameters in Emacs 23 for fonts

> > This bug seems still not to be fixed, and I cannot even 
> > find it listed in the bugs database:
> > http://debbugs.gnu.org/cgi/pkgreport.cgi?pkg=emacs.
> >
> > What is that status of this bug? Is there some other bugs 
> > page where this appears?
> 
> On the above page you can find it by clicking on either of 
> the links in "See the _archived reports_  or _archived and
> unarchived reports_", i.e.,
> http://debbugs.gnu.org/cgi/pkgreport.cgi?orderi
> ng=normal;archive=1;package=emacs;repeatmerged=1
> or
> http://debbugs.gnu.org/cgi/pkgreport.cgi?orderi
ng=normal;archive=both;package=emacs;repeatmerged=1
> 
> Also, you can find it from http://debbugs.gnu.org/ 
> by typing "119" in the textbox below "Find a bug by number:" and
> clicking the "Find" button.

1. Ah, thank you.

I'd propose that a search field be added also to this page:
http://debbugs.gnu.org/cgi/pkgreport.cgi?pkg=emacs,
and that search there be limited to bugs that are in the Emacs package.

That page seems to be the main entry point for Emacs bugs. It makes sense to
have a search field there, IMO.


2. I and Jason have sent followups to this bug that do not appear in the
bug-report page (the archived bugs page cited above). What happened to them? I
have attached them to this mail.

[Message part 2 (message/rfc822, attachment)]
[Message part 3 (message/rfc822, attachment)]
[Message part 4 (message/rfc822, attachment)]
[Message part 5 (message/rfc822, attachment)]
[Message part 6 (message/rfc822, attachment)]

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1562; Package emacs. Full text and rfc822 format available.

Message #8 received at 1562 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 1562 <at> debbugs.gnu.org
Subject: Re: bug#1562: 23.0.60; modify-frame-parameters in Emacs 23 for fonts
Date: Sat, 13 Dec 2008 15:46:44 -0500
Please try to be concise. It seems your mail can be summarized as:

"I still see bug 119".

The 5 attachments would seem to consist of a misunderstanding about
Emacs 22.3 not being Emacs 23.1.

To address your off-topic comments, it would seem bugs cannot be
modified when archived. (This is not the place to discuss the
operation of the bug tracker.)




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1562; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to "Drew Adams" <drew.adams <at> oracle.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #13 received at 1562 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Glenn Morris'" <rgm <at> gnu.org>, <1562 <at> debbugs.gnu.org>
Subject: RE: bug#1562: 23.0.60; modify-frame-parameters in Emacs 23 for fonts
Date: Sat, 13 Dec 2008 13:21:44 -0800
> From: Glenn Morris Sent: Saturday, December 13, 2008 12:47 PM
> Please try to be concise. It seems your mail can be summarized as:
> 
> "I still see bug 119".

Fine. I already sent mail saying that, and it didn't seem to show up. But if the
message has now been successfully passed (by creating a new bug), then that's
good.

> The 5 attachments would seem to consist of a misunderstanding about
> Emacs 22.3 not being Emacs 23.1.

Yes. I included them to point out the problem of updates to the bug not getting
recorded. You can ignore them, now that the message has been delivered. Sorry
for that noise.

> To address your off-topic comments, it would seem bugs cannot be
> modified when archived. (This is not the place to discuss the
> operation of the bug tracker.)

I don't know what the problem was, but what you say makes sense. I hope this bug
gets reopened and finds its place again among the Outstanding bugs. I will send
email about the tracker problem to emacs-devel. Thx. 





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1562; Package emacs. (Wed, 17 Dec 2008 06:33:55 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jason Rumney <jasonr <at> gnu.org>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 17 Dec 2008 06:33:56 GMT) Full text and rfc822 format available.

Message #18 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Jason Rumney <jasonr <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>, 1562 <at> debbugs.gnu.org
Cc: emacs-pretest-bug <at> gnu.org
Subject: Re: bug#1562: 23.0.60; modify-frame-parameters in Emacs 23 for fonts
Date: Sun, 14 Dec 2008 22:48:29 +0800
Drew Adams wrote:
>
> There are two things that might be the problem:
>
> (1) `modify-frame-parameters' changes the `font' parameter behind your
> back from the value you provide `modify-frame-parameters':
>
> (modify-frame-parameters frame
>   (list (cons 'font "-outline-Lucida Console-normal-normal-\
> normal-mono-15-*-*-*-c-*-iso8859-1")))
>
> The `font' frame parameter is then:
>
> "-outline-Lucida Console-normal-normal-normal-mono-15-\
> *-*-*-c-*-fontset-auto8"
>
> IOW, iso8859-1 gets replaced by fontset-auto8.
>

I don't see this. Please try with emacs -Q.


> (2) `x-list-fonts' returns nil when passed such a font (i.e. with
> fontset-auto8).
>
Not a bug.





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1562; Package emacs. (Wed, 17 Dec 2008 06:34:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Drew Adams" <drew.adams <at> oracle.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 17 Dec 2008 06:34:09 GMT) Full text and rfc822 format available.

Message #23 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Jason Rumney'" <jasonr <at> gnu.org>, <1562 <at> debbugs.gnu.org>
Cc: <emacs-pretest-bug <at> gnu.org>
Subject: RE: bug#1562: 23.0.60; modify-frame-parameters in Emacs 23 for fonts
Date: Sun, 14 Dec 2008 09:30:03 -0800
[Message part 1 (text/plain, inline)]
> > (1) `modify-frame-parameters' changes the `font' parameter 
> > behind your back from the value you provide
> > `modify-frame-parameters':
> >
> > (modify-frame-parameters frame
> >   (list (cons 'font "-outline-Lucida Console-normal-normal-\
> > normal-mono-15-*-*-*-c-*-iso8859-1")))
> >
> > The `font' frame parameter is then:
> >
> > "-outline-Lucida Console-normal-normal-normal-mono-15-\
> > *-*-*-c-*-fontset-auto8"
> >
> > IOW, iso8859-1 gets replaced by fontset-auto8.
> 
> I don't see this. Please try with emacs -Q.

See attached file, bug-zoom.el.
emacs -Q, then load the file or eval it a sexp at a time if you want to see the
initial font name etc.

After loading, (frame-parameter nil 'font) gives
"-outline-Lucida Console-normal-normal-normal-mono-14-*-*-*-c-*-iso8859-1"

Then do `C-u 5 M-x enlarge-font'. (frame-parameter nil 'font) gives
"-outline-Lucida Console-normal-normal-normal-mono-19-*-*-*-c-*-iso8859-1"
which is correct.

Then do `C-u -5 M-x enlarge-font'. (frame-parameter nil 'font) gives
"-outline-Lucida Console-normal-normal-normal-mono-14-*-*-*-c-*-fontset-auto1"
which is NOT correct.

The code calls `modify-frame-parameters' with the same 14-point font name that
was returned initially, and which ends in "-iso8859-1", not "-fontset-auto1".
But that's not what the `font' parameter value is after the
`modify-frame-parameters' call.

`M-x debug-on-entry enlarge-font', and you will see, just after this call
(notice that the font name passed as argument is correct):

Debugger entered--returning value: nil
  modify-frame-parameters(#<frame emacs <at> DRADAMS-LAP1 0x2acf600> ((font .
"-outline-Lucida Console-normal-normal-normal-mono-14-*-*-*-c-*-iso8859-1")))

that (frame-parameter nil 'font) gives
"-outline-Lucida Console-normal-normal-normal-mono-14-*-*-*-c-*-fontset-auto1"
which is wrong.

(I also tried using `copy-sequence' to ensure that the string passed is a new
one etc. No improvement.)

Initially, I thought perhaps it had something to do with the call to
`query-fontset' in the commented-out piece of code in `enlarged-font-name',
since `query-fontset' returns a string with "-fontset-auto1" at the end. But the
bug remains, even with that code commented out.

Note too that over time, "-fontset-auto1" becomes "-fontset-auto2", and so on.

The bug seems to be in `modify-frame-parameters'.

FWIW, let me be clear why I would like this bug fixed. While waiting for the
fix, I hacked the code for Emacs 23 to just modify the :height attribute for the
`default' face. That is what most people do, to zoom a frame. That does not give
as many font/frame size possibilities as my code does - it is not as flexible.
So yes, I know there is a rudimentary workaround, but I would like this code to
work again, as it does in Emacs 20, 21, and 22. It doesn't seem right that
`modify-frame-parameters' modifies a frame differently from what you tell it to
do.

[bug-zoom.el (application/octet-stream, attachment)]

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1562; Package emacs. (Wed, 17 Dec 2008 06:35:18 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jason Rumney <jasonr <at> gnu.org>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 17 Dec 2008 06:35:19 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1562; Package emacs. (Wed, 17 Dec 2008 06:35:33 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Drew Adams" <drew.adams <at> oracle.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 17 Dec 2008 06:35:34 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1562; Package emacs. (Mon, 22 Dec 2008 21:55:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Drew Adams" <drew.adams <at> oracle.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 22 Dec 2008 21:55:05 GMT) Full text and rfc822 format available.

Message #38 received at 1562 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: <119 <at> debbugs.gnu.org>, <1562 <at> debbugs.gnu.org>
Subject: RE: bug#119: modify-frame-parameters in Emacs 23 for fonts
Date: Mon, 22 Dec 2008 13:46:22 -0800
I sent this bug report update 2008-11-28. It never showed up in the bug tracker,
AFAICT. I'm guessing that bug #119 was merged with bug #1562, but this message
never showed up for either #119 or #1562. It seems that #119 is still closed and
archived, but #1562 is still open (?).

I thought that I sent a message to control <at> debbugs.gnu.org with this
body, but either I didn't or that did not reopen the bug.

reopen 119
stop

I just tried that again, using the formula that Don gave:

unarchive 119
forcemerge 119 1562
reopen 119
thanks

In any case, the bug is still open.

> From: Drew Adams Sent: Friday, November 28, 2008 2:08 PM
> To: 119 <at> emacsbugs.donarmstrong.com
> Subject: bug#119: modify-frame-parameters in Emacs 23 for fonts
> 
> Perhaps I should have added that the detailed symptoms are 
> the same as before:
> 
> (1) `modify-frame-parameters' changes the `font' parameter behind
>     your back from the value you provide `modify-frame-parameters':
>     (modify-frame-parameters frame
>       (list (cons 'font "-outline-Lucida Console-normal-normal-\
>     normal-mono-15-*-*-*-c-*-iso8859-1")))
>  
>     The `font' frame parameter is then:
>     "-outline-Lucida Console-normal-normal-normal-mono-15-\
>     *-*-*-c-*-fontset-auto8"
>               ^^^^^^^^^^^^^
>  
>    IOW, iso8859-1 gets replaced by fontset-auto8.
> 
> (2) `x-list-fonts' returns nil when passed such a font (i.e. with
>     fontset-auto8).
> 
> 
> > From: Drew Adams Sent: Friday, November 28, 2008 1:38 PM
> > This bug seems still not to be fixed, and I cannot even find 
> > it listed in the bugs database:
> > http://debbugs.gnu.org/cgi/pkgreport.cgi?pkg=emacs.
> > 
> > What is that status of this bug? Is there some other bugs 
> > page where this appears?
> > 
> > AFAICT, this bug persists; it was not fixed by merging the 
> > font-backend. Marking it as fixed seems to have been premature.
> > 
> > Thx - Drew
> > 
> > > From: Drew Adams Sent: Thursday, August 07, 2008 10:38 AM
> > > This bug is marked fixed, but it has not been fixed.
> > > Jason marked it as fixed on 2008-05-08, with this note:
> > > 
> > >   I've marked this as fixed, since the bug reported will
> > >   be fixed when font-backend is merged.
> > >   I will not close it at this time though, as valid points
> > >   about documentation were raised.
> > > 
> > > Then, on 2008-06-12, I received a mail saying that it was
> > > closed. In any case, it is *not* fixed - I see the same
> > > thing in this recent build:
> > > 
> > > GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
> > >  of 2008-08-01 on LENNART-69DE564
> > > Windowing system distributor `Microsoft Corp.', version 5.1.2600
> > > configured using `configure --with-gcc (3.4) --no-opt --cflags
> > >  -Ic:/g/include -fno-crossjumping'
> > > 
> > > There are two things that might be the problem:
> > > 
> > > (1) `modify-frame-parameters' changes the `font' parameter 
> > behind your
> > > back from the value you provide `modify-frame-parameters':
> > > 
> > > (modify-frame-parameters frame
> > >   (list (cons 'font "-outline-Lucida Console-normal-normal-\
> > > normal-mono-15-*-*-*-c-*-iso8859-1")))
> > > 
> > > The `font' frame parameter is then:
> > > 
> > > "-outline-Lucida Console-normal-normal-normal-mono-15-\
> > > *-*-*-c-*-fontset-auto8"
> > > 
> > > IOW, iso8859-1 gets replaced by fontset-auto8.
> > > 
> > > (2) `x-list-fonts' returns nil when passed such a font (i.e. with
> > > fontset-auto8).
> > > 
> > > This breaks my code. Though the frame and the font appear normal,
> > > `x-list-fonts' does not recognize such a font. My code changes the
> > > font name to use a different size (e.g. changes 15 to 14), but it
> > > checks that `x-list-fonts' recognizes the font name 
> before trying to
> > > use it. And `x-list-fonts' does not recognize the name (with
> > > "fontset-auto8") that `modify-frame-parameters' establishes 
> > behind the
> > > scene.
> > > 
> > > The font that I provide to `modify-frame-parameters' is 
> > recognized by
> > > `x-list-fonts', and it has the same appearance, but it 
> never appears
> > > as the frame parameter in this context because
> > > `modify-frame-parameters' substitutes a different name.
> > > 
> > > 
> > > Below is the pertinent part of the original bug report. The 
> > symptom is
> > > the same, but the font that `modify-frame-parameters' 
> substitutes is
> > > slightly different.
> > > 
> > > Back in April, it substituted: 
> > > "-outline-lucida console-normal-roman-normal-mono-15-\
> > > *-*-*-*-*-fontset-startup"
> > > 
> > > Now it substitutes:
> > > "-outline-Lucida Console-normal-normal-normal-mono-15-\
> > > *-*-*-c-*-fontset-auto8"
> > > 
> > > Neither is recognized by `x-list-fonts'.
> > > 
> > > --------8<---------2008-04-05 report -------------------
> > > 
> > > (frame-parameter nil 'font) ->
> > > "-*-Lucida Console-normal-r-*-*-14-*-96-96-c-*-iso8859-1"
> > > 
> > > (modify-frame-parameters
> > >  nil
> > >  (list
> > >   (cons 
> > >    'font
> > >    "-*-Lucida Console-normal-r-*-*-15-*-96-96-c-*-iso8859-1")))
> > > 
> > > (frame-parameter nil 'font) ->
> > > "-outline-lucida 
> > > console-normal-roman-normal-mono-15-*-*-*-*-*-fontset-startup"
> > > 
> > > What's that about? In Emacs 20, 21, and 22, the result is 
> > > just the font I
> > > specified.
> > > 
> > > I have code that zooms frames (font size). I change just the 
> > > point size in the
> > > font spec, using `x-decompose-font-name' and 
> > > `x-compose-font-name'. I check that
> > > the result is a legitimate font using `x-list-fonts'. If not, 
> > > I increase or
> > > decrease the increment until I find the font that works with 
> > > the closest size.
> > > 
> > > [Yes, I know there are other ways to adjust font size, but 
> > > I've found that this
> > > method is flexible for users and provides certain benefits.]
> > > 
> > > My code no longer works without change, because after one call to
> > > `modify-frame-parameters' the font is no longer something 
> > > recognized by
> > > `x-list-fonts'. I can comment out the part that iterates 
> > > until it finds a size
> > > that works (recognized by `x-list-fonts'). That works, but 
> > > I'm still curious
> > > about this. (Is there perhaps a bug in `x-list-fonts' or in
> > > `modify-frame-parameters'?)
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > 
> > 
> > 
> > 
> > 
> > 
> 
> 
> 
> 
> 
> 





Merged 119 1562. Request was from Jason Rumney <jasonr <at> f2s.com> to control <at> emacsbugs.donarmstrong.com. (Tue, 30 Dec 2008 16:00:04 GMT) Full text and rfc822 format available.

bug reassigned from package `emacs' to `emacs,w32'. Request was from Jason Rumney <jasonr <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Tue, 30 Dec 2008 16:10:04 GMT) Full text and rfc822 format available.

Tags added: unreproducible Request was from Jason Rumney <jasonr <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Tue, 30 Dec 2008 23:50:03 GMT) Full text and rfc822 format available.

bug marked as found in version 23.0.60. Request was from Jason Rumney <jasonr <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Thu, 01 Jan 2009 01:50:03 GMT) Full text and rfc822 format available.

Tags removed: unreproducible Request was from Jason Rumney <jasonr <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Thu, 01 Jan 2009 01:50:04 GMT) Full text and rfc822 format available.

Reply sent to Jason Rumney <jasonr <at> gnu.org>:
You have taken responsibility. (Thu, 01 Jan 2009 02:20:03 GMT) Full text and rfc822 format available.

Notification sent to "Drew Adams" <drew.adams <at> oracle.com>:
bug acknowledged by developer. (Thu, 01 Jan 2009 02:20:04 GMT) Full text and rfc822 format available.

Message #53 received at 1562-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Jason Rumney <jasonr <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 1562-done <at> debbugs.gnu.org
Subject: Re: bug#1562: 23.0.60; modify-frame-parameters in Emacs 23 for fonts
Date: Thu, 01 Jan 2009 10:10:49 +0800
Drew Adams wrote:
> After loading, (frame-parameter nil 'font) gives
> "-outline-Lucida Console-normal-normal-normal-mono-14-*-*-*-c-*-iso8859-1"
>
> Then do `C-u 5 M-x enlarge-font'. (frame-parameter nil 'font) gives
> "-outline-Lucida Console-normal-normal-normal-mono-19-*-*-*-c-*-iso8859-1"
> which is correct.
>
> Then do `C-u -5 M-x enlarge-font'. (frame-parameter nil 'font) gives
> "-outline-Lucida Console-normal-normal-normal-mono-14-*-*-*-c-*-fontset-auto1"
> which is NOT correct.
>   

I have fixed this now, x_new_font in w32term.c had not been updated in 
line with xterm.c.





Reply sent to Jason Rumney <jasonr <at> gnu.org>:
You have taken responsibility. (Thu, 01 Jan 2009 02:20:04 GMT) Full text and rfc822 format available.

Notification sent to "Drew Adams" <drew.adams <at> oracle.com>:
bug acknowledged by developer. (Thu, 01 Jan 2009 02:20:05 GMT) Full text and rfc822 format available.

Message #59 received at 1562-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Jason Rumney'" <jasonr <at> gnu.org>
Cc: <1562-done <at> debbugs.gnu.org>
Subject: RE: bug#1562: 23.0.60; modify-frame-parameters in Emacs 23 for fonts
Date: Wed, 31 Dec 2008 21:04:36 -0800
> > After loading, (frame-parameter nil 'font) gives
> > "-outline-Lucida 
> Console-normal-normal-normal-mono-14-*-*-*-c-*-iso8859-1"
> >
> > Then do `C-u 5 M-x enlarge-font'. (frame-parameter nil 'font) gives
> > "-outline-Lucida 
> Console-normal-normal-normal-mono-19-*-*-*-c-*-iso8859-1"
> > which is correct.
> >
> > Then do `C-u -5 M-x enlarge-font'. (frame-parameter nil 'font) gives
> > "-outline-Lucida 
> Console-normal-normal-normal-mono-14-*-*-*-c-*-fontset-auto1"
> > which is NOT correct.
> >   
> 
> I have fixed this now, x_new_font in w32term.c had not been 
> updated in 
> line with xterm.c.

Thanks - looking forward to it.

 - Drew





Message #60 received at 1562-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Jason Rumney'" <jasonr <at> gnu.org>
Cc: <1562-done <at> debbugs.gnu.org>
Subject: RE: bug#1562: 23.0.60; modify-frame-parameters in Emacs 23 for fonts
Date: Tue, 13 Jan 2009 09:12:06 -0800
> From: Jason Rumney Sent: Wednesday, December 31, 2008 6:11 PM
> > After loading, (frame-parameter nil 'font) gives
> > "-outline-Lucida Console-normal-normal-normal-mono-14-*-*-*-c-*-iso8859-1"
> >
> > Then do `C-u 5 M-x enlarge-font'. (frame-parameter nil 'font) gives
> > "-outline-Lucida Console-normal-normal-normal-mono-19-*-*-*-c-*-iso8859-1"
> > which is correct.
> >
> > Then do `C-u -5 M-x enlarge-font'. (frame-parameter nil 'font) gives
> > "-outline-Lucida
Console-normal-normal-normal-mono-14-*-*-*-c-*-fontset-auto1"
> > which is NOT correct.   
> 
> I have fixed this now, x_new_font in w32term.c had not been 
> updated in line with xterm.c.

I just obtained a build from 2009-01-04, and was able to check this.
Unfortunately, it is still not fixed. Please reopen this bug.

With this initial font parameter:

(font . "-outline-Lucida
Console-normal-normal-normal-mono-14-*-*-*-c-*-iso8859-1")

I call this:

(modify-frame-parameters frame '((font . "-outline-Lucida
Console-normal-normal-normal-mono-6-*-*-*-c-*-iso8859-1")))

And (frame-parameters) then shows this:

(font . "-outline-Lucida
Console-normal-normal-normal-mono-6-*-*-*-c-*-fontset-auto5")

Exactly the same symptom as before. The "fontset-autoN" is inappropriate, and is
not recognized by `x-list-fonts'. `modify-frame-parameters' is still not
respecting the input I give it - it sets the font so something entirely
different.

---

Below is the code I used, but you need not use all of it to duplicate the bug,
no doubt - the above info should be sufficient.

(defun enlarge-font (&optional increment frame)
    "Increase size of font in FRAME by INCREMENT.
Interactively, INCREMENT is given by the prefix argument.
Optional FRAME parameter defaults to current frame."
    (interactive "p")
    (setq frame (or frame (selected-frame)))
    (let ((fontname (cdr (assq 'font (frame-parameters frame))))
          (count enlarge-font-tries))
      (setq fontname (enlarged-font-name fontname frame increment))
      (while (and (not (x-list-fonts fontname)) (wholenump (setq count (1-
count))))
        (setq fontname (enlarged-font-name fontname frame increment)))
      (unless (x-list-fonts fontname) (error "Cannot change font size"))
      (modify-frame-parameters frame (list (cons 'font fontname)))
      ;; Update faces that want a bold or italic version of the default font.
      (frame-update-faces frame)))

(defun enlarged-font-name (fontname frame increment)
    "FONTNAME, after enlarging font size of FRAME by INCREMENT.
FONTNAME is the font of FRAME."
    (when (query-fontset fontname)
      (let ((ascii (assq 'ascii (aref (fontset-info fontname frame) 2))))
        (when ascii (setq fontname (nth 2 ascii)))))
    (let ((xlfd-fields (x-decompose-font-name fontname)))
      (unless xlfd-fields (error "Cannot decompose font name"))
      (let ((new-size (+ (string-to-number (aref xlfd-fields
xlfd-regexp-pixelsize-subnum))
                         increment)))
        (unless (> new-size 0) (error "New font size is too small: %s"
new-size))
        (aset xlfd-fields xlfd-regexp-pixelsize-subnum (number-to-string
new-size)))
      ;; Set point size & width to "*", so frame width will adjust to new font
size
      (aset xlfd-fields xlfd-regexp-pointsize-subnum "*")
      (aset xlfd-fields xlfd-regexp-avgwidth-subnum "*")
      (x-compose-font-name xlfd-fields)))

(defcustom enlarge-font-tries 100
    "Number of times to try to change font-size, when looking for a font.
The font-size portion of a font name is incremented or decremented at
most this many times, before giving up and raising an error."
    :type 'integer :group 'Frame-Commands)





Message #61 received at 1562-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Jason Rumney'" <jasonr <at> gnu.org>
Cc: <1562-done <at> debbugs.gnu.org>
Subject: RE: bug#1562: 23.0.60; modify-frame-parameters in Emacs 23 for fonts
Date: Tue, 13 Jan 2009 09:17:32 -0800
Forgot the build info:

In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
 of 2009-01-04 on LENNART-69DE564
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --no-opt --cflags -Ic:/g/include
-fno-crossjumping' 





Message #62 received at 1562-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Jason Rumney <jasonr <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 1562-done <at> debbugs.gnu.org
Subject: Re: bug#1562: 23.0.60; modify-frame-parameters in Emacs 23 for fonts
Date: Wed, 14 Jan 2009 20:14:11 +0800
Drew Adams wrote:
> With this initial font parameter:
>
> (font . "-outline-Lucida
> Console-normal-normal-normal-mono-14-*-*-*-c-*-iso8859-1")
>
> I call this:
>
> (modify-frame-parameters frame '((font . "-outline-Lucida
> Console-normal-normal-normal-mono-6-*-*-*-c-*-iso8859-1")))
>   

I found it necessary to make a further call to modify-frame-parameters 
with a previously used font name before the bug will appear.

It seems that my previous fix only fixed things when font-config style 
font names ("Lucida Console-11", "Lucida Console-8") were used. A 
similar fix was required in x-set-font to cover xlfd font names as well. 
This surprises me, as the problem was only reproducible on Windows, but 
this latter change was in generic code.

Thanks for checking.





Message #63 received at 1562-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Jason Rumney'" <jasonr <at> gnu.org>
Cc: <1562-done <at> debbugs.gnu.org>
Subject: RE: bug#1562: 23.0.60; modify-frame-parameters in Emacs 23 for fonts
Date: Wed, 14 Jan 2009 07:11:01 -0800
> > With this initial font parameter:
> >
> > (font . "-outline-Lucida
> > Console-normal-normal-normal-mono-14-*-*-*-c-*-iso8859-1")
> >
> > I call this:
> >
> > (modify-frame-parameters frame '((font . "-outline-Lucida
> > Console-normal-normal-normal-mono-6-*-*-*-c-*-iso8859-1")))
> >   
> 
> I found it necessary to make a further call to 
> modify-frame-parameters with a previously used font name
> before the bug will appear.
> 
> It seems that my previous fix only fixed things when 
> font-config style font names ("Lucida Console-11", "Lucida Console-8")
> were used. A similar fix was required in x-set-font to cover xlfd font 
> names as well. This surprises me, as the problem was only reproducible 
> on Windows, but this latter change was in generic code.
> 
> Thanks for checking.

Not sure if you're also saying that this is now fixed - I guess so. Thanks. I'll
check again when I get a newer build.





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Wed, 11 Feb 2009 15:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 16 years and 138 days ago.

Previous Next


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