Hello.
27 sep 2014 kl. 18:13 skrev enquiries@vsm.in:
When launched via terminal (cli), Emacs crashes by just having this single line
in init.el:
(set-face-attribute 'default nil :font "Menlo-16")
Emacs does /not/ crash when launched from the Finder (same init.el)
This seems to be a generic error in xfaces.c. It tries to load a font without
checking the type
of frame. The type is tty, but it tries to load a font anyway, and eventually
ends up in (font.c) font_pixel_size, which does:
#define FRAME_RES_Y(f) \
(eassert (FRAME_WINDOW_P (f)), FRAME_DISPLAY_INFO (f)->resy)
Now, FRAME_DISPLAY_INFO for a NS compiled Emacs is
#define FRAME_DISPLAY_INFO(f) ((f)->output_data.ns->display_info)
but the frame is not an NS frame, it is a tty frame, so bad things happen.
It is the same for X, but there it just happens to return a nonsense value, so
the code continues without crashing, and eventually discovers that there are no
font dirvers and the load font fails.
The code is in xfaces.c, Finternal_set_lisp_face_attribute, around line 3120
where it calls
font_load_for_lface.
The code in question is not called if compiled for a tty (#ifdef:ed out), but
it is called when the frame is a tty frame on a non-tty compiled Emacs.
I think these cases should be the same, i.e. font_load_for_lface not called for
tty frames.
Jan D.