Subject: bug#16694: closed (Re: bug#16694: bugs #16694/#16378: Patches)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 05 Apr 2014 07:53:13 +0000

Your bug report

#16434: Regression by commit 115663 (bzr): Theme face attributes no longer take precedence over X resources

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
16434: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16434
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#16694: bugs #16694/#16378: Patches
From: Eli Zaretskii <[email-masked]>
To: Matthias Dahl <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked], [email-masked], [email-masked], [email-masked]
Date: Sat, 05 Apr 2014 10:52:54 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> Date: Wed, 02 Apr 2014 17:04:19 +0200
> From: Matthias Dahl <[email-masked]>
> CC: Clemens Schüller
>  <[email-masked]>, [email-masked], 
>  Stefan Monnier <[email-masked]>,
>  Eli Zaretskii <[email-masked]>, [email-masked]
> 
> Like promised, attached revised versions of my first three patches which
> had a nasty and very embarrassing bug/brain-fart as well as a potential
> fix for bug #16434.
> 
> I'd appreciate testing and any feedback, so that we (as in who ever is
> in charge and can do this) commit this for the pretest. :)

Thanks.  I applied to the emacs-24 branch the first 2 patches, the
part of the 3rd patch that does not introduce backward
incompatibilities, and the 4th patch you sent in a later message.
Please confirm that the result will DTRT.  Meanwhile, I'm marking
those bugs as "done".

In the future, please also provide ChangeLog entries for the changes
that could be dropped into the respective ChangeLog files.  TIA.

The incompatible part of the 3rd patch, reproduced below, remains
uncommitted.  I understand the motivation for it, but the emacs-24
branch shouldn't introduce incompatible changes at this time.  If
Stefan agrees with applying this part to the trunk, I will do that.

============================================================
Backwards incompatible change: make-face previously accepted
no-init-from-resources as an optional parameter which has now
been removed. There were no other users within Emacs itself. And this
parameter shouldn't have been there in the first place, imho.

diff --git a/lisp/faces.el b/lisp/faces.el
index 8536c08..28205d2 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -149,13 +149,10 @@ REGISTRY, ALTERNATIVE1, ALTERNATIVE2, and etc."
   "Return a list of all defined faces."
   (mapcar #'car face-new-frame-defaults))
 
-(defun make-face (face &optional no-init-from-resources)
+(defun make-face (face)
   "Define a new face with name FACE, a symbol.
 Do not call this directly from Lisp code; use `defface' instead.
-
-If NO-INIT-FROM-RESOURCES is non-nil, don't initialize face
-attributes from X resources.  If FACE is already known as a face,
-leave it unmodified.  Return FACE."
+If FACE is already known as a face, leave it unmodified.  Return FACE."
   (interactive (list (read-from-minibuffer
 		      "Make face: " nil nil t 'face-name-history)))
   (unless (facep face)
@@ -166,8 +163,7 @@ leave it unmodified.  Return FACE."
     (when (fboundp 'facemenu-add-new-face)
       (facemenu-add-new-face face))
     ;; Define frame-local faces for all frames from X resources.
-    (unless no-init-from-resources
-      (make-face-x-resource-internal face)))
+    (make-face-x-resource-internal face))
   face)
 
 (defun make-empty-face (face)
@@ -175,7 +171,7 @@ leave it unmodified.  Return FACE."
 Do not call this directly from Lisp code; use `defface' instead."
   (interactive (list (read-from-minibuffer
 		      "Make empty face: " nil nil t 'face-name-history)))
-  (make-face face 'no-init-from-resources))
+  (make-face face))
 
 (defun copy-face (old-face new-face &optional frame new-frame)
   "Define a face named NEW-FACE, which is a copy of OLD-FACE.

Subject: Regression by commit 115663 (bzr): Theme face attributes no longer take precedence over X resources
From: Matthias Dahl <[email-masked]>
To: [email-masked]
Date: Sat, 08 Feb 2014 11:06:38 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello @all...

If a theme changes attributes from the default face for example (like
:background), those will shortly flash and then revert back to the
default of the current GTK theme, thus leaving the user with a mixed
state of the Emacs theme and GTK theme, which is most certainly not
intended.

This regression was introduced by bzr commit 115663: imho in function
face-spec-recalc from faces.el, make-face-x-resource-internal should not
be called last, which overrides parts of the theme again with the
defaults from the GTK theme.

Either commenting that line, or starting emacs with inhibit-x-resources
set to true, will work again. With the later though, you naturally loose
some other options as well, which is not desirable.

(As a side note: It is not properly documented either in the command
line help, nor the man pages, that starting emacs with -Q also sets
inhibit-x-resources to true.)

If more information or help is required, please let me know and I will
happily lend a hand or two. :-)

INFO from a stripped down Emacs checked out and built moments ago, which
(as expected) still has the problem:

In GNU Emacs 24.3.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7)
 of 2014-02-08 on dreamgate
Repository revision: [email-masked]
Windowing system distributor `The X.Org Foundation', version 11.0.11500000
System Description:	NAME=Gentoo

Configured using:
 `configure --prefix=/usr --build=x86_64-pc-linux-gnu
 --host=x86_64-pc-linux-gnu --mandir=/usr/share/man
 --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
 --localstatedir=/var/lib --libdir=/usr/lib64 --disable-silent-rules
 --disable-dependency-tracking --program-suffix=-emacs-24-vcs
 --infodir=/usr/share/info/emacs-24-vcs
 --enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp
 --with-gameuser=games --without-compress-install
 --with-file-notification=inotify --enable-acl --with-dbus
 --without-gnutls --with-gpm --without-hesiod --without-kerberos
 --without-kerberos5 --with-xml2 --without-selinux --with-wide-int
 --with-zlib --with-sound=alsa --with-x --without-ns --without-gconf
 --without-gsettings --without-toolkit-scroll-bars --with-gif
 --with-jpeg --with-png --with-rsvg --with-tiff --with-xpm
 --with-imagemagick --with-xft --without-libotf --without-m17n-flt
 --with-x-toolkit=gtk3 GENTOO_PACKAGE=app-editors/emacs-vcs-24.3.9999
 EBZR_BRANCH=trunk EBZR_REVNO=116339 'CFLAGS=-march=native -O2 -pipe'
 CPPFLAGS= 'LDFLAGS=-Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,-z,combreloc
 -Wl,-z,now''

Important settings:
  value of $LC_COLLATE: de_DE.utf8
  value of $LC_CTYPE: de_DE.utf8
  value of $LC_MESSAGES: en_US.utf8
  value of $LC_MONETARY: de_DE.utf8
  value of $LC_NUMERIC: de_DE.utf8
  value of $LC_TIME: en_GB.utf8
  value of $LANG: en_US.utf8
  locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
M-x s e n d - b u g <tab> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
r e p o <tab> r t - e <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list...
call-interactively: End of buffer [6 times]

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message idna format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util help-fns mail-prsvr mail-utils help-mode easymenu package
site-gentoo time-date tooltip electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind inotify
dynamic-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty emacs)