unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#12592: 24.2; optional arguments NOSUFFIX MUSTSUFFIX to the load function
@ 2012-10-07 12:18 Achim Gratz
  2012-10-20 12:52 ` Chong Yidong
  0 siblings, 1 reply; 2+ messages in thread
From: Achim Gratz @ 2012-10-07 12:18 UTC (permalink / raw)
  To: 12592

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





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#12592: 24.2; optional arguments NOSUFFIX MUSTSUFFIX to the load function
  2012-10-07 12:18 bug#12592: 24.2; optional arguments NOSUFFIX MUSTSUFFIX to the load function Achim Gratz
@ 2012-10-20 12:52 ` Chong Yidong
  0 siblings, 0 replies; 2+ messages in thread
From: Chong Yidong @ 2012-10-20 12:52 UTC (permalink / raw)
  To: Achim Gratz; +Cc: 12592

Achim Gratz <Stromeko@nexgo.de> writes:

> There appears to be a mismatch between documentation and
> implementation of the optional arguments NOSUFFIX and MUSTSUFFIX to
> the load function.

The docstring was in error.  Fix committed to trunk, thanks.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-20 12:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-07 12:18 bug#12592: 24.2; optional arguments NOSUFFIX MUSTSUFFIX to the load function Achim Gratz
2012-10-20 12:52 ` Chong Yidong

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).