emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Note on e65c307 breaks font-height


From: martin rudalics
Subject: Re: Note on e65c307 breaks font-height
Date: Sun, 29 May 2016 15:43:09 +0200

> Any reasons why you prefer specifying each of the font's attributes
> separately,

Maybe because I also want to specify things like 'background', 'box'
or 'underline' for my faces.

> instead of just specifying a font?  IOW, how is the above
> different from something like
>
>    (add-to-list 'default-frame-alist '(font . "-outline-Courier 
New-normal-r-normal-normal-15-112-96-96-c-90-iso8859-1"))
>
> (in your case, you may wish changing the size numbers, I think)?
>
> The advantage of the full font specification is that it works around
> the subtleties of the Emacs font selection procedure, whereby it could
> effectively disregard some of the attributes as result.

The above specification is a result from customizing the default face
via the command ‘customize-face’ many years ago.  I only now noticed
that this customization is inherently broken, probably ever since: The
default value seen in the customization buffer is that of the frame
where I'm invoking ‘customize-face’ in.  I wasn't aware of that and
section 37.12 of the Elisp manual apparently nowhere mentions it (by
"broken" I mean that I would consider a "default face" canonical which,
however, doesn't seems to be the case).

>> My analysis so far is as follows: In ‘font-setting-change-default-font’
>> the disjunct (frame-parameter f 'font-parameter) always evaluates to
>> nil here.  Before your patch, the disjunct
>>
>>                 (or (font-get (face-attribute 'default :font f 'default)
>>                               :user-spec)
>
> Why are we looking at the :font attribute, when you say the
> problematic attribute is :height?

Because that's where Paul's change causes an effect: Without his change
"Monospace 11" would never have entered the scene in the first place.

> Anyway, I think the best way forward is to debug Emacs during startup,
> putting a breakpoint where the :height attribute is being processed,

But that's what I've done.  Anyway: With a breakpoint at the line

  FRAME_LINE_HEIGHT (f) = font_ascent + font_descent;

at line 9602 in xterm.c I get first the "normal" setting of 15 and then
the setting of 18 ‘dynamic-setting-handle-config-changed-event’ induces.

----------------------------------
(gdb) p font_ascent + font_descent
$47 = 15
(gdb) c
Continuing.
(gdb) p font_ascent + font_descent
$48 = 18
(gdb) bt
#0  x_new_font (f=0x13ee7c0, font_object=..., fontset=2) at 
../../src/xterm.c:9602
#1  0x000000000043031a in x_set_font (f=0x13ee7c0, arg=..., oldval=...) at 
../../src/frame.c:3644
#2  0x000000000042db92 in x_set_frame_parameters (f=0x13ee7c0, alist=...) at 
../../src/frame.c:3165
#3  0x000000000042c901 in Fmodify_frame_parameters (frame=..., alist=...) at 
../../src/frame.c:2674
#4  0x000000000052f4d5 in set_font_frame_param (frame=..., lface=...) at 
../../src/xfaces.c:3329
#5  0x000000000052ec93 in Finternal_set_lisp_face_attribute (face=..., 
attr=..., value=..., frame=...) at ../../src/xfaces.c:3143
#6  0x00000000006317c0 in Ffuncall (nargs=5, args=0x7fffffffb4e8) at 
../../src/eval.c:2712
#7  0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., 
maxdepth=..., args_template=..., nargs=0, args=0x0) at ../../src/bytecode.c:880
#8  0x0000000000632591 in funcall_lambda (fun=..., nargs=10, 
arg_vector=0xa18515) at ../../src/eval.c:2929
#9  0x0000000000631984 in Ffuncall (nargs=11, args=0x7fffffffbd68) at 
../../src/eval.c:2750
#10 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., 
maxdepth=..., args_template=..., nargs=0, args=0x0) at ../../src/bytecode.c:880
#11 0x0000000000632591 in funcall_lambda (fun=..., nargs=2, 
arg_vector=0xb4d065) at ../../src/eval.c:2929
#12 0x0000000000631984 in Ffuncall (nargs=3, args=0x7fffffffc618) at 
../../src/eval.c:2750
#13 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., 
maxdepth=..., args_template=..., nargs=0, args=0x0) at ../../src/bytecode.c:880
#14 0x0000000000632591 in funcall_lambda (fun=..., nargs=1, 
arg_vector=0xb4d1fd) at ../../src/eval.c:2929
#15 0x0000000000631984 in Ffuncall (nargs=2, args=0x7fffffffcfa8) at 
../../src/eval.c:2750
#16 0x00000000006277f5 in Ffuncall_interactively (nargs=2, args=0x7fffffffcfa8) 
at ../../src/callint.c:252
#17 0x00000000006315e0 in Ffuncall (nargs=3, args=0x7fffffffcfa0) at 
../../src/eval.c:2681
#18 0x0000000000629d96 in Fcall_interactively (function=..., record_flag=..., 
keys=...) at ../../src/callint.c:840
#19 0x000000000063177d in Ffuncall (nargs=4, args=0x7fffffffd458) at 
../../src/eval.c:2708
#20 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., 
maxdepth=..., args_template=..., nargs=4, args=0x7fffffffdd48) at 
../../src/bytecode.c:880
#21 0x00000000006320ea in funcall_lambda (fun=..., nargs=4, 
arg_vector=0x7fffffffdd28) at ../../src/eval.c:2863
#22 0x0000000000631984 in Ffuncall (nargs=5, args=0x7fffffffdd20) at 
../../src/eval.c:2750
#23 0x000000000063119e in call4 (fn=..., arg1=..., arg2=..., arg3=..., 
arg4=...) at ../../src/eval.c:2585
#24 0x0000000000583e34 in read_char (commandflag=1, map=..., prev_event=..., 
used_mouse_menu=0x7fffffffe27f, end_time=0x0) at ../../src/keyboard.c:2840
#25 0x0000000000593b3b in read_key_sequence (keybuf=0x7fffffffe410, bufsize=30, 
prompt=..., dont_downcase_last=false, can_return_switch_frame=true, 
fix_current_buffer=true, prevent_redisplay=false) at ../../src/keyboard.c:9085
#26 0x000000000057f94f in command_loop_1 () at ../../src/keyboard.c:1357
#27 0x000000000062da4b in internal_condition_case (bfun=0x57f519 <command_loop_1>, 
handlers=..., hfun=0x57eb89 <cmd_error>) at ../../src/eval.c:1310
#28 0x000000000057f147 in command_loop_2 (ignore=...) at 
../../src/keyboard.c:1099
#29 0x000000000062cfc7 in internal_catch (tag=..., func=0x57f11e 
<command_loop_2>, arg=...) at ../../src/eval.c:1075
#30 0x000000000057f0e9 in command_loop () at ../../src/keyboard.c:1078
#31 0x000000000057e680 in recursive_edit_1 () at ../../src/keyboard.c:684
#32 0x000000000057e87c in Frecursive_edit () at ../../src/keyboard.c:755
#33 0x000000000057c61a in main (argc=1, argv=0x7fffffffe8e8) at 
../../src/emacs.c:1643

Lisp Backtrace:
"internal-set-lisp-face-attribute" (0xffffb4f0)
"set-face-attribute" (0xffffbd70)
"font-setting-change-default-font" (0xffffc620)
"dynamic-setting-handle-config-changed-event" (0xffffcfb0)
"funcall-interactively" (0xffffcfa8)
"call-interactively" (0xffffd460)
"command-execute" (0xffffdd28)
------------------------------

And before Paul's change the ‘set-face-attribute’ call was not performed
because ‘frame-font’ evaluated to nil as described in my previous mail.

Or was it something else you had in mind?

> and see what happens before and after Paul's change of the :user-spec
> symbol's definition.
>
> (My guess is that the change is correct, and the
> problems it uncovers are either unrelated bugs, or something that
> isn't supposed to work in the first place, at least not reliably.)

Agreed.

martin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]