all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* set-face-attribute and floating point :height values
@ 2011-01-31 20:33 Giorgos Keramidas
  2011-01-31 20:42 ` Glenn Morris
  0 siblings, 1 reply; 6+ messages in thread
From: Giorgos Keramidas @ 2011-01-31 20:33 UTC (permalink / raw)
  To: emacs-devel

My ~/.emacs file now includes the following to fine-tune the default
face for X11 frames:

  (when (display-graphic-p)
    (set-face-attribute 'default nil :family "DejaVu Sans Mono" :width 'ultra-condensed :height 102)
    (require 'color-theme))

The documentation of `set-face-attribute' mentions that :height is
supposed to accept floating point values too:

,----[ C-h f set-face-attribute ]---------------------------------------
| set-face-attribute is a compiled Lisp function in `faces.el'.
|
| (set-face-attribute FACE FRAME &rest ARGS)
|
| Set attributes of FACE on FRAME from ARGS.
| [...]
|
| `:height'
|
| VALUE must be either an integer specifying the height of the font to use
| in 1/10 pt, a floating point number specifying the amount by which to
| scale any underlying face, or a function, which is called with the old
| height (from the underlying face), and should return the new height.
| [...]
`-----------------------------------------------------------------------

But trying to use a floating-point number in my ~/.emacs file throws up
an error, e.g. when I evaluate in my *scratch* buffer the expression:

  (set-face-attribute 'default nil :family "DejaVu Sans Mono" :height 1.4)

a debugger pops up with the following backtrace:

    Debugger entered--Lisp error: (error "Invalid default face height" 1.4)
      internal-set-lisp-face-attribute(default :height 1.4 0)
      set-face-attribute(default nil :family "DejaVu Sans Mono" :width
      ultra-condensed :height 1.4)
      eval((set-face-attribute (quote default) nil :family "DejaVu Sans
      Mono" :width (quote ultra-condensed) :height 1.4))
      eval-last-sexp-1(nil)
      eval-last-sexp(nil)
      call-interactively(eval-last-sexp nil nil)

Is the documentation of `set-face-attribute' out of date, or am I using
it incorrectly?




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-02-01  3:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-31 20:33 set-face-attribute and floating point :height values Giorgos Keramidas
2011-01-31 20:42 ` Glenn Morris
2011-01-31 20:46   ` Giorgos Keramidas
2011-01-31 22:04     ` Drew Adams
2011-02-01  3:09       ` Giorgos Keramidas
2011-02-01  3:56         ` Drew Adams

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.