From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#7966: 23.1.50; bold property, dark background, and defface Date: Fri, 04 Feb 2011 14:02:35 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1296846364 21992 80.91.229.12 (4 Feb 2011 19:06:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 4 Feb 2011 19:06:04 +0000 (UTC) Cc: 7966@debbugs.gnu.org To: "Jose F. Morales" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 04 20:06:00 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PlQyk-00032X-5B for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 Feb 2011 20:05:58 +0100 Original-Received: from localhost ([127.0.0.1]:58339 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PlQyj-0002g4-FX for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 Feb 2011 14:05:57 -0500 Original-Received: from [140.186.70.92] (port=58518 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PlQye-0002ek-Hj for bug-gnu-emacs@gnu.org; Fri, 04 Feb 2011 14:05:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PlQyd-0001a5-1y for bug-gnu-emacs@gnu.org; Fri, 04 Feb 2011 14:05:52 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PlQyc-0001Zz-W1 for bug-gnu-emacs@gnu.org; Fri, 04 Feb 2011 14:05:50 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PlQoA-0003SS-9L; Fri, 04 Feb 2011 13:55:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Feb 2011 18:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7966 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 7966-submit@debbugs.gnu.org id=B7966.129684564713233 (code B ref 7966); Fri, 04 Feb 2011 18:55:02 +0000 Original-Received: (at 7966) by debbugs.gnu.org; 4 Feb 2011 18:54:07 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PlQnH-0003RO-3H for submit@debbugs.gnu.org; Fri, 04 Feb 2011 13:54:07 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PlQnF-0003Qv-15 for 7966@debbugs.gnu.org; Fri, 04 Feb 2011 13:54:05 -0500 Original-Received: from localhost ([127.0.0.1]:50230) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PlQvU-0004Uf-A8; Fri, 04 Feb 2011 14:02:36 -0500 X-Spook: Osama Saudi Arabia clones domestic disruption beanpole X-Ran: U^n0(Atv.HlK8WFs*^6hX/:Z#e|h'jRI3TueH{y+Zk#mvU:&'twLO#~F}3h)Z*\@h`o"Ui X-Hue: blue X-Attribution: GM In-Reply-To: (Jose F. Morales's message of "Fri, 4 Feb 2011 10:08:52 +0100") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 04 Feb 2011 13:55:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:43942 Archived-At: "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))