Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
211f7dcd
Commit
211f7dcd
authored
Aug 29, 1997
by
Richard M. Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Fload): If FILE arg ends in .el or .elc, don't insist on adding a suffix.
parent
5c5631cf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
src/lread.c
src/lread.c
+21
-2
No files found.
src/lread.c
View file @
211f7dcd
...
...
@@ -395,8 +395,9 @@ Print messages at start and end of loading unless\n\
optional third arg NOMESSAGE is non-nil.
\n
\
If optional fourth arg NOSUFFIX is non-nil, don't try adding
\n
\
suffixes `.elc' or `.el' to the specified name FILE.
\n
\
If optional fifth arg MUST-SUFFIX is non-nil, insist on adding
\n
\
the suffixe `.elc' or `.el'; don't accept just FILE.
\n
\
If optional fifth arg MUST-SUFFIX is non-nil, insist on
\n
\
the suffix `.elc' or `.el'; don't accept just FILE unless
it ends in one of those suffixes or includes a directory name.
\n
\
Return t if file exists."
)
(
file
,
noerror
,
nomessage
,
nosuffix
,
must_suffix
)
Lisp_Object
file
,
noerror
,
nomessage
,
nosuffix
,
must_suffix
;
...
...
@@ -433,7 +434,25 @@ Return t if file exists.")
since it would try to load a directory as a Lisp file */
if
(
XSTRING
(
file
)
->
size
>
0
)
{
int
size
=
XSTRING
(
file
)
->
size
;
GCPRO1
(
file
);
if
(
!
NILP
(
must_suffix
))
{
/* Don't insist on adding a suffix if FILE already ends with one. */
if
(
size
>
3
&&
!
strcmp
(
XSTRING
(
file
)
->
data
+
size
-
3
,
".el"
))
must_suffix
=
Qnil
;
else
if
(
size
>
4
&&
!
strcmp
(
XSTRING
(
file
)
->
data
+
size
-
4
,
".elc"
))
must_suffix
=
Qnil
;
/* Don't insist on adding a suffix
if the argument includes a directory name. */
else
if
(
!
NILP
(
Ffile_name_directory
(
file
)))
must_suffix
=
Qnil
;
}
fd
=
openp
(
Vload_path
,
file
,
(
!
NILP
(
nosuffix
)
?
""
:
!
NILP
(
must_suffix
)
?
".elc:.el"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment