]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve 'gethash' docstring
authorStefan Kangas <stefankangas@gmail.com>
Thu, 9 Jan 2025 01:54:08 +0000 (02:54 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sat, 11 Jan 2025 11:17:28 +0000 (12:17 +0100)
* src/fns.c (Fgethash): Improve docstring.  Avoid exposing the C
identifier 'dflt' to Lisp by providing a "usage:" string.

(cherry picked from commit 40fbed939a254566f3bce50c6f16c21e5d2441ad)

src/fns.c

index ec0d7579aea85da75a98fdaefe66636ed9ca73ff..12c7fc017cd347cf8e157f0ad920183fca3c7331 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -5928,7 +5928,10 @@ DEFUN ("clrhash", Fclrhash, Sclrhash, 1, 1, 0,
 
 DEFUN ("gethash", Fgethash, Sgethash, 2, 3, 0,
        doc: /* Look up KEY in TABLE and return its associated value.
-If KEY is not found, return DFLT which defaults to nil.  */)
+If KEY is not found in table, return DEFAULT, or nil if DEFAULT is not
+provided.
+
+usage: (gethash KEY TABLE &optional DEFAULT)  */)
   (Lisp_Object key, Lisp_Object table, Lisp_Object dflt)
 {
   struct Lisp_Hash_Table *h = check_hash_table (table);