all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Eli Zaretskii <eliz@gnu.org>
Cc: eggert@cs.ucla.edu, emacs-devel@gnu.org
Subject: Re: Note on e65c307 breaks font-height
Date: Sun, 29 May 2016 15:43:09 +0200	[thread overview]
Message-ID: <574AF1ED.7020404@gmx.at> (raw)
In-Reply-To: <8337p2zdt5.fsf@gnu.org>

 > 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	other threads:[~2016-05-29 13:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-26 10:44 Note on e65c307 breaks font-height martin rudalics
2016-05-26 15:05 ` Paul Eggert
2016-05-26 15:22   ` Eli Zaretskii
2016-05-26 15:33     ` Paul Eggert
2016-05-26 15:50       ` Eli Zaretskii
2016-05-26 15:57         ` Paul Eggert
2016-05-26 16:33           ` Eli Zaretskii
2016-05-27 13:18   ` martin rudalics
2016-05-28 10:17     ` Eli Zaretskii
2016-05-29 13:43       ` martin rudalics [this message]
2016-05-29 15:07         ` Eli Zaretskii
2016-05-30  8:00           ` martin rudalics
2016-06-04  7:28             ` Eli Zaretskii
2016-06-04  9:48               ` martin rudalics
2016-06-04 10:52                 ` Eli Zaretskii
2016-06-04 13:07                   ` martin rudalics
2016-05-28 10:38     ` Paul Eggert
2016-05-29 13:43       ` martin rudalics
2016-05-29 17:14         ` Paul Eggert
2016-05-30  8:00           ` martin rudalics
2016-05-26 15:16 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=574AF1ED.7020404@gmx.at \
    --to=rudalics@gmx.at \
    --cc=eggert@cs.ucla.edu \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.