GNU bug report logs - #7966
23.1.50; bold property, dark background, and defface

Previous Next

Package: emacs;

Reported by: "Jose F. Morales" <jfran <at> clip.dia.fi.upm.es>

Date: Wed, 2 Feb 2011 17:34:02 UTC

Severity: normal

Found in version 23.1.50

Fixed in version 23.3

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Glenn Morris <rgm <at> gnu.org>
To: "Jose F. Morales" <jfran <at> clip.dia.fi.upm.es>
Cc: 7966 <at> debbugs.gnu.org
Subject: bug#7966: 23.1.50; bold property, dark background, and defface
Date: Fri, 04 Feb 2011 14:02:35 -0500
"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))





This bug report was last modified 14 years and 104 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.