unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Achim Gratz <Stromeko@nexgo.de>
To: 12592@debbugs.gnu.org
Subject: bug#12592: 24.2; optional arguments NOSUFFIX MUSTSUFFIX to the load function
Date: Sun, 07 Oct 2012 14:18:34 +0200	[thread overview]
Message-ID: <87sj9qbhlx.fsf@Rainer.invalid> (raw)

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





             reply	other threads:[~2012-10-07 12:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-07 12:18 Achim Gratz [this message]
2012-10-20 12:52 ` bug#12592: 24.2; optional arguments NOSUFFIX MUSTSUFFIX to the load function Chong Yidong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sj9qbhlx.fsf@Rainer.invalid \
    --to=stromeko@nexgo.de \
    --cc=12592@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).