X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/518c40a27ce7c4774c9e488639fb605a38d4f599..8478885dfab16359b989e030949b4d485062f54b:/src/lread.c diff --git a/src/lread.c b/src/lread.c index 2042d16592..62f12919e0 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1,6 +1,7 @@ /* Lisp parsing and input streams. -Copyright (C) 1985-1989, 1993-1995, 1997-2013 Free Software Foundation, Inc. +Copyright (C) 1985-1989, 1993-1995, 1997-2015 Free Software Foundation, +Inc. This file is part of GNU Emacs. @@ -1029,6 +1030,10 @@ in `load-file-rep-suffixes'. If MUST-SUFFIX is non-nil, only the return value of `get-load-suffixes' is used, i.e. the file name is required to have a non-empty suffix. +When searching suffixes, this function normally stops at the first +one that exists. If the option `load-prefer-newer' is non-nil, +however, it tries all suffixes, and uses whichever file is the newest. + Loading a file records its definitions, and its `provide' and `require' calls, in an element of `load-history' whose car is the file name loaded. See `load-history'. @@ -1467,9 +1472,12 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, Lisp_Object string, tail, encoded_fn, save_string; ptrdiff_t max_suffix_len = 0; int last_errno = ENOENT; - struct timespec save_mtime = make_timespec (TYPE_MINIMUM (time_t), -1); int save_fd = -1; + /* The last-modified time of the newest matching file found. + Initialize it to something less than all valid timestamps. */ + struct timespec save_mtime = make_timespec (TYPE_MINIMUM (time_t), -1); + CHECK_STRING (str); for (tail = suffixes; CONSP (tail); tail = XCDR (tail)) @@ -2045,7 +2053,7 @@ STREAM or the value of `standard-input' may be: if (EQ (stream, Qt)) stream = Qread_char; if (EQ (stream, Qread_char)) - /* FIXME: ¿¡ When is this used !? */ + /* FIXME: ?! When is this used !? */ return call1 (intern ("read-minibuffer"), build_string ("Lisp expression: ")); @@ -2646,9 +2654,10 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) /* Accept compiled functions at read-time so that we don't have to build them using function calls. */ Lisp_Object tmp; + struct Lisp_Vector *vec; tmp = read_vector (readcharfun, 1); - struct Lisp_Vector* vec = XVECTOR (tmp); - if (vec->header.size==0) + vec = XVECTOR (tmp); + if (vec->header.size == 0) invalid_syntax ("Empty byte-code object"); make_byte_code (vec); return tmp; @@ -3859,7 +3868,8 @@ DEFUN ("unintern", Funintern, Sunintern, 1, 2, 0, The value is t if a symbol was found and deleted, nil otherwise. NAME may be a string or a symbol. If it is a symbol, that symbol is deleted, if it belongs to OBARRAY--no other symbol is deleted. -OBARRAY defaults to the value of the variable `obarray'. */) +OBARRAY, if nil, defaults to the value of the variable `obarray'. +usage: (unintern NAME OBARRAY) */) (Lisp_Object name, Lisp_Object obarray) { register Lisp_Object string, tem; @@ -3929,7 +3939,8 @@ OBARRAY defaults to the value of the variable `obarray'. */) /* Return the symbol in OBARRAY whose names matches the string of SIZE characters (SIZE_BYTE bytes) at PTR. - If there is no such symbol in OBARRAY, return nil. + If there is no such symbol, return the integer bucket number of + where the symbol would be if it were present. Also store the bucket number in oblookup_last_bucket_number. */ @@ -4336,7 +4347,7 @@ init_lread (void) #ifdef CANNOT_DUMP bool use_loadpath = true; #else - bool use_loadpath = !NILP (Vpurify_flag); + bool use_loadpath = NILP (Vpurify_flag); #endif if (use_loadpath && egetenv ("EMACSLOADPATH")) @@ -4379,7 +4390,7 @@ init_lread (void) } } /* Fmemq (Qnil, Vload_path) */ } - else /* Vpurify_flag || !EMACSLOADPATH */ + else { Vload_path = load_path_default (); @@ -4396,7 +4407,7 @@ init_lread (void) sitelisp = decode_env_path (0, PATH_SITELOADSEARCH, 0); if (! NILP (sitelisp)) Vload_path = nconc2 (sitelisp, Vload_path); } - } /* !Vpurify_flag && EMACSLOADPATH */ + } Vvalues = Qnil; @@ -4676,8 +4687,9 @@ variables, this must be set in the first line of a file. */); This applies when a filename suffix is not explicitly specified and `load' is trying various possible suffixes (see `load-suffixes' and `load-file-rep-suffixes'). Normally, it stops at the first file -that exists. If this option is non-nil, it checks all suffixes and -uses whichever file is newest. +that exists unless you explicitly specify one or the other. If this +option is non-nil, it checks all suffixes and uses whichever file is +newest. Note that if you customize this, obviously it will not affect files that are loaded before your customizations are read! */); load_prefer_newer = 0;