comparison lisp/faces.el @ 36060:d9b4d1370073

(set-face-background, set-face-foreground) (set-face-stipple): Treat a value of nil as being `unspecified'.
author Miles Bader <miles@gnu.org>
date Tue, 13 Feb 2001 02:02:20 +0000
parents ed26bdb38c1f
children 6ae575a7a695
comparison
equal deleted inserted replaced
36059:707404e4b86f 36060:d9b4d1370073
1 ;;; faces.el --- Lisp faces 1 ;;; faces.el --- Lisp faces
2 2
3 ;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000 3 ;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
4 ;; Free Software Foundation, Inc. 4 ;; Free Software Foundation, Inc.
5 5
6 ;; This file is part of GNU Emacs. 6 ;; This file is part of GNU Emacs.
7 7
8 ;; GNU Emacs is free software; you can redistribute it and/or modify 8 ;; GNU Emacs is free software; you can redistribute it and/or modify
646 (defun set-face-background (face color &optional frame) 646 (defun set-face-background (face color &optional frame)
647 "Change the background color of face FACE to COLOR (a string). 647 "Change the background color of face FACE to COLOR (a string).
648 FRAME nil or not specified means change face on all frames. 648 FRAME nil or not specified means change face on all frames.
649 When called interactively, prompt for the face and color." 649 When called interactively, prompt for the face and color."
650 (interactive (read-face-and-attribute :background)) 650 (interactive (read-face-and-attribute :background))
651 (set-face-attribute face frame :background color)) 651 (set-face-attribute face frame :background (or color 'unspecified)))
652 652
653 653
654 (defun set-face-foreground (face color &optional frame) 654 (defun set-face-foreground (face color &optional frame)
655 "Change the foreground color of face FACE to COLOR (a string). 655 "Change the foreground color of face FACE to COLOR (a string).
656 FRAME nil or not specified means change face on all frames. 656 FRAME nil or not specified means change face on all frames.
657 When called interactively, prompt for the face and color." 657 When called interactively, prompt for the face and color."
658 (interactive (read-face-and-attribute :foreground)) 658 (interactive (read-face-and-attribute :foreground))
659 (set-face-attribute face frame :foreground color)) 659 (set-face-attribute face frame :foreground (or color 'unspecified)))
660 660
661 661
662 (defun set-face-stipple (face stipple &optional frame) 662 (defun set-face-stipple (face stipple &optional frame)
663 "Change the stipple pixmap of face FACE to STIPPLE. 663 "Change the stipple pixmap of face FACE to STIPPLE.
664 FRAME nil or not specified means change face on all frames. 664 FRAME nil or not specified means change face on all frames.
667 667
668 Alternatively, STIPPLE may be a list of the form (WIDTH HEIGHT DATA) 668 Alternatively, STIPPLE may be a list of the form (WIDTH HEIGHT DATA)
669 where WIDTH and HEIGHT are the size in pixels, 669 where WIDTH and HEIGHT are the size in pixels,
670 and DATA is a string, containing the raw bits of the bitmap." 670 and DATA is a string, containing the raw bits of the bitmap."
671 (interactive (read-face-and-attribute :stipple)) 671 (interactive (read-face-and-attribute :stipple))
672 (set-face-attribute face frame :stipple stipple)) 672 (set-face-attribute face frame :stipple (or stipple 'unspecified)))
673 673
674 674
675 (defun set-face-underline (face underline &optional frame) 675 (defun set-face-underline (face underline &optional frame)
676 "Specify whether face FACE is underlined. 676 "Specify whether face FACE is underlined.
677 UNDERLINE nil means FACE explicitly doesn't underline. 677 UNDERLINE nil means FACE explicitly doesn't underline.