Improve recently added documentation

* doc/lispref/lists.texi (Building Lists):
* lisp/subr.el (ensure-list): Avoid passive tense in documenting
'ensure-list'.
This commit is contained in:
Eli Zaretskii 2021-09-21 21:51:38 +03:00
parent be4f858498
commit fd77065fc6
2 changed files with 6 additions and 6 deletions

View file

@ -680,9 +680,9 @@ list are in the same order as in @var{tree}.
@end example
@defun ensure-list object
Ensure that we have a list. If @var{object} is already a list, it is
returned. If @var{object} isn't a list, a one-element list containing
@var{object} is returned.
This function returns @var{object} as a list. If @var{object} is
already a list, the function returns it; otherwise, the function
returns a one-element list containing @var{object}.
This is usually useful if you have a variable that may or may not be a
list, and you can then say, for instance:

View file

@ -6427,9 +6427,9 @@ This is intended for internal use only."
(json-unavailable nil))))
(defun ensure-list (object)
"Ensure that we have a list.
If OBJECT is already a list, OBJECT is returned. If it's
not a list, a one-element list containing OBJECT is returned."
"Return OBJECT as a list.
If OBJECT is already a list, return OBJECT itself. If it's
not a list, return a one-element list containing OBJECT."
(if (listp object)
object
(list object)))