all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#21581: 25.0.50; doc string of `load'
@ 2015-09-28 17:22 Drew Adams
  2015-09-29  5:22 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Drew Adams @ 2015-09-28 17:22 UTC (permalink / raw)
  To: 21581

Say that FILE is a string.

In GNU Emacs 25.0.50.1 (i686-pc-mingw32)
 of 2015-09-23
Bzr revision: 325200ac1dcf5bed6918ea827d8a48d89487e083
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --host=i686-pc-mingw32 --enable-checking=yes,glyphs'





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

* bug#21581: 25.0.50; doc string of `load'
  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
  2016-04-30 22:19   ` Lars Ingebrigtsen
  0 siblings, 2 replies; 4+ messages in thread
From: Eli Zaretskii @ 2015-09-29  5:22 UTC (permalink / raw)
  To: Drew Adams; +Cc: 21581

> Date: Mon, 28 Sep 2015 10:22:51 -0700 (PDT)
> From: Drew Adams <drew.adams@oracle.com>
> 
> Say that FILE is a string.

  load is a built-in function in ‘C source code’.

  (load FILE &optional NOERROR NOMESSAGE NOSUFFIX MUST-SUFFIX)

  Execute a file of Lisp code named FILE.

Do you really mean we need to say explicitly that a file's name is a
string in Emacs?  What else can it be?  From the ELisp manual:

  24.8 File Names
  ===============

  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.

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.





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

* bug#21581: 25.0.50; doc string of `load'
  2015-09-29  5:22 ` Eli Zaretskii
@ 2015-09-29  6:05   ` Drew Adams
  2016-04-30 22:19   ` Lars Ingebrigtsen
  1 sibling, 0 replies; 4+ messages in thread
From: Drew Adams @ 2015-09-29  6:05 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 21581

> > 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.)






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

* bug#21581: 25.0.50; doc string of `load'
  2015-09-29  5:22 ` Eli Zaretskii
  2015-09-29  6:05   ` Drew Adams
@ 2016-04-30 22:19   ` Lars Ingebrigtsen
  1 sibling, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2016-04-30 22:19 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 21581

Eli Zaretskii <eliz@gnu.org> writes:

> 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.

I agree.  Closing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2016-04-30 22:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2016-04-30 22:19   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.