[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#12592: 24.2; optional arguments NOSUFFIX MUSTSUFFIX to the load func
From: |
Achim Gratz |
Subject: |
bug#12592: 24.2; optional arguments NOSUFFIX MUSTSUFFIX to the load function |
Date: |
Sun, 07 Oct 2012 14:18:34 +0200 |
In GNU Emacs 24.2.1 (i686-suse-linux-gnu, GTK+ Version 3.4.4)
of 2012-09-30 on Rainer
Windowing system distributor `The X.Org Foundation', version 11.0.11203000
There appears to be a mismatch between documentation and implementation
of the optional arguments NOSUFFIX and MUSTSUFFIX to the load function.
The behaviour is as described when both NOSUFFIX and MUSTSUFFIX are nil,
or when NOSUFFIX is nil and MUSTSUFFIX is non-nil. However, with
NOSUFFIX non-nil, MUSTSUFFIX is not at all evaluated and no extensions
are tried, contrary to what the documentation says:
If this function fails to find a file, it may look for different
representations of that file before trying another file.
It does so by adding the non-empty suffixes in `load-file-rep-suffixes'
to the file name. Emacs uses this feature mainly to find compressed
versions of files when Auto Compression mode is enabled.
The exact suffixes that this function tries out, in the exact order,
are given by the value of the variable `load-file-rep-suffixes' if
NOSUFFIX is non-nil and by the return value of the function
`get-load-suffixes' if MUST-SUFFIX is non-nil. If both NOSUFFIX and
MUST-SUFFIX are nil, this function first tries out the latter suffixes
and then the former.
Both the documented and the implemented behaviour might be intended, but
they should be made consistent. If following the documentation, then it
seems that
fd = openp (Vload_path, file,
- (!NILP (nosuffix) ? Qnil
+ (!NILP (nosuffix) ? Vload_file_rep_suffixes
: !NILP (must_suffix) ? Fget_load_suffixes ()
: Fappend (2, (tmp[0] = Fget_load_suffixes (),
tmp[1] = Vload_file_rep_suffixes,
tmp))),
&found, Qnil);
should correct the implementation. However, the behaviour has been
implemented from the very beginning to not affix anything to the
filename when NOSUFFIX is non-nil, so maybe the documentation should be
corrected instead.
Regards,
Achim.
--
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+
SD adaptation for Waldorf microQ V2.22R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada
- bug#12592: 24.2; optional arguments NOSUFFIX MUSTSUFFIX to the load function,
Achim Gratz <=