diff options
| -rw-r--r-- | doc/lispref/commands.texi | 7 | ||||
| -rw-r--r-- | src/editfns.c | 9 |
2 files changed, 13 insertions, 3 deletions
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 0a324a642fe..9a396f57ef0 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 | |||
| 3000 | then continues to wait for a valid input character, or keyboard-quit. | 3000 | then continues to wait for a valid input character, or keyboard-quit. |
| 3001 | @end defun | 3001 | @end defun |
| 3002 | 3002 | ||
| 3003 | @defun read-multiple-choice prompt choices | 3003 | @defun read-multiple-choice prompt choices &optional help-string |
| 3004 | Ask user a multiple choice question. @var{prompt} should be a string | 3004 | Ask user a multiple choice question. @var{prompt} should be a string |
| 3005 | that will be displayed as the prompt. | 3005 | that will be displayed as the prompt. |
| 3006 | 3006 | ||
| @@ -3010,6 +3010,11 @@ entry to be displayed while prompting (if there's room, it might be | |||
| 3010 | shortened), and the third, optional entry is a longer explanation that | 3010 | shortened), and the third, optional entry is a longer explanation that |
| 3011 | will be displayed in a help buffer if the user requests more help. | 3011 | will be displayed in a help buffer if the user requests more help. |
| 3012 | 3012 | ||
| 3013 | If optional argument @var{help-string} is non-@code{nil}, it should be | ||
| 3014 | a string with a more detailed description of all choices. It will be | ||
| 3015 | displayed in a help buffer instead of the default auto-generated | ||
| 3016 | description when the user types @kbd{?}. | ||
| 3017 | |||
| 3013 | The return value is the matching value from @var{choices}. | 3018 | The return value is the matching value from @var{choices}. |
| 3014 | 3019 | ||
| 3015 | @lisp | 3020 | @lisp |
diff --git a/src/editfns.c b/src/editfns.c index 5c9c34dc352..6ba09cceec4 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -1233,7 +1233,11 @@ return "unknown". | |||
| 1233 | If optional argument UID is an integer, return the full name | 1233 | If optional argument UID is an integer, return the full name |
| 1234 | of the user with that uid, or nil if there is no such user. | 1234 | of the user with that uid, or nil if there is no such user. |
| 1235 | If UID is a string, return the full name of the user with that login | 1235 | If UID is a string, return the full name of the user with that login |
| 1236 | name, or nil if there is no such user. */) | 1236 | name, or nil if there is no such user. |
| 1237 | |||
| 1238 | If the full name includes commas, remove everything starting with | ||
| 1239 | the first comma, because the \\='gecos\\=' field of the \\='/etc/passwd\\=' file | ||
| 1240 | is in general a comma-separated list. */) | ||
| 1237 | (Lisp_Object uid) | 1241 | (Lisp_Object uid) |
| 1238 | { | 1242 | { |
| 1239 | struct passwd *pw; | 1243 | struct passwd *pw; |
| @@ -1263,7 +1267,8 @@ name, or nil if there is no such user. */) | |||
| 1263 | return Qnil; | 1267 | return Qnil; |
| 1264 | 1268 | ||
| 1265 | p = USER_FULL_NAME; | 1269 | p = USER_FULL_NAME; |
| 1266 | /* Chop off everything after the first comma. */ | 1270 | /* Chop off everything after the first comma, since 'pw_gecos' is a |
| 1271 | comma-separated list. */ | ||
| 1267 | q = strchr (p, ','); | 1272 | q = strchr (p, ','); |
| 1268 | full = make_string (p, q ? q - p : strlen (p)); | 1273 | full = make_string (p, q ? q - p : strlen (p)); |
| 1269 | 1274 | ||