comparison src/minibuf.c @ 116:9f59509498e1 r20-1b10

Import from CVS: tag r20-1b10
author cvs
date Mon, 13 Aug 2007 09:23:06 +0200
parents fe104dbd9147
children 538048ae2ab8
comparison
equal deleted inserted replaced
115:f109f7dabbe2 116:9f59509498e1
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"
645 648
646 static Lisp_Object 649 static Lisp_Object
647 clear_echo_area_internal (struct frame *f, Lisp_Object label, int from_print, 650 clear_echo_area_internal (struct frame *f, Lisp_Object label, int from_print,
648 int no_restore) 651 int no_restore)
649 { 652 {
653 /* This function can call lisp */
650 if (!NILP (Ffboundp (Qclear_message))) 654 if (!NILP (Ffboundp (Qclear_message)))
651 { 655 {
652 Lisp_Object frame; 656 Lisp_Object frame;
653 657
654 XSETFRAME (frame, f); 658 XSETFRAME (frame, f);
664 } 668 }
665 669
666 Lisp_Object 670 Lisp_Object
667 clear_echo_area (struct frame *f, Lisp_Object label, int no_restore) 671 clear_echo_area (struct frame *f, Lisp_Object label, int no_restore)
668 { 672 {
673 /* This function can call lisp */
669 return clear_echo_area_internal (f, label, 0, no_restore); 674 return clear_echo_area_internal (f, label, 0, no_restore);
670 } 675 }
671 676
672 Lisp_Object 677 Lisp_Object
673 clear_echo_area_from_print (struct frame *f, Lisp_Object label, int no_restore) 678 clear_echo_area_from_print (struct frame *f, Lisp_Object label, int no_restore)
674 { 679 {
680 /* This function can call lisp */
675 return clear_echo_area_internal (f, label, 1, no_restore); 681 return clear_echo_area_internal (f, label, 1, no_restore);
676 } 682 }
677 683
678 void 684 void
679 echo_area_append (struct frame *f, CONST Bufbyte *nonreloc, Lisp_Object reloc, 685 echo_area_append (struct frame *f, CONST Bufbyte *nonreloc, Lisp_Object reloc,
680 Bytecount offset, Bytecount length, 686 Bytecount offset, Bytecount length,
681 Lisp_Object label) 687 Lisp_Object label)
682 { 688 {
689 /* This function can call lisp */
683 Lisp_Object obj; 690 Lisp_Object obj;
684 struct gcpro gcpro1; 691 struct gcpro gcpro1;
685 Lisp_Object frame; 692 Lisp_Object frame;
686 693
687 /* some callers pass in a null string as a way of clearing the echo area. 694 /* some callers pass in a null string as a way of clearing the echo area.
725 void 732 void
726 echo_area_message (struct frame *f, CONST Bufbyte *nonreloc, 733 echo_area_message (struct frame *f, CONST Bufbyte *nonreloc,
727 Lisp_Object reloc, Bytecount offset, Bytecount length, 734 Lisp_Object reloc, Bytecount offset, Bytecount length,
728 Lisp_Object label) 735 Lisp_Object label)
729 { 736 {
737 /* This function can call lisp */
730 clear_echo_area (f, label, 1); 738 clear_echo_area (f, label, 1);
731 echo_area_append (f, nonreloc, reloc, offset, length, label); 739 echo_area_append (f, nonreloc, reloc, offset, length, label);
732 } 740 }
733 741
734 int 742 int
742 } 750 }
743 751
744 Lisp_Object 752 Lisp_Object
745 echo_area_status (struct frame *f) 753 echo_area_status (struct frame *f)
746 { 754 {
755 /* This function can call lisp */
747 if (!NILP (Ffboundp (Qcurrent_message_label))) 756 if (!NILP (Ffboundp (Qcurrent_message_label)))
748 { 757 {
749 Lisp_Object frame; 758 Lisp_Object frame;
750 759
751 XSETFRAME (frame, f); 760 XSETFRAME (frame, f);
767 string in internal format. */ 776 string in internal format. */
768 void 777 void
769 message_internal (CONST Bufbyte *nonreloc, Lisp_Object reloc, 778 message_internal (CONST Bufbyte *nonreloc, Lisp_Object reloc,
770 Bytecount offset, Bytecount length) 779 Bytecount offset, Bytecount length)
771 { 780 {
772 /* This can GC! */ 781 /* This function can call lisp */
773 if (NILP (Vexecuting_macro)) 782 if (NILP (Vexecuting_macro))
774 echo_area_message (selected_frame (), nonreloc, reloc, offset, length, 783 echo_area_message (selected_frame (), nonreloc, reloc, offset, length,
775 Qmessage); 784 Qmessage);
776 } 785 }
777 786
778 void 787 void
779 message_append_internal (CONST Bufbyte *nonreloc, Lisp_Object reloc, 788 message_append_internal (CONST Bufbyte *nonreloc, Lisp_Object reloc,
780 Bytecount offset, Bytecount length) 789 Bytecount offset, Bytecount length)
781 { 790 {
782 /* This can GC! */ 791 /* This function can call lisp */
783 if (NILP (Vexecuting_macro)) 792 if (NILP (Vexecuting_macro))
784 echo_area_append (selected_frame (), nonreloc, reloc, offset, length, 793 echo_area_append (selected_frame (), nonreloc, reloc, offset, length,
785 Qmessage); 794 Qmessage);
786 } 795 }
787 796
790 on the format string; message_no_translate() does not. */ 799 on the format string; message_no_translate() does not. */
791 800
792 static void 801 static void
793 message_1 (CONST char *fmt, va_list args) 802 message_1 (CONST char *fmt, va_list args)
794 { 803 {
804 /* This function can call lisp */
795 if (fmt) 805 if (fmt)
796 { 806 {
797 struct gcpro gcpro1; 807 struct gcpro gcpro1;
798 /* message_internal() might GC, e.g. if there are after-change-hooks 808 /* message_internal() might GC, e.g. if there are after-change-hooks
799 on the echo area buffer */ 809 on the echo area buffer */
808 } 818 }
809 819
810 static void 820 static void
811 message_append_1 (CONST char *fmt, va_list args) 821 message_append_1 (CONST char *fmt, va_list args)
812 { 822 {
823 /* This function can call lisp */
813 if (fmt) 824 if (fmt)
814 { 825 {
815 struct gcpro gcpro1; 826 struct gcpro gcpro1;
816 /* message_internal() might GC, e.g. if there are after-change-hooks 827 /* message_internal() might GC, e.g. if there are after-change-hooks
817 on the echo area buffer */ 828 on the echo area buffer */
826 } 837 }
827 838
828 void 839 void
829 clear_message (void) 840 clear_message (void)
830 { 841 {
842 /* This function can call lisp */
831 message_internal (0, Qnil, 0, 0); 843 message_internal (0, Qnil, 0, 0);
832 } 844 }
833 845
834 void 846 void
835 message (CONST char *fmt, ...) 847 message (CONST char *fmt, ...)
836 { 848 {
849 /* This function can call lisp */
837 /* I think it's OK to pass the data of Lisp strings as arguments to 850 /* I think it's OK to pass the data of Lisp strings as arguments to
838 this function. No GC'ing will occur until the data has already 851 this function. No GC'ing will occur until the data has already
839 been copied. */ 852 been copied. */
840 va_list args; 853 va_list args;
841 854
847 } 860 }
848 861
849 void 862 void
850 message_append (CONST char *fmt, ...) 863 message_append (CONST char *fmt, ...)
851 { 864 {
865 /* This function can call lisp */
852 va_list args; 866 va_list args;
853 867
854 va_start (args, fmt); 868 va_start (args, fmt);
855 if (fmt) 869 if (fmt)
856 fmt = GETTEXT (fmt); 870 fmt = GETTEXT (fmt);
859 } 873 }
860 874
861 void 875 void
862 message_no_translate (CONST char *fmt, ...) 876 message_no_translate (CONST char *fmt, ...)
863 { 877 {
878 /* This function can call lisp */
864 /* I think it's OK to pass the data of Lisp strings as arguments to 879 /* I think it's OK to pass the data of Lisp strings as arguments to
865 this function. No GC'ing will occur until the data has already 880 this function. No GC'ing will occur until the data has already
866 been copied. */ 881 been copied. */
867 va_list args; 882 va_list args;
868 883