all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#7966: 23.1.50; bold property, dark background, and defface
@ 2011-02-02 16:01 Jose F. Morales
  2011-02-04  3:25 ` Glenn Morris
  0 siblings, 1 reply; 5+ messages in thread
From: Jose F. Morales @ 2011-02-02 16:01 UTC (permalink / raw)
  To: 7966

When defining a face color as:

    ...
    (((class color) (background light)) (:foreground "NavyBlue" :bold t))
    (((class color) (background dark)) (:foreground "Lavender" :bold t))
    ...

the face does not switch from the light to the dark setting (or
viceversa) when changing the frame background. However, it does if the
face color is defined as:

    (((class color) (background light)) (:foreground "NavyBlue" :weight bold))
    (((class color) (background dark)) (:foreground "Lavender" :weight bold))

Is it a bug or the expected behaviour? Can I safely replaced ":bold t"
by ":weight bold"? Thank you.

In GNU Emacs 23.1.50.1 (x86_64-apple-darwin10.2.0, NS apple-appkit-1038.25)
 of 2009-12-08 on huygens.local
Windowing system distributor `Apple', version 10.3.1038
configured using `configure  '--with-ns''

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: nil
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default enable-multibyte-characters: t

Major mode: Org

Minor modes in effect:
  TeX-PDF-mode: t
  desktop-save-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
e - m o d C-s C-s C-s C-s C-s C-a C-n C-n C-n C-n C-n
C-n C-p C-n C-x o C-n C-v M-v M-< 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-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p
C-p C-p C-p C-p C-p C-p C-p C-n C-n C-n C-n C-n C-n
C-n C-n C-p C-x o C-x 1 C-n C-v C-v C-v C-v C-v C-v
C-v C-v C-v C-v C-v C-v C-v C-x C-f C-a C-f C-f C-g
C-a d C-_ C-s d e f f a C-a C-x b C-g C-x C-b C-x o
C-n C-s . o r g C-a <return> C-n C-p C-x 1 C-n <tab>
C-s T O D O C-s C-a C-n C-p C-p C-n C-p C-p M-x s e
t - b a c <tab> <return> b l <backspace> <backspace>
w h i t e <return> M-x M-p <return> b l a c k <return>
C-n C-p M-x s e t <M-backspace> c u s t o m i z e -
f a <tab> <return> o r g - t o d o <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-n C-n C-n C-p q C-n C-p C-n C-p
M-x M-p C-g M-x s e t - b a c <tab> <return> w h i
t e <return> C-n C-n C-n C-n C-n C-n C-n C-n C-n C-p
C-p C-p C-p C-p C-p C-p C-p C-p C-n C-x b <return>
C-p M-x s e t - b a <tab> <return> b l a c k <return>
C-n C-p C-x b <return> C-p C-n M-x r e p o r <tab>
<return>

Recent messages:
Mark saved where search started
Quit
Mark saved where search started
CHILDREN
Mark saved where search started
Creating customization items...
Creating face editor...done
Creating customization items ...done
Resetting customization items...done
Creating customization setup...done
Quit

Load-path shadows:
/Users/jfran/Documents/git/prolog-commons/systems/ciao/emacs-mode/prolog
hides /Applications/Emacs.app/Contents/Resources/lisp/progmodes/prolog

Features:
(shadow mail-extr message ecomplete rfc822 mml mml-sec password-cache
mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045
qp ietf-drums mailabbrev nnheader gnus-util netrc mm-util mail-prsvr
gmm-utils mailheader canlock sha1 hex-util hashcash mail-utils warnings
emacsbug sendmail org-clock crm cus-edit wid-edit multi-isearch
mule-util parse-time vc-cvs js json thingatpt imenu newcomment python-21
python sym-comp cc-mode cc-fonts cc-menus cc-cmds cc-styles cc-align
cc-engine cc-vars cc-defs make-mode sgml-mode css-mode tex-info texinfo
sh-script executable bibtex reftex-auc latexenc preview prv-emacs
tex-buf reftex-vcr reftex-dcr reftex reftex-vars font-latex latex
tex-style tex org-wl org-w3m org-vm org-rmail org-mhe org-mew org-irc
org-jsinfo org-infojs org-html org-exp org-exp-blocks org-agenda
org-info org-gnus org-bibtex org-bbdb org byte-opt bytecomp byte-compile
advice help-fns advice-preload org-footnote org-src org-list org-faces
org-compat org-macs time-date noutline outline easy-mmode vc-git dired
regexp-opt ciao etags word-help comint ring info vc-dispatcher vc-svn
tex-site server edmacro kmacro desktop cus-start cus-load tooltip
ediff-hook vc-hooks lisp-float-type mwheel ns-win easymenu tool-bar dnd
fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer
select scroll-bar mldrag 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 loaddefs button minibuffer faces
cus-face text-properties overlay md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process ns
multi-tty emacs)





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

* bug#7966: 23.1.50; bold property, dark background, and defface
  2011-02-02 16:01 bug#7966: 23.1.50; bold property, dark background, and defface Jose F. Morales
@ 2011-02-04  3:25 ` Glenn Morris
  2011-02-04  9:08   ` Jose F. Morales
  0 siblings, 1 reply; 5+ messages in thread
From: Glenn Morris @ 2011-02-04  3:25 UTC (permalink / raw)
  To: Jose F. Morales; +Cc: 7966


"Jose F. Morales" wrote:

> Is it a bug or the expected behaviour? 

I would say a bug. (This issue still occurs in the current trunk on GNU/Linux.)

> Can I safely replaced ":bold t" by ":weight bold"?

Yes. The former exists for compatibility with Emacs 20.

> In GNU Emacs 23.1.50.1 (x86_64-apple-darwin10.2.0, NS apple-appkit-1038.25)
>  of 2009-12-08 on huygens.local

That is a very early pre-release of what became 23.2. There is no reason
to use that instead of the 23.2 release.





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

* bug#7966: 23.1.50; bold property, dark background, and defface
  2011-02-04  3:25 ` Glenn Morris
@ 2011-02-04  9:08   ` Jose F. Morales
  2011-02-04 19:02     ` Glenn Morris
  0 siblings, 1 reply; 5+ messages in thread
From: Jose F. Morales @ 2011-02-04  9:08 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 7966

On Fri, Feb 4, 2011 at 4:25 AM, Glenn Morris <rgm@gnu.org> wrote:
>
> "Jose F. Morales" wrote:
>
>> Is it a bug or the expected behaviour?
>
> I would say a bug. (This issue still occurs in the current trunk on GNU/Linux.)
>
>> Can I safely replaced ":bold t" by ":weight bold"?
>
> Yes. The former exists for compatibility with Emacs 20.
>
>> In GNU Emacs 23.1.50.1 (x86_64-apple-darwin10.2.0, NS apple-appkit-1038.25)
>>  of 2009-12-08 on huygens.local
>
> That is a very early pre-release of what became 23.2. There is no reason
> to use that instead of the 23.2 release.

All right. Thank you for the quick answer.

BTW, I have checked that the font-locking part of many .el files still
use the old ":bold t" (e.g., org-mode), and so, are misbehaving. I
understand that switching from bright to dark background on-the-fly is
not a common action. Nevertheless, a short line in the emacs
documentation (unless it is trivial to fix) would save a lot of
headaches :)

Cheers,
Jose





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

* bug#7966: 23.1.50; bold property, dark background, and defface
  2011-02-04  9:08   ` Jose F. Morales
@ 2011-02-04 19:02     ` Glenn Morris
  2011-02-08  4:10       ` Glenn Morris
  0 siblings, 1 reply; 5+ messages in thread
From: Glenn Morris @ 2011-02-04 19:02 UTC (permalink / raw)
  To: Jose F. Morales; +Cc: 7966

"Jose F. Morales" wrote:

> BTW, I have checked that the font-locking part of many .el files still
> use the old ":bold t" (e.g., org-mode), and so, are misbehaving.

I would change them all to use :weight, but I imagine it's because they
want to be compatible with old Emacs versions, sigh.

Can the use of :bold and :italic at least be declared obsolete?

Anyway, here is a possible fix. I would appreciate comments from people
who understand the face code.

I wonder if this issue affects anything else. I also tried adding bold
and italic to face-attribute-name-alist, and changing
internal-get-lisp-face-attribute; but that seemed to cause problems.

=== modified file 'lisp/faces.el'
*** lisp/faces.el	2011-02-03 06:55:48 +0000
--- lisp/faces.el	2011-02-04 18:53:56 +0000
***************
*** 1605,1617 ****
  is used.  If nil or omitted, use the selected frame."
    (unless frame
      (setq frame (selected-frame)))
!   (let ((list face-attribute-name-alist)
! 	(match t))
      (while (and match (not (null list)))
        (let* ((attr (car (car list)))
  	     (specified-value
! 	      (if (plist-member attrs attr)
! 		  (plist-get attrs attr)
  		'unspecified))
  	     (value-now (face-attribute face attr frame)))
  	(setq match (equal specified-value value-now))
--- 1605,1631 ----
  is used.  If nil or omitted, use the selected frame."
    (unless frame
      (setq frame (selected-frame)))
!   (let* ((list face-attribute-name-alist)
! 	 (match t)
! 	 (bold (and (plist-member attrs :bold)
! 		    (not (plist-member attrs :weight))))
! 	 (italic (and (plist-member attrs :italic)
! 		      (not (plist-member attrs :slant))))
! 	 (plist (if (or bold italic)
! 		    (copy-sequence attrs)
! 		  attrs)))
!     ;; Handle the Emacs 20 :bold and :italic properties.
!     (if bold
! 	(plist-put plist :weight (if bold 'bold 'normal)))
!     (if italic
! 	(plist-put plist :slant (if italic 'italic 'normal)))
      (while (and match (not (null list)))
        (let* ((attr (car (car list)))
  	     (specified-value
! 	      (if (plist-member plist attr)
! 		  (plist-get plist attr)
  		'unspecified))
  	     (value-now (face-attribute face attr frame)))
  	(setq match (equal specified-value value-now))






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

* bug#7966: 23.1.50; bold property, dark background, and defface
  2011-02-04 19:02     ` Glenn Morris
@ 2011-02-08  4:10       ` Glenn Morris
  0 siblings, 0 replies; 5+ messages in thread
From: Glenn Morris @ 2011-02-08  4:10 UTC (permalink / raw)
  To: 7966-done

Version: 23.3

In the absence of any comments about that patch I installed it.





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

end of thread, other threads:[~2011-02-08  4:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-02 16:01 bug#7966: 23.1.50; bold property, dark background, and defface Jose F. Morales
2011-02-04  3:25 ` Glenn Morris
2011-02-04  9:08   ` Jose F. Morales
2011-02-04 19:02     ` Glenn Morris
2011-02-08  4:10       ` Glenn Morris

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.