Mercurial > hg > xemacs-beta
comparison src/minibuf.c @ 44:8d2a9b52c682 r19-15prefinal
Import from CVS: tag r19-15prefinal
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:55:10 +0200 |
parents | e04119814345 |
children | 131b0175ea99 |
comparison
equal
deleted
inserted
replaced
43:23cafc5d2038 | 44:8d2a9b52c682 |
---|---|
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
20 Boston, MA 02111-1307, USA. */ | 20 Boston, MA 02111-1307, USA. */ |
21 | 21 |
22 /* Synched up with: Mule 2.0, FSF 19.28. Mule-ized except as noted. | 22 /* Synched up with: Mule 2.0, FSF 19.28. Mule-ized except as noted. |
23 Substantially different from FSF. */ | 23 Substantially different from FSF. */ |
24 | |
25 /* #### dmoore - All sorts of things in here can call lisp, like message. | |
26 Track all this stuff. */ | |
24 | 27 |
25 #include <config.h> | 28 #include <config.h> |
26 #include "lisp.h" | 29 #include "lisp.h" |
27 | 30 |
28 #include "buffer.h" | 31 #include "buffer.h" |
622 | 625 |
623 static Lisp_Object | 626 static Lisp_Object |
624 clear_echo_area_internal (struct frame *f, Lisp_Object label, int from_print, | 627 clear_echo_area_internal (struct frame *f, Lisp_Object label, int from_print, |
625 int no_restore) | 628 int no_restore) |
626 { | 629 { |
630 /* This function can call lisp */ | |
627 if (!NILP (Ffboundp (Qclear_message))) | 631 if (!NILP (Ffboundp (Qclear_message))) |
628 { | 632 { |
629 Lisp_Object frame; | 633 Lisp_Object frame; |
630 | 634 |
631 XSETFRAME (frame, f); | 635 XSETFRAME (frame, f); |
641 } | 645 } |
642 | 646 |
643 Lisp_Object | 647 Lisp_Object |
644 clear_echo_area (struct frame *f, Lisp_Object label, int no_restore) | 648 clear_echo_area (struct frame *f, Lisp_Object label, int no_restore) |
645 { | 649 { |
650 /* This function can call lisp */ | |
646 return clear_echo_area_internal (f, label, 0, no_restore); | 651 return clear_echo_area_internal (f, label, 0, no_restore); |
647 } | 652 } |
648 | 653 |
649 Lisp_Object | 654 Lisp_Object |
650 clear_echo_area_from_print (struct frame *f, Lisp_Object label, int no_restore) | 655 clear_echo_area_from_print (struct frame *f, Lisp_Object label, int no_restore) |
651 { | 656 { |
657 /* This function can call lisp */ | |
652 return clear_echo_area_internal (f, label, 1, no_restore); | 658 return clear_echo_area_internal (f, label, 1, no_restore); |
653 } | 659 } |
654 | 660 |
655 void | 661 void |
656 echo_area_append (struct frame *f, CONST Bufbyte *nonreloc, Lisp_Object reloc, | 662 echo_area_append (struct frame *f, CONST Bufbyte *nonreloc, Lisp_Object reloc, |
657 Bytecount offset, Bytecount length, | 663 Bytecount offset, Bytecount length, |
658 Lisp_Object label) | 664 Lisp_Object label) |
659 { | 665 { |
666 /* This function can call lisp */ | |
660 Lisp_Object obj; | 667 Lisp_Object obj; |
661 struct gcpro gcpro1; | 668 struct gcpro gcpro1; |
662 Lisp_Object frame; | 669 Lisp_Object frame; |
663 | 670 |
664 /* some callers pass in a null string as a way of clearing the echo area. | 671 /* some callers pass in a null string as a way of clearing the echo area. |
702 void | 709 void |
703 echo_area_message (struct frame *f, CONST Bufbyte *nonreloc, | 710 echo_area_message (struct frame *f, CONST Bufbyte *nonreloc, |
704 Lisp_Object reloc, Bytecount offset, Bytecount length, | 711 Lisp_Object reloc, Bytecount offset, Bytecount length, |
705 Lisp_Object label) | 712 Lisp_Object label) |
706 { | 713 { |
714 /* This function can call lisp */ | |
707 clear_echo_area (f, label, 1); | 715 clear_echo_area (f, label, 1); |
708 echo_area_append (f, nonreloc, reloc, offset, length, label); | 716 echo_area_append (f, nonreloc, reloc, offset, length, label); |
709 } | 717 } |
710 | 718 |
711 int | 719 int |
719 } | 727 } |
720 | 728 |
721 Lisp_Object | 729 Lisp_Object |
722 echo_area_status (struct frame *f) | 730 echo_area_status (struct frame *f) |
723 { | 731 { |
732 /* This function can call lisp */ | |
724 if (!NILP (Ffboundp (Qcurrent_message_label))) | 733 if (!NILP (Ffboundp (Qcurrent_message_label))) |
725 { | 734 { |
726 Lisp_Object frame; | 735 Lisp_Object frame; |
727 | 736 |
728 XSETFRAME (frame, f); | 737 XSETFRAME (frame, f); |
744 string in internal format. */ | 753 string in internal format. */ |
745 void | 754 void |
746 message_internal (CONST Bufbyte *nonreloc, Lisp_Object reloc, | 755 message_internal (CONST Bufbyte *nonreloc, Lisp_Object reloc, |
747 Bytecount offset, Bytecount length) | 756 Bytecount offset, Bytecount length) |
748 { | 757 { |
749 /* This can GC! */ | 758 /* This function can call lisp */ |
750 if (NILP (Vexecuting_macro)) | 759 if (NILP (Vexecuting_macro)) |
751 echo_area_message (selected_frame (), nonreloc, reloc, offset, length, | 760 echo_area_message (selected_frame (), nonreloc, reloc, offset, length, |
752 Qmessage); | 761 Qmessage); |
753 } | 762 } |
754 | 763 |
755 void | 764 void |
756 message_append_internal (CONST Bufbyte *nonreloc, Lisp_Object reloc, | 765 message_append_internal (CONST Bufbyte *nonreloc, Lisp_Object reloc, |
757 Bytecount offset, Bytecount length) | 766 Bytecount offset, Bytecount length) |
758 { | 767 { |
759 /* This can GC! */ | 768 /* This function can call lisp */ |
760 if (NILP (Vexecuting_macro)) | 769 if (NILP (Vexecuting_macro)) |
761 echo_area_append (selected_frame (), nonreloc, reloc, offset, length, | 770 echo_area_append (selected_frame (), nonreloc, reloc, offset, length, |
762 Qmessage); | 771 Qmessage); |
763 } | 772 } |
764 | 773 |
767 on the format string; message_no_translate() does not. */ | 776 on the format string; message_no_translate() does not. */ |
768 | 777 |
769 static void | 778 static void |
770 message_1 (CONST char *fmt, va_list args) | 779 message_1 (CONST char *fmt, va_list args) |
771 { | 780 { |
781 /* This function can call lisp */ | |
772 if (fmt) | 782 if (fmt) |
773 { | 783 { |
774 struct gcpro gcpro1; | 784 struct gcpro gcpro1; |
775 /* message_internal() might GC, e.g. if there are after-change-hooks | 785 /* message_internal() might GC, e.g. if there are after-change-hooks |
776 on the echo area buffer */ | 786 on the echo area buffer */ |
785 } | 795 } |
786 | 796 |
787 static void | 797 static void |
788 message_append_1 (CONST char *fmt, va_list args) | 798 message_append_1 (CONST char *fmt, va_list args) |
789 { | 799 { |
800 /* This function can call lisp */ | |
790 if (fmt) | 801 if (fmt) |
791 { | 802 { |
792 struct gcpro gcpro1; | 803 struct gcpro gcpro1; |
793 /* message_internal() might GC, e.g. if there are after-change-hooks | 804 /* message_internal() might GC, e.g. if there are after-change-hooks |
794 on the echo area buffer */ | 805 on the echo area buffer */ |
803 } | 814 } |
804 | 815 |
805 void | 816 void |
806 clear_message (void) | 817 clear_message (void) |
807 { | 818 { |
819 /* This function can call lisp */ | |
808 message_internal (0, Qnil, 0, 0); | 820 message_internal (0, Qnil, 0, 0); |
809 } | 821 } |
810 | 822 |
811 void | 823 void |
812 message (CONST char *fmt, ...) | 824 message (CONST char *fmt, ...) |
813 { | 825 { |
826 /* This function can call lisp */ | |
814 /* I think it's OK to pass the data of Lisp strings as arguments to | 827 /* I think it's OK to pass the data of Lisp strings as arguments to |
815 this function. No GC'ing will occur until the data has already | 828 this function. No GC'ing will occur until the data has already |
816 been copied. */ | 829 been copied. */ |
817 va_list args; | 830 va_list args; |
818 | 831 |
824 } | 837 } |
825 | 838 |
826 void | 839 void |
827 message_append (CONST char *fmt, ...) | 840 message_append (CONST char *fmt, ...) |
828 { | 841 { |
842 /* This function can call lisp */ | |
829 va_list args; | 843 va_list args; |
830 | 844 |
831 va_start (args, fmt); | 845 va_start (args, fmt); |
832 if (fmt) | 846 if (fmt) |
833 fmt = GETTEXT (fmt); | 847 fmt = GETTEXT (fmt); |
836 } | 850 } |
837 | 851 |
838 void | 852 void |
839 message_no_translate (CONST char *fmt, ...) | 853 message_no_translate (CONST char *fmt, ...) |
840 { | 854 { |
855 /* This function can call lisp */ | |
841 /* I think it's OK to pass the data of Lisp strings as arguments to | 856 /* I think it's OK to pass the data of Lisp strings as arguments to |
842 this function. No GC'ing will occur until the data has already | 857 this function. No GC'ing will occur until the data has already |
843 been copied. */ | 858 been copied. */ |
844 va_list args; | 859 va_list args; |
845 | 860 |