diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2011-02-12 18:40:43 -0500 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2011-02-12 18:40:43 -0500 |
commit | 84eb0351d8be4811897c8cf62a69757ff5d14001 (patch) | |
tree | 80162dabf78b97982b32679e2cb7e377d5b12d01 /lisp/faces.el | |
parent | cdfa139da44fd9b1a5425400635e474e85d866f4 (diff) | |
parent | 165bc5a066990bace024c04ba431f140a25d0bfd (diff) | |
download | emacs-84eb0351d8be4811897c8cf62a69757ff5d14001.tar.gz |
Merge changes from emacs-23 branch
Diffstat (limited to 'lisp/faces.el')
-rw-r--r-- | lisp/faces.el | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/lisp/faces.el b/lisp/faces.el index 2a0badab370..11c4108644a 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1577,13 +1577,25 @@ Optional parameter FRAME is the frame whose definition of FACE is used. If nil or omitted, use the selected frame." (unless frame (setq frame (selected-frame))) - (let ((list face-attribute-name-alist) - (match t)) + (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 list) (let* ((attr (caar list)) (specified-value - (if (plist-member attrs attr) - (plist-get attrs attr) + (if (plist-member plist attr) + (plist-get plist attr) 'unspecified)) (value-now (face-attribute face attr frame))) (setq match (equal specified-value value-now)) |