GNU bug report logs - #1560
23.0.60; Cannot use function as value of :height face attribute

Previous Next

Package: emacs;

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

Date: Sat, 13 Dec 2008 18:25:04 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

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 1560 in the body.
You can then email your comments to 1560 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#1560; 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; Cannot use function as value of :height face attribute
Date: Sat, 13 Dec 2008 10:17:23 -0800
emacs -Q
 
M-: (set-face-attribute 'default (selected-frame) :height (quote 1+))
 
gives this error: (error "Invalid face height" 1+)
 
Emacs 22 gives the same error, BTW.
 
But the Elisp manual, node Face Attributes says this:
 
`:height'
Either the font height, an integer in units of 1/10 point, a
floating point number specifying the amount by which to scale the
height of any underlying face, or a function, which is called with
the old height (from the underlying face), and should return the
new height.
 
Am I misunderstanding the doc, or should you be able to use a function
as the value of the :height attribute?
 
What's more, if you do `M-x customize-face RET default', the Value
Menu for attribute Height does not have an item for a function
value. It has only `Height in 1/10 pt' and `Scale'. That suggests, but
doesn't prove, that a function value is not allowed.
 
And grepping the Elisp sources, I see no use of a function value for
:height.
 
Beyond this bug (or my misunderstanding), can we say more about the
kind of function that would be needed? Is it supposed to treat each
kind of :height value: integer, floating-point number, and function?
The doc says the old height (passed to the function) is "from the
underlying face", so I guess this means the actual face height, not
the old value of :height. But which units are used for the actual face
height? Are they too "units of 1/10 point"?
 
 
 
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'
 





Reply sent to Chong Yidong <cyd <at> stupidchicken.com>:
You have taken responsibility. (Thu, 01 Jan 2009 08:35:06 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 08:35:06 GMT) Full text and rfc822 format available.

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

From: Chong Yidong <cyd <at> stupidchicken.com>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 1560-done <at> debbugs.gnu.org
Subject: Re: 23.0.60; Cannot use function as value of :height face attribute
Date: Thu, 01 Jan 2009 03:30:15 -0500
> M-: (set-face-attribute 'default (selected-frame) :height (quote 1+))
> 
> gives this error: (error "Invalid face height" 1+)
> 
> But the Elisp manual, node Face Attributes says this:
> 
> `:height'
> Either the font height, an integer in units of 1/10 point, a
> floating point number specifying the amount by which to scale the
> height of any underlying face, or a function, which is called with
> the old height (from the underlying face), and should return the
> new height.

The default face must always be absolute (i.e., an integer).  I've
clarified the manual.




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

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

Previous Next


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