Subject: bug#17486: 24.4.50; set-face-font problem on OSX

From: Christian Lynbech <[email-masked]>
Date: Tue, 13 May 2014 20:21:20 +0200

There is an issue when trying to set the font of face in recent versions
of emacs build for OSX.

Evaluating this form works as expected:

    (set-face-font 'region "-*-Menlo-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1")

It used to be that one could also say something like this:

    (set-face-font 'region  "bitstream vera sans mono-26")

but when I try to do that on a newly built emacs, I get this stack
trace:

    Debugger entered--Lisp error: (wrong-type-argument font [#<font-entity ns apple Menlo nil iso10646-1 medium normal normal 0 nil 100 0 nil>])
      internal-set-lisp-face-attribute(region :font "bitstream vera sans mono-26" 0)
      set-face-attribute(region nil :font "bitstream vera sans mono-26")
      set-face-font(region "bitstream vera sans mono-26")
      eval((set-face-font (quote region) "bitstream vera sans mono-26") nil)
      eval-last-sexp-1(nil)
      eval-last-sexp(nil)
      call-interactively(eval-last-sexp nil nil)
      command-execute(eval-last-sexp)

The frame-parameters is as follows:

    ((tool-bar-position . top) (parent-id) (explicit-name) (display . "christians-imac") (visibility . t) (icon-name) (window-id . "1") (bottom-divider-width . 0) (right-divider-width . 0) (top . 385) (left . 1286) (buried-buffer-list #<buffer *Backtrace*> #<buffer *Completions*>) (buffer-list #<buffer *scratch*> #<buffer *Faces*> #<buffer *GNU Emacs*> #<buffer  *Minibuf-1*> #<buffer *Apropos*>) (unsplittable) (minibuffer . #<window 4 on  *Minibuf-0*>) (modeline . t) (width . 113) (height . 59) (name . "*scratch*") (environment) (cursor-color . "black") (background-mode . light) (display-type . color) (horizontal-scroll-bars . t) (window-system . ns) (fullscreen) (alpha) (scroll-bar-width . 15) (cursor-type . box) (auto-lower) (auto-raise) (icon-type) (title) (buffer-predicate) (tool-bar-lines . 1) (menu-bar-lines . 1) (right-fringe . 11) (left-fringe . 10) (line-spacing) (background-color . "White") (foreground-color . "Black") (vertical-scroll-bars . right) (internal-border-width . 2) (border-width . 0) (font . "-*-Menlo-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1") (fontsize . 0) (font-backend mac-ct ns))

This is all done in an emacs without any configuration, adding -Q is a
bit difficult with an OSX app, but I renamed my usual .emacs so there is
nothing special loaded or configured.

This emacs was built from the git mirror with the latest sources
relatively close to the build date (2014-05-12).

In GNU Emacs 24.4.50.1 (x86_64-apple-darwin13.1.0, NS apple-appkit-1265.19)
 of 2014-05-12 on christians-imac
Windowing system distributor `Apple', version 10.3.1265
Configured using:
 `configure --prefix=/Users/clynbech/Sys/i386-apple-darwin13.1.0
 --with-ns --without-dbus 'CFLAGS=
 -I/Users/clynbech/Sys/i386-apple-darwin13.1.0/include
 -I/opt/local/include -L/Users/clynbech/Sys/i386-apple-darwin13.1.0/lib
 -L/opt/local/lib' 'CPPFLAGS=
 -I/Users/clynbech/Sys/i386-apple-darwin13.1.0/include
 -I/opt/local/include' 'LDFLAGS=
 -L/Users/clynbech/Sys/i386-apple-darwin13.1.0/lib -L/opt/local/lib''

Configured features:
PNG RSVG IMAGEMAGICK ACL GNUTLS LIBXML2 ZLIB

Important settings:
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
M-K C-y C-a C-SPC <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> C-w <right> C-y SPC <escape> C-k <help-echo> 
<help-echo> <wheel-down> <double-wheel-down> <triple-wheel-down> 
<triple-wheel-down> <triple-wheel-down> <wheel-up> 
<wheel-up> <wheel-up> <help-echo> <down-mouse-1> <mouse-1> 
<double-down-mouse-1> <double-mouse-1> <down-mouse-1> 
<mouse-1> ' r e e g i o n SPC <left> <left> <left> 
<left> <left> <backspace> <help-echo> <help-echo> <down-mouse-1> 
<mouse-1> <return> C-x C-e C-a C-SPC <down> <down> 
<down> <down> <down> <down> <down> <down> <down> s-w 
<escape> w C-x o <left> x o q <backspace> <backspace> 
<backspace> C-x o q <return> ( f r a m e - p a r a 
m e t e r s ) C-x C-e C-u C-x C-e <down-mouse-1> <mouse-1> 
<return> <up> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> C-SPC <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <right> <up> <right> 
C-g C-g C-k C-k C-y C-y <up> <return> <down> <down> 
<down> <down> <down> <down-mouse-1> <mouse-1> <up> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<escape> C-k C-y <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <left> <left> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> C-y <right> C-x C-e <down-mouse-1> 
<mouse-1> <double-down-mouse-1> <double-mouse-1> <down-mouse-1> 
<mouse-1> <wheel-up> <down-mouse-1> <wheel-down> <drag-mouse-1> 
<wheel-up> <help-echo> <help-echo> <help-echo> <down-mouse-1> 
<mouse-1> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <down-mouse-1> <mouse-movement> <mouse-movement> 
<drag-mouse-1> <escape> w <down-mouse-1> <mouse-movement> 
<mouse-movement> <drag-mouse-1> <escape> w <help-echo> 
<help-echo> <down-mouse-1> <mouse-1> <double-down-mouse-1> 
<double-mouse-1> <escape> w <return> <return> C-o <right> 
s-x r e p o r t - b u <tab> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <escape> x r e p o <tab> r 
t <tab> <return>

Recent messages:
Back to top level.
((tool-bar-position . top) (parent-id) (explicit-name) (display . "christians-imac") (visibility . t) (icon-name) (window-id . "1") (bottom-divider-width . 0) (right-divider-width . 0) (top . 385) (left . 1286) (buried-buffer-list #<buffer *Backtrace*> #<buffer *Completions*>) ...)
Mark set
Quit [2 times]
Mark set [4 times]
nil
Mark set
byte-code: Beginning of buffer
Mark set [4 times]
Making completion list...

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message dired format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util help-fns mail-prsvr mail-utils debug help-mode easymenu misearch
multi-isearch apropos time-date tooltip electric uniquify ediff-hook
vc-hooks lisp-float-type mwheel ns-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register
page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core frame cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew
greek romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process cocoa ns
multi-tty emacs)

Memory information:
((conses 16 87380 7320)
 (symbols 48 17970 0)
 (miscs 40 136 448)
 (strings 32 12052 4657)
 (string-bytes 1 328344)
 (vectors 16 10367)
 (vector-slots 8 373598 10063)
 (floats 8 68 645)
 (intervals 56 1466 0)
 (buffers 960 16))