unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Dr. Werner Fink" <werner@suse.de>
To: martin rudalics <rudalics@gmx.at>
Cc: 25228@debbugs.gnu.org
Subject: bug#25228: 25.1; GNU emacs 25.1: custom-set-faces from init file ~/.emacs ignored
Date: Wed, 21 Dec 2016 09:11:04 +0100	[thread overview]
Message-ID: <20161221081104.3nd6sga4cyi6q7wl@boole.suse.de> (raw)
In-Reply-To: <58590F28.9040309@gmx.at>

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

On Tue, Dec 20, 2016 at 11:59:52AM +0100, martin rudalics wrote:
>  '(default ((t (:inherit nil :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 "unknown" :family "Droid Sans Mono")))))
> 
> The ":height 98" entry in this form before the offending change did set
> the "height of the default face in 1/10 pt" to 98.  After the offending
> change it is set to 113.  I have no idea what a "pt" is (and I have no
> idea what an "inch" is).  But from experience I know that the value of
> `window-font-height' for the root window of the initial frame is 15 for
> a default face height of 98 and 18 for a default face height of 113.


AFAIK pt are points aka 1/72 of 1 inch or in metric units 0.35278 mm
(and AFAIK the ANSI is member of the ISO but this is na other story:)

> 
> As a consequence of the offending change, the frame character height of
> my initial frame is now 18 instead of the desired 15.  In the following
> I will try to explain how this happened here.
> 
> [Werner - if you read this, please try to repeat it, maybe you get a
> completely different behavior.  I gdb one of my current versions of a
> GTK build of master, so the line numbers may be off wrt what you have
> (unfortunately, debugging the release version freezes GNU/Linux
> completely here and I have to turn off the power in order to restart
> it).]
> 
> I first visit the file xsettings.c in the .src directory and start the
> debugger via M-x gdb completing it to
> 
> gdb -i=mi /home/martin/emacs-git/quick/obj-gtk/src/emacs
> 
> which includes the path of my GTK executable.  Next in xsettings.c I
> move to line 611 which reads as
> 
>   memset (&oldsettings, 0, sizeof (oldsettings));
> 
> and set a breakpoint there.  Then I run the executable via
> 
> run -Q --load /home/martin/temp/default-face.el
> 
> and wait till the breakpoint is hit.  In the function where I set the
> breakpoint (apply_xft_settings) I now want to trigger the setting of the
> variable
> 
>       changed = true;
> 
> I do this by stepping via "n" and find that it happens on line 675
> because of oldsettings.dpi != settings->dpi: The old value was
> 96.281588447653434 while the new value is 96.  As a consequence, on line
> 701 a
> 
>       store_config_changed_event (Qfont_render,
> 				  XCAR (dpyinfo->name_list_element));

Hmmm ... after verifying this I've tried this patch
----------------------------------------------------------------------------
--- src/xsettings.c
+++ src/xsettings.c	2016-12-21 07:25:17.605036477 +0000
@@ -45,6 +45,7 @@ along with GNU Emacs.  If not, see <http
 #endif
 
 #ifdef HAVE_XFT
+#include <math.h>
 #include <X11/Xft/Xft.h>
 #endif
 
@@ -620,7 +621,11 @@ apply_xft_settings (struct x_display_inf
 #endif
   FcPatternGetInteger (pat, FC_LCD_FILTER, 0, &oldsettings.lcdfilter);
   FcPatternGetInteger (pat, FC_RGBA, 0, &oldsettings.rgba);
-  FcPatternGetDouble (pat, FC_DPI, 0, &oldsettings.dpi);
+
+  if (FcPatternGetDouble (pat, FC_DPI, 0, &oldsettings.dpi) == FcResultMatch)
+    {
+      oldsettings.dpi = round(oldsettings.dpi);
+    }
 
   if ((settings->seen & SEEN_AA) != 0 && oldsettings.aa != settings->aa)
     {
----------------------------------------------------------------------------

and indeed there is a change in the behaviour.  Without the custom font setting
now GNU Emacs window does not a resize anymore at open.  It simply starts with
the system font without changing its size at open its window.

Nevertheless, with the custom font setting and without my change in lisp/dynamic-setting.el
the resize event of the GNU Emacs window is back and still the system font is
used regardless what font has been customized in ~/.emacs

> [backtraces]
> 
> It's easy to spot `dynamic-setting-handle-config-changed-event' as the
> source of this.

Ack

-- 
  "Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool." -- Edward Burr

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2016-12-21  8:11 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-19 10:03 bug#25228: 25.1; GNU emacs 25.1: custom-set-faces from init file ~/.emacs ignored Dr. Werner Fink
2016-12-19 15:09 ` bug#25228: [emacs-bug] " Dr. Werner Fink
2016-12-19 17:37 ` Eli Zaretskii
2016-12-19 18:36   ` martin rudalics
2016-12-19 18:57     ` Eli Zaretskii
2016-12-19 20:20       ` martin rudalics
2016-12-19 20:43         ` Eli Zaretskii
2016-12-20 10:59           ` martin rudalics
2016-12-20 16:11             ` Eli Zaretskii
2016-12-20 16:25               ` martin rudalics
2016-12-20 17:06                 ` Eli Zaretskii
2016-12-20 17:28                   ` Dr. Werner Fink
2016-12-20 17:34                   ` martin rudalics
2016-12-20 17:55                     ` Eli Zaretskii
2016-12-20 18:18                       ` martin rudalics
2016-12-20 18:39                         ` Eli Zaretskii
2016-12-20 18:49                           ` martin rudalics
2016-12-20 19:31                             ` Eli Zaretskii
2016-12-20 19:11                           ` Rostislav Svoboda
2016-12-20 19:24                             ` Rostislav Svoboda
2016-12-20 19:34                               ` Eli Zaretskii
2016-12-20 21:50                                 ` Rostislav Svoboda
2016-12-21  7:42                                   ` martin rudalics
2016-12-21 11:03                                     ` Rostislav Svoboda
2016-12-21 17:25                                       ` Eli Zaretskii
2016-12-22  8:35                                       ` martin rudalics
2016-12-22 11:59                                         ` Rostislav Svoboda
2016-12-22 17:45                                           ` martin rudalics
2016-12-20 19:29                             ` martin rudalics
2016-12-21  8:11             ` Dr. Werner Fink [this message]
2016-12-21  8:47               ` bug#25228: [emacs-bug] " Dr. Werner Fink
2016-12-21  8:56                 ` martin rudalics
2016-12-21 11:08                   ` Dr. Werner Fink
2016-12-22  8:35                     ` martin rudalics
2016-12-22 11:46                       ` Dr. Werner Fink
2016-12-22 17:44                         ` martin rudalics
2016-12-23  7:20                           ` Dr. Werner Fink
2016-12-21 17:24                 ` Eli Zaretskii
2016-12-21 17:39                   ` Dr. Werner Fink
2016-12-21 18:04                     ` Eli Zaretskii
2016-12-21  8:48               ` martin rudalics
2016-12-21 12:08                 ` Dr. Werner Fink
2016-12-21 17:34                   ` Eli Zaretskii
2016-12-22  8:35                     ` martin rudalics
2016-12-22 17:30                       ` Eli Zaretskii
2016-12-22 17:45                         ` martin rudalics
2016-12-23  7:29                           ` Dr. Werner Fink
2016-12-20 11:18           ` Dr. Werner Fink
2016-12-20 16:15             ` Eli Zaretskii
2016-12-20 16:41               ` Dr. Werner Fink
2016-12-20 16:56                 ` bug#25228: [emacs-bug] " Dr. Werner Fink
2016-12-20 17:58                   ` 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=20161221081104.3nd6sga4cyi6q7wl@boole.suse.de \
    --to=werner@suse.de \
    --cc=25228@debbugs.gnu.org \
    --cc=rudalics@gmx.at \
    /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 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).