comparison src/lread.c @ 371:cc15677e0335 r21-2b1

Import from CVS: tag r21-2b1
author cvs
date Mon, 13 Aug 2007 11:03:08 +0200
parents 8e84bee8ddd0
children 6240c7796c7a
comparison
equal deleted inserted replaced
370:bd866891f083 371:cc15677e0335
88 int load_warn_when_source_newer; 88 int load_warn_when_source_newer;
89 /* Whether Fload_internal() should check whether the .elc doesn't exist */ 89 /* Whether Fload_internal() should check whether the .elc doesn't exist */
90 int load_warn_when_source_only; 90 int load_warn_when_source_only;
91 /* Whether Fload_internal() should ignore .elc files when no suffix is given */ 91 /* Whether Fload_internal() should ignore .elc files when no suffix is given */
92 int load_ignore_elc_files; 92 int load_ignore_elc_files;
93
94 /* Directory in which the sources were found. */
95 Lisp_Object Vsource_directory;
93 96
94 /* Search path for files to be loaded. */ 97 /* Search path for files to be loaded. */
95 Lisp_Object Vload_path; 98 Lisp_Object Vload_path;
96 99
97 /* Search path for files when dumping. */ 100 /* Search path for files when dumping. */
791 794
792 /*#ifdef DEBUG_XEMACS*/ 795 /*#ifdef DEBUG_XEMACS*/
793 if (purify_flag && noninteractive) 796 if (purify_flag && noninteractive)
794 { 797 {
795 if (EQ (last_file_loaded, file)) 798 if (EQ (last_file_loaded, file))
796 message_append (" (%ld)", 799 message_append (" (%d)", purespace_usage() - pure_usage);
797 (unsigned long) (purespace_usage() - pure_usage));
798 else 800 else
799 message ("Loading %s ...done (%ld)", XSTRING_DATA (file), 801 message ("Loading %s ...done (%d)", XSTRING_DATA (file),
800 (unsigned long) (purespace_usage() - pure_usage)); 802 purespace_usage() - pure_usage);
801 } 803 }
802 /*#endif / * DEBUG_XEMACS */ 804 /*#endif / * DEBUG_XEMACS */
803 805
804 if (!noninteractive) 806 if (!noninteractive)
805 PRINT_LOADING_MESSAGE ("done"); 807 PRINT_LOADING_MESSAGE ("done");
1543 /* Use this for recursive reads, in contexts where internal tokens 1545 /* Use this for recursive reads, in contexts where internal tokens
1544 are not allowed. See also read1(). */ 1546 are not allowed. See also read1(). */
1545 static Lisp_Object 1547 static Lisp_Object
1546 read0 (Lisp_Object readcharfun) 1548 read0 (Lisp_Object readcharfun)
1547 { 1549 {
1548 Lisp_Object val = read1 (readcharfun); 1550 Lisp_Object val;
1549 1551
1552 val = read1 (readcharfun);
1550 if (CONSP (val) && UNBOUNDP (XCAR (val))) 1553 if (CONSP (val) && UNBOUNDP (XCAR (val)))
1551 { 1554 {
1552 Emchar c = XCHAR (XCDR (val)); 1555 Emchar c = XCHAR (XCDR (val));
1553 free_cons (XCONS (val)); 1556 free_cons (XCONS (val));
1554 return Fsignal (Qinvalid_read_syntax, 1557 return Fsignal (Qinvalid_read_syntax,
1684 } 1687 }
1685 return i; 1688 return i;
1686 } 1689 }
1687 1690
1688 case 'x': 1691 case 'x':
1689 /* A hex escape, as in ANSI C, except that we only allow latin-1 1692 /* A hex escape, as in ANSI C. */
1690 characters to be read this way. What is "\x4e03" supposed to
1691 mean, anyways, if the internal representation is hidden?
1692 This is also consistent with the treatment of octal escapes. */
1693 { 1693 {
1694 REGISTER Emchar i = 0; 1694 REGISTER Emchar i = 0;
1695 REGISTER int count = 0; 1695 while (1)
1696 while (++count <= 2)
1697 { 1696 {
1698 c = readchar (readcharfun); 1697 c = readchar (readcharfun);
1699 /* Remember, can't use isdigit(), isalpha() etc. on Emchars */ 1698 /* Remember, can't use isdigit(), isalpha() etc. on Emchars */
1700 if (c >= '0' && c <= '9') i = (i << 4) + (c - '0'); 1699 if (c >= '0' && c <= '9') i = (i << 4) + (c - '0');
1701 else if (c >= 'a' && c <= 'f') i = (i << 4) + (c - 'a') + 10; 1700 else if (c >= 'a' && c <= 'f') i = (i << 4) + (c - 'a') + 10;
1939 static Lisp_Object 1938 static Lisp_Object
1940 read_bit_vector (Lisp_Object readcharfun) 1939 read_bit_vector (Lisp_Object readcharfun)
1941 { 1940 {
1942 unsigned_char_dynarr *dyn = Dynarr_new (unsigned_char); 1941 unsigned_char_dynarr *dyn = Dynarr_new (unsigned_char);
1943 Emchar c; 1942 Emchar c;
1944 Lisp_Object val;
1945 1943
1946 while (1) 1944 while (1)
1947 { 1945 {
1948 c = readchar (readcharfun); 1946 c = readchar (readcharfun);
1949 if (c != '0' && c != '1') 1947 if (c != '0' && c != '1')
1952 } 1950 }
1953 1951
1954 if (c >= 0) 1952 if (c >= 0)
1955 unreadchar (readcharfun, c); 1953 unreadchar (readcharfun, c);
1956 1954
1957 val = make_bit_vector_from_byte_vector (Dynarr_atp (dyn, 0), 1955 return make_bit_vector_from_byte_vector (Dynarr_atp (dyn, 0),
1958 Dynarr_length (dyn)); 1956 Dynarr_length (dyn));
1959
1960 Dynarr_free (dyn);
1961
1962 return val;
1963 } 1957 }
1964 1958
1965 1959
1966 1960
1967 /* structures */ 1961 /* structures */
3157 Non-nil means `load' should force-load all dynamic doc strings. 3151 Non-nil means `load' should force-load all dynamic doc strings.
3158 This is useful when the file being loaded is a temporary copy. 3152 This is useful when the file being loaded is a temporary copy.
3159 */ ); 3153 */ );
3160 load_force_doc_strings = 0; 3154 load_force_doc_strings = 0;
3161 3155
3156 DEFVAR_LISP ("source-directory", &Vsource_directory /*
3157 Directory in which XEmacs sources were found when XEmacs was built.
3158 You cannot count on them to still be there!
3159 */ );
3160 Vsource_directory = Qnil;
3161
3162 /* See read_escape(). */ 3162 /* See read_escape(). */
3163 #if 0 3163 #if 0
3164 /* Used to be named `puke-on-fsf-keys' */ 3164 /* Used to be named `puke-on-fsf-keys' */
3165 DEFVAR_BOOL ("fail-on-bucky-bit-character-escapes", 3165 DEFVAR_BOOL ("fail-on-bucky-bit-character-escapes",
3166 &fail_on_bucky_bit_character_escapes /* 3166 &fail_on_bucky_bit_character_escapes /*