Mercurial > hg > xemacs-beta
comparison src/faces.c @ 20:859a2309aef8 r19-15b93
Import from CVS: tag r19-15b93
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:50:05 +0200 |
parents | ac2d302a0011 |
children | 28a7c63c7e1e |
comparison
equal
deleted
inserted
replaced
19:ac1f612d5250 | 20:859a2309aef8 |
---|---|
629 | 629 |
630 return retval; | 630 return retval; |
631 } | 631 } |
632 | 632 |
633 | 633 |
634 DEFUN ("facep", Ffacep, Sfacep, 1, 1, 0 /* | 634 DEFUN ("facep", Ffacep, 1, 1, 0, /* |
635 Return non-nil if OBJECT is a face. | 635 Return non-nil if OBJECT is a face. |
636 */ ) | 636 */ |
637 (object) | 637 (object)) |
638 Lisp_Object object; | |
639 { | 638 { |
640 return (FACEP (object) ? Qt : Qnil); | 639 return (FACEP (object) ? Qt : Qnil); |
641 } | 640 } |
642 | 641 |
643 DEFUN ("find-face", Ffind_face, Sfind_face, 1, 1, 0 /* | 642 DEFUN ("find-face", Ffind_face, 1, 1, 0, /* |
644 Retrieve the face of the given name. | 643 Retrieve the face of the given name. |
645 If FACE-OR-NAME is a face object, it is simply returned. | 644 If FACE-OR-NAME is a face object, it is simply returned. |
646 Otherwise, FACE-OR-NAME should be a symbol. If there is no such face, | 645 Otherwise, FACE-OR-NAME should be a symbol. If there is no such face, |
647 nil is returned. Otherwise the associated face object is returned. | 646 nil is returned. Otherwise the associated face object is returned. |
648 */ ) | 647 */ |
649 (face_or_name) | 648 (face_or_name)) |
650 Lisp_Object face_or_name; | |
651 { | 649 { |
652 Lisp_Object retval; | 650 Lisp_Object retval; |
653 | 651 |
654 if (FACEP (face_or_name)) | 652 if (FACEP (face_or_name)) |
655 return face_or_name; | 653 return face_or_name; |
662 | 660 |
663 /* Check if the name represents a temporary face. */ | 661 /* Check if the name represents a temporary face. */ |
664 return Fgethash (face_or_name, Vtemporary_faces_cache, Qnil); | 662 return Fgethash (face_or_name, Vtemporary_faces_cache, Qnil); |
665 } | 663 } |
666 | 664 |
667 DEFUN ("get-face", Fget_face, Sget_face, 1, 1, 0 /* | 665 DEFUN ("get-face", Fget_face, 1, 1, 0, /* |
668 Retrieve the face of the given name. | 666 Retrieve the face of the given name. |
669 Same as `find-face' except an error is signalled if there is no such | 667 Same as `find-face' except an error is signalled if there is no such |
670 face instead of returning nil. | 668 face instead of returning nil. |
671 */ ) | 669 */ |
672 (name) | 670 (name)) |
673 Lisp_Object name; | |
674 { | 671 { |
675 Lisp_Object face = Ffind_face (name); | 672 Lisp_Object face = Ffind_face (name); |
676 | 673 |
677 if (NILP (face)) | 674 if (NILP (face)) |
678 signal_simple_error ("No such face", name); | 675 signal_simple_error ("No such face", name); |
679 return face; | 676 return face; |
680 } | 677 } |
681 | 678 |
682 DEFUN ("face-name", Fface_name, Sface_name, 1, 1, 0 /* | 679 DEFUN ("face-name", Fface_name, 1, 1, 0, /* |
683 Return the name of the given face. | 680 Return the name of the given face. |
684 */ ) | 681 */ |
685 (face) | 682 (face)) |
686 Lisp_Object face; | |
687 { | 683 { |
688 return (XFACE (Fget_face (face))->name); | 684 return (XFACE (Fget_face (face))->name); |
689 } | 685 } |
690 | 686 |
691 DEFUN ("built-in-face-specifiers", Fbuilt_in_face_specifiers, | 687 DEFUN ("built-in-face-specifiers", Fbuilt_in_face_specifiers, 0, 0, 0, /* |
692 Sbuilt_in_face_specifiers, 0, 0, 0 /* | |
693 Return a list of all built-in face specifier properties. | 688 Return a list of all built-in face specifier properties. |
694 Don't modify this list! | 689 Don't modify this list! |
695 */ ) | 690 */ |
696 () | 691 ()) |
697 { | 692 { |
698 return Vbuilt_in_face_specifiers; | 693 return Vbuilt_in_face_specifiers; |
699 } | 694 } |
700 | 695 |
701 /* These values are retrieved so often that we make a special | 696 /* These values are retrieved so often that we make a special |
760 int *height, int *width) | 755 int *height, int *width) |
761 { | 756 { |
762 default_face_font_info (domain, 0, 0, height, width, 0); | 757 default_face_font_info (domain, 0, 0, height, width, 0); |
763 } | 758 } |
764 | 759 |
765 DEFUN ("face-list", Fface_list, Sface_list, 0, 1, 0 /* | 760 DEFUN ("face-list", Fface_list, 0, 1, 0, /* |
766 Return a list of the names of all defined faces. | 761 Return a list of the names of all defined faces. |
767 If TEMPORARY is nil, only the permanent faces are included. | 762 If TEMPORARY is nil, only the permanent faces are included. |
768 If it is t, only the temporary faces are included. If it is any | 763 If it is t, only the temporary faces are included. If it is any |
769 other non-nil value both permanent and temporary are included. | 764 other non-nil value both permanent and temporary are included. |
770 */ ) | 765 */ |
771 (temporary) | 766 (temporary)) |
772 Lisp_Object temporary; | |
773 { | 767 { |
774 Lisp_Object face_list = Qnil; | 768 Lisp_Object face_list = Qnil; |
775 | 769 |
776 /* Added the permanent faces, if requested. */ | 770 /* Added the permanent faces, if requested. */ |
777 if (NILP (temporary) || !EQ (Qt, temporary)) | 771 if (NILP (temporary) || !EQ (Qt, temporary)) |
786 } | 780 } |
787 | 781 |
788 return face_list; | 782 return face_list; |
789 } | 783 } |
790 | 784 |
791 DEFUN ("make-face", Fmake_face, Smake_face, 1, 3, 0 /* | 785 DEFUN ("make-face", Fmake_face, 1, 3, 0, /* |
792 Defines and returns a new FACE described by DOC-STRING. | 786 Defines and returns a new FACE described by DOC-STRING. |
793 You can modify the font, color, etc of a face with the set-face- functions. | 787 You can modify the font, color, etc of a face with the set-face- functions. |
794 If the face already exists, it is unmodified. | 788 If the face already exists, it is unmodified. |
795 If TEMPORARY is non-nil, this face will cease to exist if not in use. | 789 If TEMPORARY is non-nil, this face will cease to exist if not in use. |
796 */ ) | 790 */ |
797 (name, doc_string, temporary) | 791 (name, doc_string, temporary)) |
798 Lisp_Object name, doc_string, temporary; | |
799 { | 792 { |
800 /* This function can GC if initialized is non-zero */ | 793 /* This function can GC if initialized is non-zero */ |
801 struct Lisp_Face *f; | 794 struct Lisp_Face *f; |
802 Lisp_Object face; | 795 Lisp_Object face; |
803 | 796 |
1751 | 1744 |
1752 update_faces_inheritance (face, property); | 1745 update_faces_inheritance (face, property); |
1753 XFACE (face)->dirty = 1; | 1746 XFACE (face)->dirty = 1; |
1754 } | 1747 } |
1755 | 1748 |
1756 DEFUN ("copy-face", Fcopy_face, Scopy_face, 2, 6, 0 /* | 1749 DEFUN ("copy-face", Fcopy_face, 2, 6, 0, /* |
1757 Defines and returns a new face which is a copy of an existing one, | 1750 Defines and returns a new face which is a copy of an existing one, |
1758 or makes an already-existing face be exactly like another. LOCALE, | 1751 or makes an already-existing face be exactly like another. LOCALE, |
1759 TAG-SET, EXACT-P, and HOW-TO-ADD are as in `copy-specifier'. | 1752 TAG-SET, EXACT-P, and HOW-TO-ADD are as in `copy-specifier'. |
1760 */ ) | 1753 */ |
1761 (old_face, new_name, locale, tag_set, exact_p, how_to_add) | 1754 (old_face, new_name, locale, tag_set, exact_p, how_to_add)) |
1762 Lisp_Object old_face, new_name, locale, tag_set, exact_p, how_to_add; | |
1763 { | 1755 { |
1764 struct Lisp_Face *fold, *fnew; | 1756 struct Lisp_Face *fold, *fnew; |
1765 Lisp_Object new_face = Qnil; | 1757 Lisp_Object new_face = Qnil; |
1766 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 1758 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
1767 | 1759 |
1827 defsymbol (&Qmodeline, "modeline"); | 1819 defsymbol (&Qmodeline, "modeline"); |
1828 defsymbol (&Qleft_margin, "left-margin"); | 1820 defsymbol (&Qleft_margin, "left-margin"); |
1829 defsymbol (&Qright_margin, "right-margin"); | 1821 defsymbol (&Qright_margin, "right-margin"); |
1830 defsymbol (&Qtext_cursor, "text-cursor"); | 1822 defsymbol (&Qtext_cursor, "text-cursor"); |
1831 | 1823 |
1832 defsubr (&Sfacep); | 1824 DEFSUBR (Ffacep); |
1833 defsubr (&Sfind_face); | 1825 DEFSUBR (Ffind_face); |
1834 defsubr (&Sget_face); | 1826 DEFSUBR (Fget_face); |
1835 defsubr (&Sface_name); | 1827 DEFSUBR (Fface_name); |
1836 defsubr (&Sbuilt_in_face_specifiers); | 1828 DEFSUBR (Fbuilt_in_face_specifiers); |
1837 defsubr (&Sface_list); | 1829 DEFSUBR (Fface_list); |
1838 defsubr (&Smake_face); | 1830 DEFSUBR (Fmake_face); |
1839 defsubr (&Scopy_face); | 1831 DEFSUBR (Fcopy_face); |
1840 | 1832 |
1841 defsymbol (&Qfacep, "facep"); | 1833 defsymbol (&Qfacep, "facep"); |
1842 defsymbol (&Qforeground, "foreground"); | 1834 defsymbol (&Qforeground, "foreground"); |
1843 defsymbol (&Qbackground, "background"); | 1835 defsymbol (&Qbackground, "background"); |
1844 /* Qfont defined in general.c */ | 1836 /* Qfont defined in general.c */ |