unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 21581@debbugs.gnu.org
Subject: bug#21581: 25.0.50; doc string of `load'
Date: Mon, 28 Sep 2015 23:05:43 -0700 (PDT)	[thread overview]
Message-ID: <30d2221f-2d72-4985-91c9-4b1ff9447a45@default> (raw)
In-Reply-To: <83oagldck2.fsf@gnu.org>

> > 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	other threads:[~2015-09-29  6:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-28 17:22 bug#21581: 25.0.50; doc string of `load' Drew Adams
2015-09-29  5:22 ` Eli Zaretskii
2015-09-29  6:05   ` Drew Adams [this message]
2016-04-30 22:19   ` Lars Ingebrigtsen

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=30d2221f-2d72-4985-91c9-4b1ff9447a45@default \
    --to=drew.adams@oracle.com \
    --cc=21581@debbugs.gnu.org \
    --cc=eliz@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).