unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#8454: 24.0; Emacs does not apply additional custom faces from theme
@ 2011-04-09  3:51 Christoph Scholtes
  2011-10-23 16:58 ` bug#8454: I can't reproduce this Dave Abrahams
  2011-12-05  6:54 ` bug#8454: Themes can't work right due to design Chris Hanson
  0 siblings, 2 replies; 6+ messages in thread
From: Christoph Scholtes @ 2011-04-09  3:51 UTC (permalink / raw)
  To: 8454

I downloaded a custom theme from elpa
(http://elpa.gnu.org/themes/2lzrreXz) and added some faces at the bottom:

 ; erc
 '(erc-default-face ((t (:inherit default))))
 '(erc-my-nick-face ((t (:inherit font-lock-variable-name-face))))
 '(erc-current-nick-face ((t (:inherit font-lock-string-face))))
 '(erc-input-face ((t (:inherit font-lock-type-face))))
 '(erc-keyword-face ((t (:inherit font-lock-keyword-face))))
 '(erc-timestamp-face ((t (:inherit font-lock-builtin-face))))
 '(erc-notice-face ((t (:inherit font-lock-comment-face))))

These faces inherit their values from the faces set in the custom theme.

The problem is, none of the custom faces for erc are actually
applied. Emacs still has the original erc faces.


In GNU Emacs 24.0.50 (i386-mingw-nt6.1.7600)
 of 2011-04-06 on MARVIN
Windowing system distributor `Microsoft Corp.', version 6.1.7600
configured using `configure --with-gcc (4.5) --cflags -IC:/Progra~2/GnuWin32/include -ID:/devel/emacs/libXpm-3.5.8/include -ID:/devel/emacs/libXpm-3.5.8/src'

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ENU
  value of $XMODIFIERS: nil
  locale-coding-system: cp1252
  default enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  erc-list-mode: t
  erc-menu-mode: t
  erc-ring-mode: t
  erc-networks-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-netsplit-mode: t
  paredit-mode: t
  erc-autojoin-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-pcomplete-mode: t
  erc-stamp-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  recentf-mode: t
  desktop-save-mode: t
  autopair-mode: t
  autopair-global-mode: t
  ido-everywhere: t
  yas/global-mode: t
  yas/minor-mode: t
  global-auto-revert-mode: t
  delete-selection-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t

Recent input:
C-e C-a C-x C-f p l u g <return> t h e <return> C-s 
<return> C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-p C-k C-k C-k 
C-x C-s C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-x RET 
C-g C-x C-f M-p M-p <backspace> e r c <return> e r 
c . e l <return> C-v C-x RET l o a d <backspace> <backspace> 
<backspace> <backspace> e v a l - v u <backspace> <backspace> 
b u f f e r <return> C-h v e r c - d e f <tab> f <tab> 
<tab> <tab> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> a <tab> <backspace> f a <tab> 
<tab> <tab> <tab> C-g M-g M-g 1 1 3 9 <return> C-h 
v e r c - h e a d e r - l i n e <tab> <tab> <tab> C-g 
C-h v e r c - i n p u t - f a <tab> <tab> <tab> <tab> 
C-g C-x k <return> C-n C-n C-n C-n C-n C-n C-SPC C-SPC 
C-n C-n C-n C-n C-n C-n C-n C-n M-w C-x m c s u t o 
<backspace> <backspace> <backspace> <backspace> u s 
t o m - t e <backspace> h e m e SPC n o t SPC <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> e m a c s <backspace> <backspace> <backspace> 
<backspace> <backspace> C-x k <return> y <down-mouse-1> 
<mouse-1> C-x m r e p o r t C-x k <return> y C-x RET 
r e p o r t <tab> <return>

Recent messages:
Loading vc-bzr...done
Disabling `erc-pcomplete'
Quit
Mark set
Making completion list...
Quit [2 times]
Mark set
Mark activated
Auto-saving...done
Buffer *unsent mail* modified; kill anyway? (y or n)  y [2 times]

Load-path shadows:
c:/Users/Christoph/AppData/Roaming/.emacs.d/plugins/python hides d:/devel/emacs/emacs-bzr/trunk_readonly/lisp/progmodes/python

Features:
(shadow sort mail-extr emacsbug url-util url-parse url-vars gnus-cite
gnus-msg gnus-art mm-uu mml2015 epg-config mm-view mml-smime smime dig
mailcap vc-bzr tramp warnings tramp-compat auth-source eieio byte-opt
bytecomp byte-compile cconv password-cache tramp-loaddefs vc-hg
network-stream starttls tls erc-menu erc-ring comint ring erc-networks
erc-button erc-fill erc-netsplit paredit my-zenburn-theme sha1 hex-util
erc-join erc-track erc-match erc-pcomplete pcomplete erc-stamp
erc-goodies erc erc-backend erc-compat thingatpt bookmark+ dired-x dired
bookmark+-1 nnir gnus-sum macroexp nnoo gnus-group gnus-undo nnmail
mail-source gnus-start gnus-spec gnus-int gnus-range message format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus
gnus-ems nnheader gnus-util time-date mail-utils mm-util mail-prsvr
bookmark+-bmu help-mode view bookmark+-lit pp+ bookmark+-mac bookmark pp
recentf tree-widget wid-edit midnight desktop ibuffer uniquify autopair
cc-styles cc-align cc-engine cc-vars cc-defs browse-kill-ring+
browse-kill-ring second-sel ido yasnippet dropdown-list easymenu assoc
org-install server advice advice-preload autorevert delsel tooltip
ediff-hook vc-hooks lisp-float-type mwheel dos-w32 disp-table ls-lisp
w32-win w32-vars tool-bar dnd fontset image fringe edmacro kmacro
lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock regexp-opt 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 ccl
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help
help-macro simple derived abbrev minibuffer easy-mmode loaddefs button
faces cus-face files help-fns text-properties overlay md5 base64 format
env cl code-pages mule cus-start custom widget hashtable-print-readable
backquote make-network-process multi-tty emacs)





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

* bug#8454: I can't reproduce this
  2011-04-09  3:51 bug#8454: 24.0; Emacs does not apply additional custom faces from theme Christoph Scholtes
@ 2011-10-23 16:58 ` Dave Abrahams
  2011-12-05  6:54 ` bug#8454: Themes can't work right due to design Chris Hanson
  1 sibling, 0 replies; 6+ messages in thread
From: Dave Abrahams @ 2011-10-23 16:58 UTC (permalink / raw)
  To: 8454

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


In emacs 23.3, I tried to build a minimal test case that would exhibit
some of the problems cited here, and failed.  What I wrote is below, and
loading it with `emacs -Q -l test.el' seems to produce the expected
results.  If there *is* a real problem, it seems to me, some simple
variation on this code should show it.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: test.el --]
[-- Type: text/emacs-lisp, Size: 725 bytes --]

;; define a couple of faces to be used in the theme
(defface face1
    '((t :background "pink"))
    "first test face")
(defface face2
    '((t :background "yellow"))
    "second test face")

;; simulate (load 'theme1)
(deftheme theme1
  "1st test theme")
(custom-theme-set-faces
 'theme1
 '(face2 ((t (:slant italic :inherit (face1)))))
 '(face3 ((t (:background "yellow"))))
 '(face4 ((t (:inherit (face3))))))
(provide-theme 'theme1)
;; done loading theme1

;; define some more faces used in the theme
(defface face3
    '((t :background "pink"))
    "3rd test face")
(defface face4
    '((t :slant italic))
    "4th test face")

;; inspect the faces
(setq inhibit-startup-screen t)
(customize-apropos-faces "^face[0-9]")

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

* bug#8454: Themes can't work right due to design
  2011-04-09  3:51 bug#8454: 24.0; Emacs does not apply additional custom faces from theme Christoph Scholtes
  2011-10-23 16:58 ` bug#8454: I can't reproduce this Dave Abrahams
@ 2011-12-05  6:54 ` Chris Hanson
  2011-12-05 17:52   ` Drew Adams
  2011-12-05 19:03   ` Stefan Monnier
  1 sibling, 2 replies; 6+ messages in thread
From: Chris Hanson @ 2011-12-05  6:54 UTC (permalink / raw)
  To: 8454

I've just started using Emacs 24 (pretest 3), and have run into
problems getting Zenburn to work right.  Previously in Emacs 23 I used
the color-theme package and a zenburn theme designed for that package.
 It needed a little tweaking but is otherwise fine.

In Emacs 24, using custom-theme and a similar zenburn theme designed
for that package, I'm having trouble getting the theme to work
properly.

I believe there are two underlying problems causing this behavior.

The first is that :inherit isn't very useful as a way to say "make the
current face like the specified one".  Because color-theme clobbers
face-defface-spec, it effectively erases any previous face settings,
so that the theme settings are self-contained.  There is no equivalent
way to do this with custom-theme, which has led me to write things
like `(font-lock-type-face ,zenburn-primary-3) rather than
`(font-lock-type-face ((t (:inherit zenburn-primary-3)))) .  This
works but is somewhat unsatisfying.

The second is that a face attribute that's explicitly set can't be
overridden by a custom theme, for reasons I'm not completely clear on.
 For example, "cc-fonts.el" contains (set-face-foreground
'c-annotation-face "blue") and the theme doesn't seem to be able to
override this foreground under any circumstances, even with an
explicitly set :foreground attribute.  This just seems like a bug.

I'll probably just go back to using color-theme, since at least it
works.  I was hoping that Emacs 24 would allow me get good behavior
without it, but alas...

Let me know if you need help debugging anything.





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

* bug#8454: Themes can't work right due to design
  2011-12-05  6:54 ` bug#8454: Themes can't work right due to design Chris Hanson
@ 2011-12-05 17:52   ` Drew Adams
  2011-12-05 19:03   ` Stefan Monnier
  1 sibling, 0 replies; 6+ messages in thread
From: Drew Adams @ 2011-12-05 17:52 UTC (permalink / raw)
  To: 'Chris Hanson', 8454

> :inherit isn't very useful as a way to say "make the
> current face like the specified one".

+1.

It's a sledge hammer, and it is way overused (& increasingly so).
(Just one opinion.)

See also 
http://lists.gnu.org/archive/html/emacs-devel/2011-02/msg00067.html






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

* bug#8454: Themes can't work right due to design
  2011-12-05  6:54 ` bug#8454: Themes can't work right due to design Chris Hanson
  2011-12-05 17:52   ` Drew Adams
@ 2011-12-05 19:03   ` Stefan Monnier
  2011-12-06  2:22     ` Chong Yidong
  1 sibling, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2011-12-05 19:03 UTC (permalink / raw)
  To: Chris Hanson; +Cc: 8454

> The first is that :inherit isn't very useful as a way to say "make the
> current face like the specified one".  Because color-theme clobbers
> face-defface-spec, it effectively erases any previous face settings,
> so that the theme settings are self-contained.  There is no equivalent
> way to do this with custom-theme, which has led me to write things
> like `(font-lock-type-face ,zenburn-primary-3) rather than
> `(font-lock-type-face ((t (:inherit zenburn-primary-3)))) .  This
> works but is somewhat unsatisfying.

I don't really understand the problem here, probably because I'm not
sufficiently versed in themes, but just in case, you may want to give
a more specific example of what behavior you're trying to get, what you
tried (presumably something like ((t (:inherit foo)))) and what you
don't like about the resulting behavior.

> The second is that a face attribute that's explicitly set can't be
> overridden by a custom theme, for reasons I'm not completely clear on.

That's the way the interaction between custom settings and Lisp settings
are defined, because it seems like the only "sane" way to handle it.

>  For example, "cc-fonts.el" contains (set-face-foreground
> 'c-annotation-face "blue")

Probably something that should be fixed.


        Stefan





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

* bug#8454: Themes can't work right due to design
  2011-12-05 19:03   ` Stefan Monnier
@ 2011-12-06  2:22     ` Chong Yidong
  0 siblings, 0 replies; 6+ messages in thread
From: Chong Yidong @ 2011-12-06  2:22 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 8454, Chris Hanson

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

>>  For example, "cc-fonts.el" contains (set-face-foreground
>> 'c-annotation-face "blue")
>
> Probably something that should be fixed.

I've committed a fix for this.





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

end of thread, other threads:[~2011-12-06  2:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-09  3:51 bug#8454: 24.0; Emacs does not apply additional custom faces from theme Christoph Scholtes
2011-10-23 16:58 ` bug#8454: I can't reproduce this Dave Abrahams
2011-12-05  6:54 ` bug#8454: Themes can't work right due to design Chris Hanson
2011-12-05 17:52   ` Drew Adams
2011-12-05 19:03   ` Stefan Monnier
2011-12-06  2:22     ` Chong Yidong

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