Mercurial > hg > xemacs-beta
comparison lisp/faces.el @ 5597:79a1a759ec3d
Prevent bogus caching of background in custom-properties
author | Vin Shelton <acs@xemacs.org> |
---|---|
date | Tue, 15 Nov 2011 20:19:20 -0500 |
parents | 071b810ceb18 |
children | b0d712bbc2a6 |
comparison
equal
deleted
inserted
replaced
5596:3b1d4fa716a4 | 5597:79a1a759ec3d |
---|---|
1584 "Return a plist with the frame properties of FRAME used by custom." | 1584 "Return a plist with the frame properties of FRAME used by custom." |
1585 (list 'type (or (frame-property frame 'display-type) | 1585 (list 'type (or (frame-property frame 'display-type) |
1586 (device-type (frame-device frame))) | 1586 (device-type (frame-device frame))) |
1587 'class (device-class (frame-device frame)) | 1587 'class (device-class (frame-device frame)) |
1588 'background (or frame-background-mode | 1588 'background (or frame-background-mode |
1589 (frame-property frame 'background-mode) | |
1590 (get-frame-background-mode frame)))) | 1589 (get-frame-background-mode frame)))) |
1591 | 1590 |
1592 (defcustom init-face-from-resources t | 1591 (defcustom init-face-from-resources t |
1593 "If non nil, attempt to initialize faces from the resource database." | 1592 "If non nil, attempt to initialize faces from the resource database." |
1594 :group 'faces | 1593 :group 'faces |
1645 See `defface' for a list of valid keys and values for the plist.") | 1644 See `defface' for a list of valid keys and values for the plist.") |
1646 | 1645 |
1647 (defun get-custom-frame-properties (&optional frame) | 1646 (defun get-custom-frame-properties (&optional frame) |
1648 "Return a plist with the frame properties of FRAME used by custom. | 1647 "Return a plist with the frame properties of FRAME used by custom. |
1649 If FRAME is nil, return the default frame properties." | 1648 If FRAME is nil, return the default frame properties." |
1650 (cond (frame | 1649 (cond (frame (extract-custom-frame-properties frame)) |
1651 ;; Try to get from cache. | |
1652 (let ((cache (frame-property frame 'custom-properties))) | |
1653 (unless cache | |
1654 ;; Oh well, get it then. | |
1655 (setq cache (extract-custom-frame-properties frame)) | |
1656 ;; and cache it... | |
1657 (set-frame-property frame 'custom-properties cache)) | |
1658 cache)) | |
1659 (default-custom-frame-properties) | 1650 (default-custom-frame-properties) |
1660 (t | 1651 (t |
1661 (setq default-custom-frame-properties | 1652 (setq default-custom-frame-properties |
1662 (extract-custom-frame-properties (selected-frame)))))) | 1653 (extract-custom-frame-properties (selected-frame)))))) |
1663 | 1654 |