unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Note on e65c307 breaks font-height
@ 2016-05-26 10:44 martin rudalics
  2016-05-26 15:05 ` Paul Eggert
  2016-05-26 15:16 ` Eli Zaretskii
  0 siblings, 2 replies; 21+ messages in thread
From: martin rudalics @ 2016-05-26 10:44 UTC (permalink / raw)
  To: emacs-devel

I just noticed this report by Rostislav Svoboda from Thu, 31 Mar 2016
11:10:14 +0200

 > >> Is there a problem in the e65c307 or in my emacs configuration?
 >
 > Just to be sure - I did make clean && make bootstrap
 >
 > After that I put a log-message right on the top of
 > font-setting-change-default-font in lisp/dynamic-setting.el and
 > byte-compiled the file.  I launch emacs in default configuration
 > using:
 >  ./src/emacs -q --eval "(set-face-attribute 'default nil :height 80)" &
 >
 > A *scratch* with font-height 80 appears but immediatelly right after
 > that the font-height gets increased. Moreover my log-message does not
 > appear in the *Messages*.
 >
 > So I think the e65c307 exposes some other bug indeed, but it is
 > specific to just one particular computer. On my other computer
 > everything is fine.
 >
 > Do you have any other idea where should I take a look or put a
 > breakpoint?

I'm experiencing more or less the same problem on Debian here.  The
:height setting in my .emacs for the default font gets ignored when
starting Emacs.  When I reevaluate .emacs it's applied.

I think this is a pretty serious annoyance and should be fixed before
the release - in the worst case by reverting that commit.

Note: I cannot observe this issue on Windows.

martin



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

* Re: Note on e65c307 breaks font-height
  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-27 13:18   ` martin rudalics
  2016-05-26 15:16 ` Eli Zaretskii
  1 sibling, 2 replies; 21+ messages in thread
From: Paul Eggert @ 2016-05-26 15:05 UTC (permalink / raw)
  To: martin rudalics, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 610 bytes --]

On 05/26/2016 03:44 AM, martin rudalics wrote:
> I'm experiencing more or less the same problem on Debian here.  The
> :height setting in my .emacs for the default font gets ignored when
> starting Emacs.  When I reevaluate .emacs it's applied.

What exactly is in your .emacs file? That is, can you give a recipe to 
reproduce the problem?

Is there anything in your configuration (e.g., saved-desktop?) that 
mentions :user-spec or user-spec?

Only one place in the Emacs Lisp code uses :user-spec: 
font-setting-change-default-font. Perhaps it is causing the bug. Does 
the attached patch fix the problem?


[-- Attachment #2: 0001-Ignore-user-spec-when-changing-default-fonts.patch --]
[-- Type: application/x-patch, Size: 1279 bytes --]

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

* Re: Note on e65c307 breaks font-height
  2016-05-26 10:44 Note on e65c307 breaks font-height martin rudalics
  2016-05-26 15:05 ` Paul Eggert
@ 2016-05-26 15:16 ` Eli Zaretskii
  1 sibling, 0 replies; 21+ messages in thread
From: Eli Zaretskii @ 2016-05-26 15:16 UTC (permalink / raw)
  To: martin rudalics; +Cc: emacs-devel

> Date: Thu, 26 May 2016 12:44:31 +0200
> From: martin rudalics <rudalics@gmx.at>
> 
> I'm experiencing more or less the same problem on Debian here.  The
> :height setting in my .emacs for the default font gets ignored when
> starting Emacs.  When I reevaluate .emacs it's applied.

Can you debug this?



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

* Re: Note on e65c307 breaks font-height
  2016-05-26 15:05 ` Paul Eggert
@ 2016-05-26 15:22   ` Eli Zaretskii
  2016-05-26 15:33     ` Paul Eggert
  2016-05-27 13:18   ` martin rudalics
  1 sibling, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2016-05-26 15:22 UTC (permalink / raw)
  To: Paul Eggert; +Cc: rudalics, emacs-devel

> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Thu, 26 May 2016 08:05:00 -0700
> 
> Only one place in the Emacs Lisp code uses :user-spec: 
> font-setting-change-default-font. Perhaps it is causing the bug. Does 
> the attached patch fix the problem?

If we want this fixed for Emacs 25.1, we cannot install such changes,
as they change behavior in subtle ways, something that shouldn't be
done so late in the pretest.  Instead, we should debug the problem,
understand exactly why it happens, and only then discuss how to fix it
on the release branch.

Thanks.



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

* Re: Note on e65c307 breaks font-height
  2016-05-26 15:22   ` Eli Zaretskii
@ 2016-05-26 15:33     ` Paul Eggert
  2016-05-26 15:50       ` Eli Zaretskii
  0 siblings, 1 reply; 21+ messages in thread
From: Paul Eggert @ 2016-05-26 15:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: rudalics, emacs-devel

On 05/26/2016 08:22 AM, Eli Zaretskii wrote:
> we should debug the problem,
> understand exactly why it happens, and only then discuss how to fix it
> on the release branch.

Yes, and my patch was an attempt to be part of the first step in doing 
that; it was part of a series of questions I gave to Martin about his 
configuration and what sort of perturbations make it work or not work. I 
had no intent to install the patch willy-nilly. Sorry if I wasn't clear.




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

* Re: Note on e65c307 breaks font-height
  2016-05-26 15:33     ` Paul Eggert
@ 2016-05-26 15:50       ` Eli Zaretskii
  2016-05-26 15:57         ` Paul Eggert
  0 siblings, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2016-05-26 15:50 UTC (permalink / raw)
  To: Paul Eggert; +Cc: rudalics, emacs-devel

> Cc: rudalics@gmx.at, emacs-devel@gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Thu, 26 May 2016 08:33:08 -0700
> 
> On 05/26/2016 08:22 AM, Eli Zaretskii wrote:
> > we should debug the problem,
> > understand exactly why it happens, and only then discuss how to fix it
> > on the release branch.
> 
> Yes, and my patch was an attempt to be part of the first step in doing 
> that; it was part of a series of questions I gave to Martin about his 
> configuration and what sort of perturbations make it work or not work. I 
> had no intent to install the patch willy-nilly. Sorry if I wasn't clear.

No, it wasn't clear.

And you do see the difference between the frame's font parameter and
the font of the frame's default face, yes?



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

* Re: Note on e65c307 breaks font-height
  2016-05-26 15:50       ` Eli Zaretskii
@ 2016-05-26 15:57         ` Paul Eggert
  2016-05-26 16:33           ` Eli Zaretskii
  0 siblings, 1 reply; 21+ messages in thread
From: Paul Eggert @ 2016-05-26 15:57 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: rudalics, emacs-devel

On 05/26/2016 08:50 AM, Eli Zaretskii wrote:
> you do see the difference between the frame's font parameter and
> the font of the frame's default face, yes?

Obviously they are different.

That being said, I am by no means an expert in Emacs font internals nor 
do I particularly want to be; I'm just trying to help fix a bug that 
Martin considers important. If it's not an important bug after all, or 
if I'm getting in the way of fixing it, I will (happily and gratefully 
:-) move on to other things.




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

* Re: Note on e65c307 breaks font-height
  2016-05-26 15:57         ` Paul Eggert
@ 2016-05-26 16:33           ` Eli Zaretskii
  0 siblings, 0 replies; 21+ messages in thread
From: Eli Zaretskii @ 2016-05-26 16:33 UTC (permalink / raw)
  To: Paul Eggert; +Cc: rudalics, emacs-devel

> Cc: rudalics@gmx.at, emacs-devel@gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Thu, 26 May 2016 08:57:48 -0700
> 
> On 05/26/2016 08:50 AM, Eli Zaretskii wrote:
> > you do see the difference between the frame's font parameter and
> > the font of the frame's default face, yes?
> 
> Obviously they are different.
> 
> That being said, I am by no means an expert in Emacs font internals nor 
> do I particularly want to be; I'm just trying to help fix a bug that 
> Martin considers important. If it's not an important bug after all, or 
> if I'm getting in the way of fixing it, I will (happily and gratefully 
> :-) move on to other things.

I didn't say it wasn't important; I think it is.



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

* Re: Note on e65c307 breaks font-height
  2016-05-26 15:05 ` Paul Eggert
  2016-05-26 15:22   ` Eli Zaretskii
@ 2016-05-27 13:18   ` martin rudalics
  2016-05-28 10:17     ` Eli Zaretskii
  2016-05-28 10:38     ` Paul Eggert
  1 sibling, 2 replies; 21+ messages in thread
From: martin rudalics @ 2016-05-27 13:18 UTC (permalink / raw)
  To: Paul Eggert, emacs-devel

 > What exactly is in your .emacs file? That is, can you give a recipe to reproduce the problem?

It's reproducible here with my

(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
  '(default ((t (:stipple nil :background "grey92" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 98 :width normal :foundry "outline" :family "Courier New")))))

 > Is there anything in your configuration (e.g., saved-desktop?) that mentions :user-spec or user-spec?

No.

 > Only one place in the Emacs Lisp code uses :user-spec: font-setting-change-default-font. Perhaps it is causing the bug. Does the attached patch fix the problem?

I suppose so but didn't try it yet.  IIUC it would defy the purpose of
that function.  I have no idea what ‘font-setting-change-default-font’
is really about.  I suppose it's related to themes but maybe someone
knows more.

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)

always evaluated to nil.  After your patch it returns "Monospace 11" and
‘frame-font’ gets set to that and the frame's default font too.  IIUC
the height of the default face gets set to that value too but a new
frame gets the value from my .emacs.  As a consequence, customizing the
default face will present me different height values corresponding to
the frame where I start the customization from.  That is awfully weird.

Please try with my .emacs setting on your system and tell me what you
get.  Windows doesn't have (fboundp 'font-get-system-font) so the issue
is moot there.

martin




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

* Re: Note on e65c307 breaks font-height
  2016-05-27 13:18   ` martin rudalics
@ 2016-05-28 10:17     ` Eli Zaretskii
  2016-05-29 13:43       ` martin rudalics
  2016-05-28 10:38     ` Paul Eggert
  1 sibling, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2016-05-28 10:17 UTC (permalink / raw)
  To: martin rudalics; +Cc: eggert, emacs-devel

> Date: Fri, 27 May 2016 15:18:02 +0200
> From: martin rudalics <rudalics@gmx.at>
> 
>  > What exactly is in your .emacs file? That is, can you give a recipe to reproduce the problem?
> 
> It's reproducible here with my
> 
> (custom-set-faces
>   ;; custom-set-faces was added by Custom.
>   ;; If you edit it by hand, you could mess it up, so be careful.
>   ;; Your init file should contain only one such instance.
>   ;; If there is more than one, they won't work right.
>   '(default ((t (:stipple nil :background "grey92" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 98 :width normal :foundry "outline" :family "Courier New")))))

Any reasons why you prefer specifying each of the font's attributes
separately, 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.

> 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?

Anyway, I think the best way forward is to debug Emacs during startup,
putting a breakpoint where the :height attribute is being processed,
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.)



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

* Re: Note on e65c307 breaks font-height
  2016-05-27 13:18   ` martin rudalics
  2016-05-28 10:17     ` Eli Zaretskii
@ 2016-05-28 10:38     ` Paul Eggert
  2016-05-29 13:43       ` martin rudalics
  1 sibling, 1 reply; 21+ messages in thread
From: Paul Eggert @ 2016-05-28 10:38 UTC (permalink / raw)
  To: martin rudalics, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 2787 bytes --]

martin rudalics wrote:
>  > What exactly is in your .emacs file? That is, can you give a recipe to
> reproduce the problem?
>
> It's reproducible here with my
>
> (custom-set-faces
>   ;; custom-set-faces was added by Custom.
>   ;; If you edit it by hand, you could mess it up, so be careful.
>   ;; Your init file should contain only one such instance.
>   ;; If there is more than one, they won't work right.
>   '(default ((t (:stipple nil :background "grey92" :foreground "black"
> :inverse-video nil :box nil :strike-through nil :overline nil :underline nil
> :slant normal :weight normal :height 98 :width normal :foundry "outline" :family
> "Courier New")))))

I'm afraid that's not enough of a recipe for me to reproduce the problem. On 
Ubuntu 16.04 x86-64 if I change my ~/.emacs file so that it contains just the 
abovementioned code, and then run the shell command 'src/emacs -q --eval 
"(set-face-attribute 'default nil :height 80)"', I get a *scratch* buffer where 
evaluating (setq F (face-attribute 'default :font (car (car (cdr 
(current-frame-configuration)))) 'default)) yields a font object F that prints 
as #<font-object "-DAMA-Ubuntu 
Mono-normal-normal-normal-*-11-*-*-*-m-0-iso10646-1">, and (font-get F 
:user-spec) indeed yields "Ubuntu Mono 13" in emacs-25 whereas it yields nil in 
Emacs 24.5. OK, but what is the regression here? The display has the same (ugly) 
appearance in Emacs 24.5 that it does in emacs-25. And in both Emacs 24.5 and 
emacs-25 if I reapply .emacs the display changes to the same (nicer) appearance.

The emacs-25 value of (font-get F :user-spec) is what was intended by commit 
42707278 as part of a fix for Bug#5157, by the way.


> 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)
>
> always evaluated to nil.  After your patch it returns "Monospace 11" and
> ‘frame-font’ gets set to that and the frame's default font too.  IIUC
> the height of the default face gets set to that value too but a new
> frame gets the value from my .emacs.  As a consequence, customizing the
> default face will present me different height values corresponding to
> the frame where I start the customization from.  That is awfully weird.

I'm afraid I can't reproduce a problem from this informal description. Perhaps 
if you could say exactly which code to run....  That being said, does the 
attached experimental patch address the issue for you? Again, I'm not seriously 
proposing installing this, just trying to understand the problem.



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-face-attribute-default-settings.patch --]
[-- Type: text/x-diff; name="0001-Fix-face-attribute-default-settings.patch", Size: 1683 bytes --]

From 6e3fee06d9bbac50f843efb333d1e919b78299b1 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sat, 28 May 2016 03:37:00 -0700
Subject: [PATCH] Fix face attribute default settings

Problem reported by Martin Rudalics in:
http://lists.gnu.org/archive/html/emacs-devel/2016-05/msg00557.html
* lisp/dynamic-setting.el (font-setting-change-default-font):
Don't confuse default face font user spec with frame font.
---
 lisp/dynamic-setting.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lisp/dynamic-setting.el b/lisp/dynamic-setting.el
index 6021a3b..854d3ad 100644
--- a/lisp/dynamic-setting.el
+++ b/lisp/dynamic-setting.el
@@ -53,17 +53,17 @@ font-setting-change-default-font
 	  (set-frame-font new-font nil frame-list)
 	;; Just redraw the existing fonts on all frames:
 	(dolist (f frame-list)
-	  (let ((frame-font
-		 (or (font-get (face-attribute 'default :font f 'default)
-			       :user-spec)
-		     (frame-parameter f 'font-parameter))))
+	  (let ((user-spec (font-get (face-attribute 'default :font f 'default)
+				     :user-spec))
+		(frame-font (frame-parameter f 'font-parameter)))
 	    (when frame-font
-	      (set-frame-parameter f 'font-parameter frame-font)
+	      (set-frame-parameter f 'font-parameter frame-font))
+	    (when default-face-font-user-spec
 	      (set-face-attribute 'default f
 				  :width 'normal
 				  :weight 'normal
 				  :slant 'normal
-				  :font frame-font))))))))
+				  :font user-spec))))))))
 
 (defun dynamic-setting-handle-config-changed-event (event)
   "Handle config-changed-event on the display in EVENT.
-- 
2.7.4


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

* Re: Note on e65c307 breaks font-height
  2016-05-28 10:17     ` Eli Zaretskii
@ 2016-05-29 13:43       ` martin rudalics
  2016-05-29 15:07         ` Eli Zaretskii
  0 siblings, 1 reply; 21+ messages in thread
From: martin rudalics @ 2016-05-29 13:43 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: eggert, emacs-devel

 > 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




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

* Re: Note on e65c307 breaks font-height
  2016-05-28 10:38     ` Paul Eggert
@ 2016-05-29 13:43       ` martin rudalics
  2016-05-29 17:14         ` Paul Eggert
  0 siblings, 1 reply; 21+ messages in thread
From: martin rudalics @ 2016-05-29 13:43 UTC (permalink / raw)
  To: Paul Eggert, emacs-devel

 > I'm afraid that's not enough of a recipe for me to reproduce the
 > problem. On Ubuntu 16.04 x86-64 if I change my ~/.emacs file so that
 > it contains just the abovementioned code, and then run the shell
 > command 'src/emacs -q --eval "(set-face-attribute 'default nil :height
 > 80)"', I get a *scratch* buffer where evaluating (setq F
 > (face-attribute 'default :font (car (car (cdr
 > (current-frame-configuration)))) 'default)) yields a font object F
 > that prints as #<font-object "-DAMA-Ubuntu
 > Mono-normal-normal-normal-*-11-*-*-*-m-0-iso10646-1">, and (font-get F
 > :user-spec) indeed yields "Ubuntu Mono 13" in emacs-25 whereas it
 > yields nil in Emacs 24.5. OK, but what is the regression here? The
 > display has the same (ugly) appearance in Emacs 24.5 that it does in
 > emacs-25.

I have no idea what the --eval is for.  I suppose that if you don't get
the ‘dynamic-setting-handle-config-changed-event’ which arrives here
_after_ my .emacs setting gets applied you won't see the problem.

 > And in both Emacs 24.5 and emacs-25 if I reapply .emacs the
 > display changes to the same (nicer) appearance.

But in Emacs 25 I have to _manually_ reapply .emacs.  I have no problems
installing a workaround for this here.  Other users very likely will see
problems ...

 > I'm afraid I can't reproduce a problem from this informal
 > description. Perhaps if you could say exactly which code to run....
 > That being said, does the attached experimental patch address the
 > issue for you?

It gets me

dynamic-setting-handle-config-changed-event: Symbol’s value as variable is void: default-face-font-user-spec

After that the .emacs setting is retained but I don't know whether the
‘dynamic-setting-handle-config-changed-event’ induced setting is not
applied because of what your patch changes or because of the error.

 > Again, I'm not seriously proposing installing this,
 > just trying to understand the problem.

martin




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

* Re: Note on e65c307 breaks font-height
  2016-05-29 13:43       ` martin rudalics
@ 2016-05-29 15:07         ` Eli Zaretskii
  2016-05-30  8:00           ` martin rudalics
  0 siblings, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2016-05-29 15:07 UTC (permalink / raw)
  To: martin rudalics; +Cc: eggert, emacs-devel

> Date: Sun, 29 May 2016 15:43:09 +0200
> From: martin rudalics <rudalics@gmx.at>
> CC: eggert@cs.ucla.edu, emacs-devel@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.

You can specify these separately.

> 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).

I'm not sure I follow: isn't the default face supposed to be per
frame?  Or did you mean something else?

> 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)

Hmm... why is command-execute in the backtrace?  Isn't this Emacs
starting up?  If this is you evaluating .emacs by hand, then can you
show the backtrace from the first time this breakpoint breaks?

Thanks.



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

* Re: Note on e65c307 breaks font-height
  2016-05-29 13:43       ` martin rudalics
@ 2016-05-29 17:14         ` Paul Eggert
  2016-05-30  8:00           ` martin rudalics
  0 siblings, 1 reply; 21+ messages in thread
From: Paul Eggert @ 2016-05-29 17:14 UTC (permalink / raw)
  To: martin rudalics, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 796 bytes --]

martin rudalics wrote:

> I have no idea what the --eval is for.

I put that --eval in only because Rostislav Svoboda's bug report mentioned it 
and I thought that it was needed to reproduce the bug.

>  > And in both Emacs 24.5 and emacs-25 if I reapply .emacs the
>  > display changes to the same (nicer) appearance.
>
> But in Emacs 25 I have to _manually_ reapply .emacs.

Yes, that is annoying. But I had to manually reapply .emacs in Emacs 24.5 too, 
with the scenario involving --eval. So this was not a regression for me in that 
case, which means I haven't reproduced your bug yet....

> dynamic-setting-handle-config-changed-event: Symbol’s value as variable is void:
> default-face-font-user-spec

Ach, that was a stupid last-minute typo. Revised patch attached.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-face-attribute-default-settings.patch --]
[-- Type: text/x-diff; name="0001-Fix-face-attribute-default-settings.patch", Size: 1840 bytes --]

From 7838d6e99dc0c191e16c4bf8849a1696ef7f2167 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sun, 29 May 2016 10:03:05 -0700
Subject: [PATCH] Fix face attribute default settings

Problem reported by Martin Rudalics in:
http://lists.gnu.org/archive/html/emacs-devel/2016-05/msg00557.html
* lisp/dynamic-setting.el (font-setting-change-default-font):
Don't confuse default face font user spec with frame font.
---
 lisp/dynamic-setting.el | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/lisp/dynamic-setting.el b/lisp/dynamic-setting.el
index 6021a3b..b1d2397 100644
--- a/lisp/dynamic-setting.el
+++ b/lisp/dynamic-setting.el
@@ -53,17 +53,17 @@ font-setting-change-default-font
 	  (set-frame-font new-font nil frame-list)
 	;; Just redraw the existing fonts on all frames:
 	(dolist (f frame-list)
-	  (let ((frame-font
-		 (or (font-get (face-attribute 'default :font f 'default)
-			       :user-spec)
-		     (frame-parameter f 'font-parameter))))
+	  (let ((user-spec (font-get (face-attribute 'default :font f 'default)
+				     :user-spec))
+		(frame-font (frame-parameter f 'font-parameter)))
 	    (when frame-font
-	      (set-frame-parameter f 'font-parameter frame-font)
+	      (set-frame-parameter f 'font-parameter frame-font))
+	    (when user-spec
 	      (set-face-attribute 'default f
 				  :width 'normal
 				  :weight 'normal
 				  :slant 'normal
-				  :font frame-font))))))))
+				  :font user-spec))))))))
 
 (defun dynamic-setting-handle-config-changed-event (event)
   "Handle config-changed-event on the display in EVENT.
@@ -92,4 +92,3 @@ dynamic-setting-handle-config-changed-event
 
 (define-key special-event-map [config-changed-event]
   'dynamic-setting-handle-config-changed-event)
-
-- 
2.7.4


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

* Re: Note on e65c307 breaks font-height
  2016-05-29 15:07         ` Eli Zaretskii
@ 2016-05-30  8:00           ` martin rudalics
  2016-06-04  7:28             ` Eli Zaretskii
  0 siblings, 1 reply; 21+ messages in thread
From: martin rudalics @ 2016-05-30  8:00 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: eggert, emacs-devel

 >> Maybe because I also want to specify things like 'background', 'box'
 >> or 'underline' for my faces.
 >
 > You can specify these separately.

But it's easier to look at all of them in one and the same customization
buffer.  At least that's what a beginner would do IMO.

 >> 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).
 >
 > I'm not sure I follow: isn't the default face supposed to be per
 > frame?

That's the way it's implemented.  But where do we tell that in our
documentations?

 >> 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)
 >
 > Hmm... why is command-execute in the backtrace?  Isn't this Emacs
 > starting up?

Apparently we get a config-changed-event during start-up.  Does anyone
know how these get injected?

 > If this is you evaluating .emacs by hand,

I'm not evaluating .emacs by hand here.

 > then can you
 > show the backtrace from the first time this breakpoint breaks?

OK.  Below you'll get more than you asked for.  The breakpoint is hit
four times, the third (with a value of 15) when my .emacs is read and
the fourth (with a value of 18 again) when the
‘dynamic-setting-handle-config-changed-event’ is processed (the fourth
is the one I posted before).

martin


Starting program: /home/martin/emacs-git/release/obj-gtk/src/emacs
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffef288700 (LWP 3830)]
[New Thread 0x7fffed8df700 (LWP 3831)]
[New Thread 0x7fffed08e700 (LWP 3832)]
(gdb) p font_ascent + font_descent
$5 = 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  0x00000000004324c7 in x_default_parameter (f=0x13ee7c0, alist=..., prop=..., deflt=..., xprop=0x70a12e "font", xclass=0x70a129 "Font", type=RES_TYPE_STRING) at ../../src/frame.c:4398
#4  0x0000000000554e69 in x_default_font_parameter (f=0x13ee7c0, parms=...) at ../../src/xfns.c:3136
#5  0x0000000000555b22 in Fx_create_frame (parms=...) at ../../src/xfns.c:3356
#6  0x0000000000631718 in Ffuncall (nargs=2, args=0x7fffffffa608) at ../../src/eval.c:2701
#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=1, arg_vector=0xa1e5d5) at ../../src/eval.c:2929
#9  0x0000000000631984 in Ffuncall (nargs=2, args=0x7fffffffae80) at ../../src/eval.c:2750
#10 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=1, args=0x7fffffffb8a0) at ../../src/bytecode.c:880
#11 0x00000000006320ea in funcall_lambda (fun=..., nargs=1, arg_vector=0x7fffffffb898) at ../../src/eval.c:2863
#12 0x0000000000631984 in Ffuncall (nargs=2, args=0x7fffffffb890) at ../../src/eval.c:2750
#13 0x000000000063044b in Fapply (nargs=2, args=0x7fffffffb890) at ../../src/eval.c:2286
#14 0x00000000006315e0 in Ffuncall (nargs=3, args=0x7fffffffb888) at ../../src/eval.c:2681
#15 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=1, args=0x7fffffffc170) at ../../src/bytecode.c:880
#16 0x00000000006320ea in funcall_lambda (fun=..., nargs=1, arg_vector=0x7fffffffc170) at ../../src/eval.c:2863
#17 0x0000000000631984 in Ffuncall (nargs=2, args=0x7fffffffc168) at ../../src/eval.c:2750
#18 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=1, args=0x7fffffffc9f8) at ../../src/bytecode.c:880
#19 0x00000000006320ea in funcall_lambda (fun=..., nargs=1, arg_vector=0x7fffffffc9f0) at ../../src/eval.c:2863
#20 0x0000000000631984 in Ffuncall (nargs=2, args=0x7fffffffc9e8) at ../../src/eval.c:2750
#21 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=0x7fffffffd270) at ../../src/bytecode.c:880
#22 0x00000000006320ea in funcall_lambda (fun=..., nargs=0, arg_vector=0x7fffffffd270) at ../../src/eval.c:2863
#23 0x0000000000631984 in Ffuncall (nargs=1, args=0x7fffffffd268) at ../../src/eval.c:2750
#24 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=0x7fffffffdb68) at ../../src/bytecode.c:880
#25 0x00000000006320ea in funcall_lambda (fun=..., nargs=0, arg_vector=0x7fffffffdb68) at ../../src/eval.c:2863
#26 0x0000000000631984 in Ffuncall (nargs=1, args=0x7fffffffdb60) at ../../src/eval.c:2750
#27 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=0x7fffffffe320) at ../../src/bytecode.c:880
#28 0x00000000006320ea in funcall_lambda (fun=..., nargs=0, arg_vector=0x7fffffffe320) at ../../src/eval.c:2863
#29 0x0000000000631d44 in apply_lambda (fun=..., args=..., count=3) at ../../src/eval.c:2802
#30 0x00000000006300a0 in eval_sub (form=...) at ../../src/eval.c:2219
#31 0x000000000062f4a8 in Feval (form=..., lexical=...) at ../../src/eval.c:1996
#32 0x000000000057f187 in top_level_2 () at ../../src/keyboard.c:1108
#33 0x000000000062da4b in internal_condition_case (bfun=0x57f16a <top_level_2>, handlers=..., hfun=0x57eb89 <cmd_error>) at ../../src/eval.c:1310
#34 0x000000000057f1c8 in top_level_1 (ignore=...) at ../../src/keyboard.c:1116
#35 0x000000000062cfc7 in internal_catch (tag=..., func=0x57f189 <top_level_1>, arg=...) at ../../src/eval.c:1075
#36 0x000000000057f0c2 in command_loop () at ../../src/keyboard.c:1077
#37 0x000000000057e680 in recursive_edit_1 () at ../../src/keyboard.c:684
#38 0x000000000057e87c in Frecursive_edit () at ../../src/keyboard.c:755
#39 0x000000000057c61a in main (argc=1, argv=0x7fffffffe8e8) at ../../src/emacs.c:1643

Lisp Backtrace:
"x-create-frame" (0xffffa610)
"x-create-frame-with-faces" (0xffffae88)
0x14ea810 PVEC_COMPILED
"apply" (0xffffb890)
"frame-creation-function" (0xffffc170)
"make-frame" (0xffffc9f0)
"frame-initialize" (0xffffd270)
"command-line" (0xffffdb68)
"normal-top-level" (0xffffe320)
(gdb) c
Continuing.
(gdb) p font_ascent + font_descent
$6 = 18
(gdb) bt
#0  x_new_font (f=0x13ee7c0, font_object=..., fontset=3) 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=0x7fffffff7eb8) 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=32, arg_vector=0xa18515) at ../../src/eval.c:2929
#9  0x0000000000631984 in Ffuncall (nargs=33, args=0x7fffffff8730) at ../../src/eval.c:2750
#10 0x00000000006309e0 in Fapply (nargs=4, args=0x7fffffff8a00) at ../../src/eval.c:2329
#11 0x00000000006315e0 in Ffuncall (nargs=5, args=0x7fffffff89f8) at ../../src/eval.c:2681
#12 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=0x0) at ../../src/bytecode.c:880
#13 0x0000000000632591 in funcall_lambda (fun=..., nargs=3, arg_vector=0xa1cd85) at ../../src/eval.c:2929
#14 0x0000000000631984 in Ffuncall (nargs=4, args=0x7fffffff9278) at ../../src/eval.c:2750
#15 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=0x0) at ../../src/bytecode.c:880
#16 0x0000000000632591 in funcall_lambda (fun=..., nargs=2, arg_vector=0xa1cc6d) at ../../src/eval.c:2929
#17 0x0000000000631984 in Ffuncall (nargs=3, args=0x7fffffff9ae8) at ../../src/eval.c:2750
#18 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=0x0) at ../../src/bytecode.c:880
#19 0x0000000000632591 in funcall_lambda (fun=..., nargs=3, arg_vector=0xa1ca8d) at ../../src/eval.c:2929
#20 0x0000000000631984 in Ffuncall (nargs=4, args=0x7fffffffa358) at ../../src/eval.c:2750
#21 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=0x0) at ../../src/bytecode.c:880
#22 0x0000000000632591 in funcall_lambda (fun=..., nargs=54, arg_vector=0xa14c95) at ../../src/eval.c:2929
#23 0x0000000000631984 in Ffuncall (nargs=55, args=0x7fffffffabd0) at ../../src/eval.c:2750
#24 0x00000000006309e0 in Fapply (nargs=3, args=0x7fffffffaf50) at ../../src/eval.c:2329
#25 0x00000000006315e0 in Ffuncall (nargs=4, args=0x7fffffffaf48) at ../../src/eval.c:2681
#26 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=0x0) at ../../src/bytecode.c:880
#27 0x0000000000632591 in funcall_lambda (fun=..., nargs=53, arg_vector=0xa14b3d) at ../../src/eval.c:2929
#28 0x0000000000631d44 in apply_lambda (fun=..., args=..., count=35) at ../../src/eval.c:2802
#29 0x00000000006300a0 in eval_sub (form=...) at ../../src/eval.c:2219
#30 0x0000000000665fcf in readevalloop_eager_expand_eval (val=..., macroexpand=...) at ../../src/lread.c:1757
#31 0x0000000000666725 in readevalloop (readcharfun=..., stream=0x0, sourcename=..., printflag=false, unibyte=..., readfun=..., start=..., end=...) at ../../src/lread.c:1925
#32 0x0000000000666a8f in Feval_buffer (buffer=..., printflag=..., filename=..., unibyte=..., do_allow_print=...) at ../../src/lread.c:1991
#33 0x000000000063180e in Ffuncall (nargs=6, args=0x7fffffffbd38) at ../../src/eval.c:2717
#34 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=0x0) at ../../src/bytecode.c:880
#35 0x0000000000632591 in funcall_lambda (fun=..., nargs=4, arg_vector=0x9ca29d) at ../../src/eval.c:2929
#36 0x0000000000631984 in Ffuncall (nargs=5, args=0x7fffffffc600) at ../../src/eval.c:2750
#37 0x000000000063119e in call4 (fn=..., arg1=..., arg2=..., arg3=..., arg4=...) at ../../src/eval.c:2585
#38 0x00000000006649c5 in Fload (file=..., noerror=..., nomessage=..., nosuffix=..., must_suffix=...) at ../../src/lread.c:1280
#39 0x000000000063180e in Ffuncall (nargs=4, args=0x7fffffffc9f0) at ../../src/eval.c:2717
#40 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=0x7fffffffd2b0) at ../../src/bytecode.c:880
#41 0x00000000006320ea in funcall_lambda (fun=..., nargs=0, arg_vector=0x7fffffffd2b0) at ../../src/eval.c:2863
#42 0x0000000000631984 in Ffuncall (nargs=1, args=0x7fffffffd2a8) at ../../src/eval.c:2750
#43 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=0x7fffffffdb68) at ../../src/bytecode.c:880
#44 0x00000000006320ea in funcall_lambda (fun=..., nargs=0, arg_vector=0x7fffffffdb68) at ../../src/eval.c:2863
#45 0x0000000000631984 in Ffuncall (nargs=1, args=0x7fffffffdb60) at ../../src/eval.c:2750
#46 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=0x7fffffffe320) at ../../src/bytecode.c:880
#47 0x00000000006320ea in funcall_lambda (fun=..., nargs=0, arg_vector=0x7fffffffe320) at ../../src/eval.c:2863
#48 0x0000000000631d44 in apply_lambda (fun=..., args=..., count=3) at ../../src/eval.c:2802
#49 0x00000000006300a0 in eval_sub (form=...) at ../../src/eval.c:2219
#50 0x000000000062f4a8 in Feval (form=..., lexical=...) at ../../src/eval.c:1996
#51 0x000000000057f187 in top_level_2 () at ../../src/keyboard.c:1108
#52 0x000000000062da4b in internal_condition_case (bfun=0x57f16a <top_level_2>, handlers=..., hfun=0x57eb89 <cmd_error>) at ../../src/eval.c:1310
#53 0x000000000057f1c8 in top_level_1 (ignore=...) at ../../src/keyboard.c:1116
#54 0x000000000062cfc7 in internal_catch (tag=..., func=0x57f189 <top_level_1>, arg=...) at ../../src/eval.c:1075
#55 0x000000000057f0c2 in command_loop () at ../../src/keyboard.c:1077
#56 0x000000000057e680 in recursive_edit_1 () at ../../src/keyboard.c:684
#57 0x000000000057e87c in Frecursive_edit () at ../../src/keyboard.c:755
#58 0x000000000057c61a in main (argc=1, argv=0x7fffffffe8e8) at ../../src/emacs.c:1643

Lisp Backtrace:
"internal-set-lisp-face-attribute" (0xffff7ec0)
"set-face-attribute" (0xffff8738)
"apply" (0xffff8a00)
"face-spec-set-2" (0xffff9280)
"face-spec-recalc" (0xffff9af0)
"face-spec-set" (0xffffa360)
"custom-theme-set-faces" (0xffffabd8)
"apply" (0xffffaf50)
"custom-set-faces" (0xffffb6d0)
"eval-buffer" (0xffffbd40)
"load-with-code-conversion" (0xffffc608)
"load" (0xffffc9f8)
0xac9328 PVEC_COMPILED
"command-line" (0xffffdb68)
"normal-top-level" (0xffffe320)
(gdb) c
Continuing.
(gdb) p font_ascent + font_descent
$7 = 15
(gdb) bt
#0  x_new_font (f=0x13ee7c0, font_object=..., fontset=19) 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=0x7fffffff7eb8) 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=32, arg_vector=0xa18515) at ../../src/eval.c:2929
#9  0x0000000000631984 in Ffuncall (nargs=33, args=0x7fffffff8730) at ../../src/eval.c:2750
#10 0x00000000006309e0 in Fapply (nargs=4, args=0x7fffffff8a00) at ../../src/eval.c:2329
#11 0x00000000006315e0 in Ffuncall (nargs=5, args=0x7fffffff89f8) at ../../src/eval.c:2681
#12 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=0x0) at ../../src/bytecode.c:880
#13 0x0000000000632591 in funcall_lambda (fun=..., nargs=3, arg_vector=0xa1cd85) at ../../src/eval.c:2929
#14 0x0000000000631984 in Ffuncall (nargs=4, args=0x7fffffff9278) at ../../src/eval.c:2750
#15 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=0x0) at ../../src/bytecode.c:880
#16 0x0000000000632591 in funcall_lambda (fun=..., nargs=2, arg_vector=0xa1cc6d) at ../../src/eval.c:2929
#17 0x0000000000631984 in Ffuncall (nargs=3, args=0x7fffffff9ae8) at ../../src/eval.c:2750
#18 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=0x0) at ../../src/bytecode.c:880
#19 0x0000000000632591 in funcall_lambda (fun=..., nargs=3, arg_vector=0xa1ca8d) at ../../src/eval.c:2929
#20 0x0000000000631984 in Ffuncall (nargs=4, args=0x7fffffffa358) at ../../src/eval.c:2750
#21 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=0x0) at ../../src/bytecode.c:880
#22 0x0000000000632591 in funcall_lambda (fun=..., nargs=54, arg_vector=0xa14c95) at ../../src/eval.c:2929
#23 0x0000000000631984 in Ffuncall (nargs=55, args=0x7fffffffabd0) at ../../src/eval.c:2750
#24 0x00000000006309e0 in Fapply (nargs=3, args=0x7fffffffaf50) at ../../src/eval.c:2329
#25 0x00000000006315e0 in Ffuncall (nargs=4, args=0x7fffffffaf48) at ../../src/eval.c:2681
#26 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=0x0) at ../../src/bytecode.c:880
#27 0x0000000000632591 in funcall_lambda (fun=..., nargs=53, arg_vector=0xa14b3d) at ../../src/eval.c:2929
#28 0x0000000000631d44 in apply_lambda (fun=..., args=..., count=35) at ../../src/eval.c:2802
#29 0x00000000006300a0 in eval_sub (form=...) at ../../src/eval.c:2219
#30 0x0000000000665fcf in readevalloop_eager_expand_eval (val=..., macroexpand=...) at ../../src/lread.c:1757
#31 0x0000000000666725 in readevalloop (readcharfun=..., stream=0x0, sourcename=..., printflag=false, unibyte=..., readfun=..., start=..., end=...) at ../../src/lread.c:1925
#32 0x0000000000666a8f in Feval_buffer (buffer=..., printflag=..., filename=..., unibyte=..., do_allow_print=...) at ../../src/lread.c:1991
#33 0x000000000063180e in Ffuncall (nargs=6, args=0x7fffffffbd38) at ../../src/eval.c:2717
#34 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=0x0) at ../../src/bytecode.c:880
#35 0x0000000000632591 in funcall_lambda (fun=..., nargs=4, arg_vector=0x9ca29d) at ../../src/eval.c:2929
#36 0x0000000000631984 in Ffuncall (nargs=5, args=0x7fffffffc600) at ../../src/eval.c:2750
#37 0x000000000063119e in call4 (fn=..., arg1=..., arg2=..., arg3=..., arg4=...) at ../../src/eval.c:2585
#38 0x00000000006649c5 in Fload (file=..., noerror=..., nomessage=..., nosuffix=..., must_suffix=...) at ../../src/lread.c:1280
#39 0x000000000063180e in Ffuncall (nargs=4, args=0x7fffffffc9f0) at ../../src/eval.c:2717
#40 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=0x7fffffffd2b0) at ../../src/bytecode.c:880
#41 0x00000000006320ea in funcall_lambda (fun=..., nargs=0, arg_vector=0x7fffffffd2b0) at ../../src/eval.c:2863
#42 0x0000000000631984 in Ffuncall (nargs=1, args=0x7fffffffd2a8) at ../../src/eval.c:2750
#43 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=0x7fffffffdb68) at ../../src/bytecode.c:880
#44 0x00000000006320ea in funcall_lambda (fun=..., nargs=0, arg_vector=0x7fffffffdb68) at ../../src/eval.c:2863
#45 0x0000000000631984 in Ffuncall (nargs=1, args=0x7fffffffdb60) at ../../src/eval.c:2750
#46 0x000000000067ef08 in exec_byte_code (bytestr=..., vector=..., maxdepth=..., args_template=..., nargs=0, args=0x7fffffffe320) at ../../src/bytecode.c:880
#47 0x00000000006320ea in funcall_lambda (fun=..., nargs=0, arg_vector=0x7fffffffe320) at ../../src/eval.c:2863
#48 0x0000000000631d44 in apply_lambda (fun=..., args=..., count=3) at ../../src/eval.c:2802
#49 0x00000000006300a0 in eval_sub (form=...) at ../../src/eval.c:2219
#50 0x000000000062f4a8 in Feval (form=..., lexical=...) at ../../src/eval.c:1996
#51 0x000000000057f187 in top_level_2 () at ../../src/keyboard.c:1108
#52 0x000000000062da4b in internal_condition_case (bfun=0x57f16a <top_level_2>, handlers=..., hfun=0x57eb89 <cmd_error>) at ../../src/eval.c:1310
#53 0x000000000057f1c8 in top_level_1 (ignore=...) at ../../src/keyboard.c:1116
#54 0x000000000062cfc7 in internal_catch (tag=..., func=0x57f189 <top_level_1>, arg=...) at ../../src/eval.c:1075
#55 0x000000000057f0c2 in command_loop () at ../../src/keyboard.c:1077
#56 0x000000000057e680 in recursive_edit_1 () at ../../src/keyboard.c:684
#57 0x000000000057e87c in Frecursive_edit () at ../../src/keyboard.c:755
#58 0x000000000057c61a in main (argc=1, argv=0x7fffffffe8e8) at ../../src/emacs.c:1643

Lisp Backtrace:
"internal-set-lisp-face-attribute" (0xffff7ec0)
"set-face-attribute" (0xffff8738)
"apply" (0xffff8a00)
"face-spec-set-2" (0xffff9280)
"face-spec-recalc" (0xffff9af0)
"face-spec-set" (0xffffa360)
"custom-theme-set-faces" (0xffffabd8)
"apply" (0xffffaf50)
"custom-set-faces" (0xffffb6d0)
"eval-buffer" (0xffffbd40)
"load-with-code-conversion" (0xffffc608)
"load" (0xffffc9f8)
0xac9328 PVEC_COMPILED
"command-line" (0xffffdb68)
"normal-top-level" (0xffffe320)
(gdb) c
Continuing.
(gdb) p font_ascent + font_descent
$8 = 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)
(gdb) c
Continuing.
(gdb) p font_ascent + font_descent
No symbol "font_ascent" in current context.
(gdb) c
Continuing.
[Thread 0x7fffed8df700 (LWP 3831) exited]
[Thread 0x7fffef288700 (LWP 3830) exited]
[Thread 0x7ffff7fcb960 (LWP 3829) exited]
(gdb)




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

* Re: Note on e65c307 breaks font-height
  2016-05-29 17:14         ` Paul Eggert
@ 2016-05-30  8:00           ` martin rudalics
  0 siblings, 0 replies; 21+ messages in thread
From: martin rudalics @ 2016-05-30  8:00 UTC (permalink / raw)
  To: Paul Eggert, emacs-devel

 >> I have no idea what the --eval is for.
 >
 > I put that --eval in only because Rostislav Svoboda's bug report mentioned it and I thought that it was needed to reproduce the bug.

Aha.  It's not needed here.

 >>  > And in both Emacs 24.5 and emacs-25 if I reapply .emacs the
 >>  > display changes to the same (nicer) appearance.
 >>
 >> But in Emacs 25 I have to _manually_ reapply .emacs.
 >
 > Yes, that is annoying. But I had to manually reapply .emacs in Emacs 24.5 too, with the scenario involving --eval. So this was not a regression for me in that case, which means I haven't reproduced your bug yet....

I see.

 >> dynamic-setting-handle-config-changed-event: Symbol’s value as variable is void:
 >> default-face-font-user-spec
 >
 > Ach, that was a stupid last-minute typo. Revised patch attached.

In this case the behavior is unchanged.  This is expected since the
problematic call is ‘set-face-attribute’ (as you can see from the
backtraces I sent) and your patch doesn't inhibit that.

martin




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

* Re: Note on e65c307 breaks font-height
  2016-05-30  8:00           ` martin rudalics
@ 2016-06-04  7:28             ` Eli Zaretskii
  2016-06-04  9:48               ` martin rudalics
  0 siblings, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2016-06-04  7:28 UTC (permalink / raw)
  To: martin rudalics; +Cc: eggert, emacs-devel

> Date: Mon, 30 May 2016 10:00:09 +0200
> From: martin rudalics <rudalics@gmx.at>
> CC: eggert@cs.ucla.edu, emacs-devel@gnu.org
> 
>  >> Maybe because I also want to specify things like 'background', 'box'
>  >> or 'underline' for my faces.
>  >
>  > You can specify these separately.
> 
> But it's easier to look at all of them in one and the same customization
> buffer.  At least that's what a beginner would do IMO.

Not sure about beginners (as this is not newbie stuff at all).  I
agree that it would be more convenient to specify them all, but we
don't have such a facility.  What you did instead is instruct the font
selection process about some of your preferences.  Try stepping
through the code which implements font/fontset selection, and if you
don't get lost immediately, you will see how many semi-arbitrary
decisions that code makes.

IOW, the font selection code was not designed to support what you'd
like, not in general.  That is why I strongly recommend to just state
a specific font of your liking, and move on.

>  > I'm not sure I follow: isn't the default face supposed to be per
>  > frame?
> 
> That's the way it's implemented.  But where do we tell that in our
> documentations?

 -- Function: face-attribute face attribute &optional frame inherit
     This function returns the value of the ATTRIBUTE attribute for FACE
     on FRAME.

And all the other functions in that node accept the FRAME argument.

It will do no harm, though, to say that explicitly at the beginning of
the chapter; patches welcome.

>  >> 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)
>  >
>  > Hmm... why is command-execute in the backtrace?  Isn't this Emacs
>  > starting up?
> 
> Apparently we get a config-changed-event during start-up.  Does anyone
> know how these get injected?

I'm not sure I follow: command-execute is called by startup.el only
once: if there's a -f SOMETHING command-line argument.  Is that what
happened in your case?

>  > then can you
>  > show the backtrace from the first time this breakpoint breaks?
> 
> OK.  Below you'll get more than you asked for.  The breakpoint is hit
> four times, the third (with a value of 15) when my .emacs is read and
> the fourth (with a value of 18 again) when the
> ‘dynamic-setting-handle-config-changed-event’ is processed (the fourth
> is the one I posted before).

Thanks, I will look into that and see what it tells.



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

* Re: Note on e65c307 breaks font-height
  2016-06-04  7:28             ` Eli Zaretskii
@ 2016-06-04  9:48               ` martin rudalics
  2016-06-04 10:52                 ` Eli Zaretskii
  0 siblings, 1 reply; 21+ messages in thread
From: martin rudalics @ 2016-06-04  9:48 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: eggert, emacs-devel

 >> But it's easier to look at all of them in one and the same customization
 >> buffer.  At least that's what a beginner would do IMO.
 >
 > Not sure about beginners (as this is not newbie stuff at all).  I
 > agree that it would be more convenient to specify them all, but we
 > don't have such a facility.  What you did instead is instruct the font
 > selection process about some of your preferences.  Try stepping
 > through the code which implements font/fontset selection, and if you
 > don't get lost immediately, you will see how many semi-arbitrary
 > decisions that code makes.
 >
 > IOW, the font selection code was not designed to support what you'd
 > like, not in general.  That is why I strongly recommend to just state
 > a specific font of your liking, and move on.

What I did (in the previous century, IIRC) was to select the procedure
that I then considered best supported by the customization interface.
Can you point me to a similar interface for the step you propose?  IOW,
I still think that mine is the way a newbie would use.

 >>   > I'm not sure I follow: isn't the default face supposed to be per
 >>   > frame?
 >>
 >> That's the way it's implemented.  But where do we tell that in our
 >> documentations?
 >
 >   -- Function: face-attribute face attribute &optional frame inherit
 >       This function returns the value of the ATTRIBUTE attribute for FACE
 >       on FRAME.
 >
 > And all the other functions in that node accept the FRAME argument.

IIUC none of these bear any relation to the customization interface.
When someone wants to save a face attribute in her .emacs, she usually
wants to do that for "all frames created in the future".  There's no
specific frame at that time.  And I still don't see where the
customization framework allows or suggests to specifiy a face for a
frame or for "any" frame.

 > It will do no harm, though, to say that explicitly at the beginning of
 > the chapter; patches welcome.

I don't want to talk you into anything.  But I think that this part of
the customization interface is still missing something important.  Till
then, the documentation should describe how to achieve the desired
setting.

 >>   >> 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)
 >>   >
 >>   > Hmm... why is command-execute in the backtrace?  Isn't this Emacs
 >>   > starting up?
 >>
 >> Apparently we get a config-changed-event during start-up.  Does anyone
 >> know how these get injected?
 >
 > I'm not sure I follow: command-execute is called by startup.el only
 > once: if there's a -f SOMETHING command-line argument.  Is that what
 > happened in your case?

No.  The event is stored there by apply_xft_settings in that line

       store_config_changed_event (Qfont_render,
				  XCAR (dpyinfo->name_list_element));

All this is severely underdocumented and undercommented :-(

 > Thanks, I will look into that and see what it tells.

Currently, I defalias ‘dynamic-setting-handle-config-changed-event’ to
‘ignore’.  I don't think we can recommend that to users.  Maybe we
should invent a new option like ‘x-handle-configuration-changes’ which
defaults to t.  Users encoutering problems like me could then set it to
nil in their .emacs.  In any case, I think that this part has not been
given much testing due to the bug Paul uncovered.

martin




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

* Re: Note on e65c307 breaks font-height
  2016-06-04  9:48               ` martin rudalics
@ 2016-06-04 10:52                 ` Eli Zaretskii
  2016-06-04 13:07                   ` martin rudalics
  0 siblings, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2016-06-04 10:52 UTC (permalink / raw)
  To: martin rudalics; +Cc: eggert, emacs-devel

> Date: Sat, 04 Jun 2016 11:48:10 +0200
> From: martin rudalics <rudalics@gmx.at>
> CC: eggert@cs.ucla.edu, emacs-devel@gnu.org
> 
>  > IOW, the font selection code was not designed to support what you'd
>  > like, not in general.  That is why I strongly recommend to just state
>  > a specific font of your liking, and move on.
> 
> What I did (in the previous century, IIRC) was to select the procedure
> that I then considered best supported by the customization interface.
> Can you point me to a similar interface for the step you propose?  IOW,
> I still think that mine is the way a newbie would use.

I don't understand why we are talking about customization interfaces.
I thought the problem was that requesting a font by specifying some of
its attributes doesn't work.  Now I'm confused: what problem is at
hand?

>  >   -- Function: face-attribute face attribute &optional frame inherit
>  >       This function returns the value of the ATTRIBUTE attribute for FACE
>  >       on FRAME.
>  >
>  > And all the other functions in that node accept the FRAME argument.
> 
> IIUC none of these bear any relation to the customization interface.

"M-x customize-face" changes the face definitions on all frames, but
you can invoke set-face-attribute with a specific frame to change the
face only on that frame.

> And I still don't see where the customization framework allows or
> suggests to specifiy a face for a frame or for "any" frame.

I don't think it does.

In any case, it looks like a simple question of mine led us aside for
no good reason.  Whether faces are or aren't per frame has nothing to
do with the problem at hand.



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

* Re: Note on e65c307 breaks font-height
  2016-06-04 10:52                 ` Eli Zaretskii
@ 2016-06-04 13:07                   ` martin rudalics
  0 siblings, 0 replies; 21+ messages in thread
From: martin rudalics @ 2016-06-04 13:07 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: eggert, emacs-devel

 > I don't understand why we are talking about customization interfaces.
 > I thought the problem was that requesting a font by specifying some of
 > its attributes doesn't work.  Now I'm confused: what problem is at
 > hand?

So far I was only able to reproduce the problem by customizing the
default face via the customization interface.  I didn't dig into the
interiors of this yet so I can't tell whether customizing the default
face is a conditio sine qua non for reproducing the problem.

 > "M-x customize-face" changes the face definitions on all frames, but
 > you can invoke set-face-attribute with a specific frame to change the
 > face only on that frame.

But then ‘set-face-attribute’ wouldn't make sense in .emacs, right?

 >> And I still don't see where the customization framework allows or
 >> suggests to specifiy a face for a frame or for "any" frame.
 >
 > I don't think it does.
 >
 > In any case, it looks like a simple question of mine led us aside for
 > no good reason.  Whether faces are or aren't per frame has nothing to
 > do with the problem at hand.

I wouldn't know.

martin




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

end of thread, other threads:[~2016-06-04 13:07 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).