bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#21581: 25.0.50; doc string of `load'


From: Drew Adams
Subject: bug#21581: 25.0.50; doc string of `load'
Date: Mon, 28 Sep 2015 23:05:43 -0700 (PDT)

> > Say that FILE is a string.
> 
> Do you really mean we need to say explicitly that a file's name is a
> string in Emacs?

That's my suggestion - do as you like.  No, I'm not saying
that we NEED to.  I'm suggesting that it could help.

> From the ELisp manual:
>   Files are generally referred to by their names, in Emacs as elsewhere.
>   File names in Emacs are represented as strings.  The functions that
>   operate on a file all expect a file name argument.

That's fine.  But a user looking at the doc string doesn't see that.
If you want to add a link to that manual node to the doc string,
great.

The very fact that that last sentence was explicitly added to
the manual suggests that it is not obvious that file arguments
are strings.  If it were obvious then even that whole section
about file names could perhaps be removed.  (And again, that
information is absent from the doc string.)

> I think this is so basic that we can always say "a file's name" and
> assume the reader must know it can only be a string.

Yes, maybe.  But I think it's also basic to specify the types
of parameters in doc strings.  (It could also help a bit to
call the parameter FILENAME intead of FILE.)

The doc strings of some functions (but yes, only a minority)
already explicitly mention that the arg is a string:

add-name-to-file
autoload
copy-file
do-after-load-evaluation
eval-after-load
find-buffer-visiting
get-file-buffer
load-history-regexp
make-symbolic-link
rename-file

(Consider also that some other, somewhat similar functions that load
Lisp code allow a symbol parameter - `require', for instance.
Granted, a feature is not a file.  Still, I think it could help
to make clear that FILE here is a string.)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]