comparison src/minibuf.c @ 442:abe6d1db359e r21-2-36

Import from CVS: tag r21-2-36
author cvs
date Mon, 13 Aug 2007 11:35:02 +0200
parents 8de8e3f6228a
children 576fb035e263
comparison
equal deleted inserted replaced
441:72a7cfa4a488 442:abe6d1db359e
203 This is necessary for many reasons, one of which is that two 203 This is necessary for many reasons, one of which is that two
204 strings may match even if they have different numbers of bytes, 204 strings may match even if they have different numbers of bytes,
205 if IGNORE_CASE is true. */ 205 if IGNORE_CASE is true. */
206 206
207 Charcount 207 Charcount
208 scmp_1 (CONST Bufbyte *s1, CONST Bufbyte *s2, Charcount len, 208 scmp_1 (const Bufbyte *s1, const Bufbyte *s2, Charcount len,
209 int ignore_case) 209 int ignore_case)
210 { 210 {
211 Charcount l = len; 211 Charcount l = len;
212 212
213 if (ignore_case) 213 if (ignore_case)
242 else return len - l; 242 else return len - l;
243 } 243 }
244 244
245 245
246 int 246 int
247 regexp_ignore_completion_p (CONST Bufbyte *nonreloc, 247 regexp_ignore_completion_p (const Bufbyte *nonreloc,
248 Lisp_Object reloc, Bytecount offset, 248 Lisp_Object reloc, Bytecount offset,
249 Bytecount length) 249 Bytecount length)
250 { 250 {
251 /* Ignore this element if it fails to match all the regexps. */ 251 /* Ignore this element if it fails to match all the regexps. */
252 if (!NILP (Vcompletion_regexp_list)) 252 if (!NILP (Vcompletion_regexp_list))
679 return call4 (Qclear_message, label, frame, from_print ? Qt : Qnil, 679 return call4 (Qclear_message, label, frame, from_print ? Qt : Qnil,
680 no_restore ? Qt : Qnil); 680 no_restore ? Qt : Qnil);
681 } 681 }
682 else 682 else
683 { 683 {
684 write_string_to_stdio_stream (stderr, 0, (CONST Bufbyte *) "\n", 0, 1, 684 write_string_to_stdio_stream (stderr, 0, (const Bufbyte *) "\n", 0, 1,
685 Qterminal); 685 Qterminal, 0);
686 return Qnil; 686 return Qnil;
687 } 687 }
688 } 688 }
689 689
690 Lisp_Object 690 Lisp_Object
700 /* This function can call lisp */ 700 /* This function can call lisp */
701 return clear_echo_area_internal (f, label, 1, no_restore); 701 return clear_echo_area_internal (f, label, 1, no_restore);
702 } 702 }
703 703
704 void 704 void
705 echo_area_append (struct frame *f, CONST Bufbyte *nonreloc, Lisp_Object reloc, 705 echo_area_append (struct frame *f, const Bufbyte *nonreloc, Lisp_Object reloc,
706 Bytecount offset, Bytecount length, 706 Bytecount offset, Bytecount length,
707 Lisp_Object label) 707 Lisp_Object label)
708 { 708 {
709 /* This function can call lisp */ 709 /* This function can call lisp */
710 Lisp_Object obj; 710 Lisp_Object obj;
749 else 749 else
750 { 750 {
751 if (STRINGP (reloc)) 751 if (STRINGP (reloc))
752 nonreloc = XSTRING_DATA (reloc); 752 nonreloc = XSTRING_DATA (reloc);
753 write_string_to_stdio_stream (stderr, 0, nonreloc, offset, length, 753 write_string_to_stdio_stream (stderr, 0, nonreloc, offset, length,
754 Qterminal); 754 Qterminal, 0);
755 } 755 }
756 } 756 }
757 757
758 void 758 void
759 echo_area_message (struct frame *f, CONST Bufbyte *nonreloc, 759 echo_area_message (struct frame *f, const Bufbyte *nonreloc,
760 Lisp_Object reloc, Bytecount offset, Bytecount length, 760 Lisp_Object reloc, Bytecount offset, Bytecount length,
761 Lisp_Object label) 761 Lisp_Object label)
762 { 762 {
763 /* This function can call lisp */ 763 /* This function can call lisp */
764 clear_echo_area (f, label, 1); 764 clear_echo_area (f, label, 1);
799 } 799 }
800 800
801 /* Dump an informative message to the echo area. This function takes a 801 /* Dump an informative message to the echo area. This function takes a
802 string in internal format. */ 802 string in internal format. */
803 void 803 void
804 message_internal (CONST Bufbyte *nonreloc, Lisp_Object reloc, 804 message_internal (const Bufbyte *nonreloc, Lisp_Object reloc,
805 Bytecount offset, Bytecount length) 805 Bytecount offset, Bytecount length)
806 { 806 {
807 /* This function can call lisp */ 807 /* This function can call lisp */
808 if (NILP (Vexecuting_macro)) 808 if (NILP (Vexecuting_macro))
809 echo_area_message (selected_frame (), nonreloc, reloc, offset, length, 809 echo_area_message (selected_frame (), nonreloc, reloc, offset, length,
810 Qmessage); 810 Qmessage);
811 } 811 }
812 812
813 void 813 void
814 message_append_internal (CONST Bufbyte *nonreloc, Lisp_Object reloc, 814 message_append_internal (const Bufbyte *nonreloc, Lisp_Object reloc,
815 Bytecount offset, Bytecount length) 815 Bytecount offset, Bytecount length)
816 { 816 {
817 /* This function can call lisp */ 817 /* This function can call lisp */
818 if (NILP (Vexecuting_macro)) 818 if (NILP (Vexecuting_macro))
819 echo_area_append (selected_frame (), nonreloc, reloc, offset, length, 819 echo_area_append (selected_frame (), nonreloc, reloc, offset, length,
823 /* The next three functions are interfaces to message_internal() that 823 /* The next three functions are interfaces to message_internal() that
824 take strings in external format. message() does I18N3 translating 824 take strings in external format. message() does I18N3 translating
825 on the format string; message_no_translate() does not. */ 825 on the format string; message_no_translate() does not. */
826 826
827 static void 827 static void
828 message_1 (CONST char *fmt, va_list args) 828 message_1 (const char *fmt, va_list args)
829 { 829 {
830 /* This function can call lisp */ 830 /* This function can call lisp */
831 if (fmt) 831 if (fmt)
832 { 832 {
833 struct gcpro gcpro1; 833 struct gcpro gcpro1;
834 /* message_internal() might GC, e.g. if there are after-change-hooks 834 /* message_internal() might GC, e.g. if there are after-change-hooks
835 on the echo area buffer */ 835 on the echo area buffer */
836 Lisp_Object obj = emacs_doprnt_string_va ((CONST Bufbyte *) fmt, Qnil, 836 Lisp_Object obj = emacs_doprnt_string_va ((const Bufbyte *) fmt, Qnil,
837 -1, args); 837 -1, args);
838 GCPRO1 (obj); 838 GCPRO1 (obj);
839 message_internal (0, obj, 0, -1); 839 message_internal (0, obj, 0, -1);
840 UNGCPRO; 840 UNGCPRO;
841 } 841 }
842 else 842 else
843 message_internal (0, Qnil, 0, 0); 843 message_internal (0, Qnil, 0, 0);
844 } 844 }
845 845
846 static void 846 static void
847 message_append_1 (CONST char *fmt, va_list args) 847 message_append_1 (const char *fmt, va_list args)
848 { 848 {
849 /* This function can call lisp */ 849 /* This function can call lisp */
850 if (fmt) 850 if (fmt)
851 { 851 {
852 struct gcpro gcpro1; 852 struct gcpro gcpro1;
853 /* message_internal() might GC, e.g. if there are after-change-hooks 853 /* message_internal() might GC, e.g. if there are after-change-hooks
854 on the echo area buffer */ 854 on the echo area buffer */
855 Lisp_Object obj = emacs_doprnt_string_va ((CONST Bufbyte *) fmt, Qnil, 855 Lisp_Object obj = emacs_doprnt_string_va ((const Bufbyte *) fmt, Qnil,
856 -1, args); 856 -1, args);
857 GCPRO1 (obj); 857 GCPRO1 (obj);
858 message_append_internal (0, obj, 0, -1); 858 message_append_internal (0, obj, 0, -1);
859 UNGCPRO; 859 UNGCPRO;
860 } 860 }
868 /* This function can call lisp */ 868 /* This function can call lisp */
869 message_internal (0, Qnil, 0, 0); 869 message_internal (0, Qnil, 0, 0);
870 } 870 }
871 871
872 void 872 void
873 message (CONST char *fmt, ...) 873 message (const char *fmt, ...)
874 { 874 {
875 /* This function can call lisp */ 875 /* This function can call lisp */
876 /* I think it's OK to pass the data of Lisp strings as arguments to 876 /* I think it's OK to pass the data of Lisp strings as arguments to
877 this function. No GC'ing will occur until the data has already 877 this function. No GC'ing will occur until the data has already
878 been copied. */ 878 been copied. */
884 message_1 (fmt, args); 884 message_1 (fmt, args);
885 va_end (args); 885 va_end (args);
886 } 886 }
887 887
888 void 888 void
889 message_append (CONST char *fmt, ...) 889 message_append (const char *fmt, ...)
890 { 890 {
891 /* This function can call lisp */ 891 /* This function can call lisp */
892 va_list args; 892 va_list args;
893 893
894 va_start (args, fmt); 894 va_start (args, fmt);
897 message_append_1 (fmt, args); 897 message_append_1 (fmt, args);
898 va_end (args); 898 va_end (args);
899 } 899 }
900 900
901 void 901 void
902 message_no_translate (CONST char *fmt, ...) 902 message_no_translate (const char *fmt, ...)
903 { 903 {
904 /* This function can call lisp */ 904 /* This function can call lisp */
905 /* I think it's OK to pass the data of Lisp strings as arguments to 905 /* I think it's OK to pass the data of Lisp strings as arguments to
906 this function. No GC'ing will occur until the data has already 906 this function. No GC'ing will occur until the data has already
907 been copied. */ 907 been copied. */