[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 4e2058aec3: Merge from origin/emacs-28
From: |
Stefan Kangas |
Subject: |
master 4e2058aec3: Merge from origin/emacs-28 |
Date: |
Sun, 26 Dec 2021 00:54:08 -0500 (EST) |
branch: master
commit 4e2058aec33db5097edd17da8fe08bea373fd8bc
Merge: bb666073d3 89a82182cb
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
Merge from origin/emacs-28
89a82182cb Improve documentation of read-multiple-choice
5fccd1e371 Explain why we remove stuff from 'user-full-name'
---
doc/lispref/commands.texi | 7 ++++++-
src/editfns.c | 9 +++++++--
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi
index 0a324a642f..9a396f57ef 100644
--- a/doc/lispref/commands.texi
+++ b/doc/lispref/commands.texi
@@ -3000,7 +3000,7 @@ causes it to evaluate @code{help-form} and display the
result. It
then continues to wait for a valid input character, or keyboard-quit.
@end defun
-@defun read-multiple-choice prompt choices
+@defun read-multiple-choice prompt choices &optional help-string
Ask user a multiple choice question. @var{prompt} should be a string
that will be displayed as the prompt.
@@ -3010,6 +3010,11 @@ entry to be displayed while prompting (if there's room,
it might be
shortened), and the third, optional entry is a longer explanation that
will be displayed in a help buffer if the user requests more help.
+If optional argument @var{help-string} is non-@code{nil}, it should be
+a string with a more detailed description of all choices. It will be
+displayed in a help buffer instead of the default auto-generated
+description when the user types @kbd{?}.
+
The return value is the matching value from @var{choices}.
@lisp
diff --git a/src/editfns.c b/src/editfns.c
index 5c9c34dc35..6ba09cceec 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1233,7 +1233,11 @@ return "unknown".
If optional argument UID is an integer, return the full name
of the user with that uid, or nil if there is no such user.
If UID is a string, return the full name of the user with that login
-name, or nil if there is no such user. */)
+name, or nil if there is no such user.
+
+If the full name includes commas, remove everything starting with
+the first comma, because the \\='gecos\\=' field of the \\='/etc/passwd\\='
file
+is in general a comma-separated list. */)
(Lisp_Object uid)
{
struct passwd *pw;
@@ -1263,7 +1267,8 @@ name, or nil if there is no such user. */)
return Qnil;
p = USER_FULL_NAME;
- /* Chop off everything after the first comma. */
+ /* Chop off everything after the first comma, since 'pw_gecos' is a
+ comma-separated list. */
q = strchr (p, ',');
full = make_string (p, q ? q - p : strlen (p));