comparison src/minibuf.c @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents 8d2a9b52c682
children 1ce6082ce73f
comparison
equal deleted inserted replaced
69:804d1389bcd6 70:131b0175ea99
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. */
27 24
28 #include <config.h> 25 #include <config.h>
29 #include "lisp.h" 26 #include "lisp.h"
30 27
31 #include "buffer.h" 28 #include "buffer.h"
233 regexps = XCDR (regexps)) 230 regexps = XCDR (regexps))
234 { 231 {
235 Lisp_Object re = XCAR (regexps); 232 Lisp_Object re = XCAR (regexps);
236 if (STRINGP (re) 233 if (STRINGP (re)
237 && (fast_string_match (re, nonreloc, reloc, offset, 234 && (fast_string_match (re, nonreloc, reloc, offset,
238 length, 0, ERROR_ME, 0) < 0)) 235 length, 0, ERROR_ME, 0) >= 0))
239 return (1); 236 return (1);
240 } 237 }
241 } 238 }
242 return (0); 239 return (0);
243 } 240 }
349 } 346 }
350 else 347 else
351 { 348 {
352 if (!ZEROP (bucket)) 349 if (!ZEROP (bucket))
353 { 350 {
354 struct Lisp_Symbol *next; 351 struct Lisp_Symbol *next = symbol_next (XSYMBOL (bucket));
355 if (!SYMBOLP (bucket)) {
356 signal_simple_error("Bad obarry passed to try-completions",
357 bucket);
358 }
359 next = symbol_next (XSYMBOL (bucket));
360 elt = bucket; 352 elt = bucket;
361 eltstring = Fsymbol_name (elt); 353 eltstring = Fsymbol_name (elt);
362 if (next) 354 if (next)
363 XSETSYMBOL (bucket, next); 355 XSETSYMBOL (bucket, next);
364 else 356 else
625 617
626 static Lisp_Object 618 static Lisp_Object
627 clear_echo_area_internal (struct frame *f, Lisp_Object label, int from_print, 619 clear_echo_area_internal (struct frame *f, Lisp_Object label, int from_print,
628 int no_restore) 620 int no_restore)
629 { 621 {
630 /* This function can call lisp */
631 if (!NILP (Ffboundp (Qclear_message))) 622 if (!NILP (Ffboundp (Qclear_message)))
632 { 623 {
633 Lisp_Object frame; 624 Lisp_Object frame;
634 625
635 XSETFRAME (frame, f); 626 XSETFRAME (frame, f);
645 } 636 }
646 637
647 Lisp_Object 638 Lisp_Object
648 clear_echo_area (struct frame *f, Lisp_Object label, int no_restore) 639 clear_echo_area (struct frame *f, Lisp_Object label, int no_restore)
649 { 640 {
650 /* This function can call lisp */
651 return clear_echo_area_internal (f, label, 0, no_restore); 641 return clear_echo_area_internal (f, label, 0, no_restore);
652 } 642 }
653 643
654 Lisp_Object 644 Lisp_Object
655 clear_echo_area_from_print (struct frame *f, Lisp_Object label, int no_restore) 645 clear_echo_area_from_print (struct frame *f, Lisp_Object label, int no_restore)
656 { 646 {
657 /* This function can call lisp */
658 return clear_echo_area_internal (f, label, 1, no_restore); 647 return clear_echo_area_internal (f, label, 1, no_restore);
659 } 648 }
660 649
661 void 650 void
662 echo_area_append (struct frame *f, CONST Bufbyte *nonreloc, Lisp_Object reloc, 651 echo_area_append (struct frame *f, CONST Bufbyte *nonreloc, Lisp_Object reloc,
663 Bytecount offset, Bytecount length, 652 Bytecount offset, Bytecount length,
664 Lisp_Object label) 653 Lisp_Object label)
665 { 654 {
666 /* This function can call lisp */
667 Lisp_Object obj; 655 Lisp_Object obj;
668 struct gcpro gcpro1; 656 struct gcpro gcpro1;
669 Lisp_Object frame; 657 Lisp_Object frame;
670 658
671 /* some callers pass in a null string as a way of clearing the echo area. 659 /* some callers pass in a null string as a way of clearing the echo area.
709 void 697 void
710 echo_area_message (struct frame *f, CONST Bufbyte *nonreloc, 698 echo_area_message (struct frame *f, CONST Bufbyte *nonreloc,
711 Lisp_Object reloc, Bytecount offset, Bytecount length, 699 Lisp_Object reloc, Bytecount offset, Bytecount length,
712 Lisp_Object label) 700 Lisp_Object label)
713 { 701 {
714 /* This function can call lisp */
715 clear_echo_area (f, label, 1); 702 clear_echo_area (f, label, 1);
716 echo_area_append (f, nonreloc, reloc, offset, length, label); 703 echo_area_append (f, nonreloc, reloc, offset, length, label);
717 } 704 }
718 705
719 int 706 int
727 } 714 }
728 715
729 Lisp_Object 716 Lisp_Object
730 echo_area_status (struct frame *f) 717 echo_area_status (struct frame *f)
731 { 718 {
732 /* This function can call lisp */
733 if (!NILP (Ffboundp (Qcurrent_message_label))) 719 if (!NILP (Ffboundp (Qcurrent_message_label)))
734 { 720 {
735 Lisp_Object frame; 721 Lisp_Object frame;
736 722
737 XSETFRAME (frame, f); 723 XSETFRAME (frame, f);
753 string in internal format. */ 739 string in internal format. */
754 void 740 void
755 message_internal (CONST Bufbyte *nonreloc, Lisp_Object reloc, 741 message_internal (CONST Bufbyte *nonreloc, Lisp_Object reloc,
756 Bytecount offset, Bytecount length) 742 Bytecount offset, Bytecount length)
757 { 743 {
758 /* This function can call lisp */ 744 /* This can GC! */
759 if (NILP (Vexecuting_macro)) 745 if (NILP (Vexecuting_macro))
760 echo_area_message (selected_frame (), nonreloc, reloc, offset, length, 746 echo_area_message (selected_frame (), nonreloc, reloc, offset, length,
761 Qmessage); 747 Qmessage);
762 } 748 }
763 749
764 void 750 void
765 message_append_internal (CONST Bufbyte *nonreloc, Lisp_Object reloc, 751 message_append_internal (CONST Bufbyte *nonreloc, Lisp_Object reloc,
766 Bytecount offset, Bytecount length) 752 Bytecount offset, Bytecount length)
767 { 753 {
768 /* This function can call lisp */ 754 /* This can GC! */
769 if (NILP (Vexecuting_macro)) 755 if (NILP (Vexecuting_macro))
770 echo_area_append (selected_frame (), nonreloc, reloc, offset, length, 756 echo_area_append (selected_frame (), nonreloc, reloc, offset, length,
771 Qmessage); 757 Qmessage);
772 } 758 }
773 759
776 on the format string; message_no_translate() does not. */ 762 on the format string; message_no_translate() does not. */
777 763
778 static void 764 static void
779 message_1 (CONST char *fmt, va_list args) 765 message_1 (CONST char *fmt, va_list args)
780 { 766 {
781 /* This function can call lisp */
782 if (fmt) 767 if (fmt)
783 { 768 {
784 struct gcpro gcpro1; 769 struct gcpro gcpro1;
785 /* message_internal() might GC, e.g. if there are after-change-hooks 770 /* message_internal() might GC, e.g. if there are after-change-hooks
786 on the echo area buffer */ 771 on the echo area buffer */
795 } 780 }
796 781
797 static void 782 static void
798 message_append_1 (CONST char *fmt, va_list args) 783 message_append_1 (CONST char *fmt, va_list args)
799 { 784 {
800 /* This function can call lisp */
801 if (fmt) 785 if (fmt)
802 { 786 {
803 struct gcpro gcpro1; 787 struct gcpro gcpro1;
804 /* message_internal() might GC, e.g. if there are after-change-hooks 788 /* message_internal() might GC, e.g. if there are after-change-hooks
805 on the echo area buffer */ 789 on the echo area buffer */
814 } 798 }
815 799
816 void 800 void
817 clear_message (void) 801 clear_message (void)
818 { 802 {
819 /* This function can call lisp */
820 message_internal (0, Qnil, 0, 0); 803 message_internal (0, Qnil, 0, 0);
821 } 804 }
822 805
823 void 806 void
824 message (CONST char *fmt, ...) 807 message (CONST char *fmt, ...)
825 { 808 {
826 /* This function can call lisp */
827 /* I think it's OK to pass the data of Lisp strings as arguments to 809 /* I think it's OK to pass the data of Lisp strings as arguments to
828 this function. No GC'ing will occur until the data has already 810 this function. No GC'ing will occur until the data has already
829 been copied. */ 811 been copied. */
830 va_list args; 812 va_list args;
831 813
837 } 819 }
838 820
839 void 821 void
840 message_append (CONST char *fmt, ...) 822 message_append (CONST char *fmt, ...)
841 { 823 {
842 /* This function can call lisp */
843 va_list args; 824 va_list args;
844 825
845 va_start (args, fmt); 826 va_start (args, fmt);
846 if (fmt) 827 if (fmt)
847 fmt = GETTEXT (fmt); 828 fmt = GETTEXT (fmt);
850 } 831 }
851 832
852 void 833 void
853 message_no_translate (CONST char *fmt, ...) 834 message_no_translate (CONST char *fmt, ...)
854 { 835 {
855 /* This function can call lisp */
856 /* I think it's OK to pass the data of Lisp strings as arguments to 836 /* I think it's OK to pass the data of Lisp strings as arguments to
857 this function. No GC'ing will occur until the data has already 837 this function. No GC'ing will occur until the data has already
858 been copied. */ 838 been copied. */
859 va_list args; 839 va_list args;
860 840
908 DEFVAR_BOOL ("completion-ignore-case", &completion_ignore_case /* 888 DEFVAR_BOOL ("completion-ignore-case", &completion_ignore_case /*
909 Non-nil means don't consider case significant in completion. 889 Non-nil means don't consider case significant in completion.
910 */ ); 890 */ );
911 completion_ignore_case = 0; 891 completion_ignore_case = 0;
912 892
893 /* Worthless doc string */
913 DEFVAR_LISP ("completion-regexp-list", &Vcompletion_regexp_list /* 894 DEFVAR_LISP ("completion-regexp-list", &Vcompletion_regexp_list /*
914 List of regexps that should restrict possible completions. 895 List of regexps that should restrict possible completions.
915 Each completion has to match all regexps in this list.
916 */ ); 896 */ );
917 Vcompletion_regexp_list = Qnil; 897 Vcompletion_regexp_list = Qnil;
918 } 898 }
919 899
920 void 900 void