Subject: [PATCH] Update shortdoc hash-table and sequence

From: Gabriel do Nascimento Ribeiro <[email-masked]>
Date: Sat, 30 Aug 2025 19:26:09 +0000

The patch below adds more functions to shortdoc and info:

- info hash-table:
  - hash-table-keys
  - hash-table-values
  - hash-table-empty-p

- shortdoc hash-table:
  - hash-table-empty-p
  - hash-table-keys
  - hash-table-values
  - hash-table-test
  - hash-table-weakness

- shortdoc sequence
  - seq-let

It also makes the info buffer display in the same window when pushing shortdoc
buttons, which I think is a better behavior than the one that currently displays
the info buffer in another widow and does not make it selected.

>From 803583c20cfa726488ce40e7365eca4311a1d4ef Mon Sep 17 00:00:00 2001
From: Gabriel Ribeiro <[email-masked]>
Date: Sat, 30 Aug 2025 16:13:33 -0300
Subject: [PATCH] Add more functions to shortdoc hash-table and sequence

* doc/lispref/hash.texi: Add 'hash-table-keys', 'hash-table-values'
  and 'hash-table-empty-p'.
* lisp/emacs-lisp/shortdoc.el
  (define-short-documentation-group hash-table): Add
  'hash-table-empty-p', 'hash-table-keys', 'hash-table-values',
  'hash-table-test', 'hash-table-weakness'.
  (define-short-documentation-group sequence): Add 'seq-let'.
  (hash-table-weakness): Display info buffer in same window.
---
 doc/lispref/hash.texi       | 12 ++++++++++++
 lisp/emacs-lisp/shortdoc.el | 21 +++++++++++++++++++--
 2 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/doc/lispref/hash.texi b/doc/lispref/hash.texi
index 56862a9d934..1660c209435 100644
--- a/doc/lispref/hash.texi
+++ b/doc/lispref/hash.texi
@@ -343,6 +343,18 @@ Other Hash
 itself is copied---the keys and values are shared.
 @end defun
 
+@defun hash-table-keys table
+This function returns the list of keys in @var{table}.
+@end defun
+
+@defun hash-table-values table
+This function returns the list of values in @var{table}.
+@end defun
+
+@defun hash-table-empty-p table
+This function non-@code{nil} if @var{table} contains any entries..
+@end defun
+
 @defun hash-table-count table
 This function returns the actual number of entries in @var{table}.
 @end defun
diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el
index 754b2016d9e..697e2a51642 100644
--- a/lisp/emacs-lisp/shortdoc.el
+++ b/lisp/emacs-lisp/shortdoc.el
@@ -717,7 +717,22 @@ hash-table
    :result-string "#s(hash-table ...)")
   (hash-table-count
    :no-eval (hash-table-count table)
-   :eg-result 15))
+   :eg-result 15)
+  (hash-table-empty-p
+   :no-eval (hash-table-empty-p table)
+   :eg-result t)
+  (hash-table-keys
+   :no-eval (hash-table-keys table)
+   :eg-result-string "(key1 key2 ...)")
+  (hash-table-values
+   :no-eval (hash-table-values table)
+   :eg-result-string "(value1 value2 ...)")
+  (hash-table-test
+   :no-eval (hash-table-test table)
+   :eg-result eql)
+  (hash-table-weakness
+   :no-eval (hash-table-weakness table)
+   :eg-result key-and-value))
 
 (define-short-documentation-group list
   "Making Lists"
@@ -1124,6 +1139,8 @@ sequence
    :eval (seq-sort #'> '(1 2 3)))
   (seq-sort-by
    :eval (seq-sort-by (lambda (a) (/ 1.0 a)) #'< '(1 2 3)))
+  (seq-let
+    :eval (seq-let (a b c) '(1 2 3) (+ a b c)))
   "Mapping Over Sequences"
   (seq-map
    :eval (seq-map #'1+ '(1 2 3)))
@@ -1689,7 +1706,7 @@ shortdoc--display-function
        (symbol-name function)
        'face 'button
        'action (lambda (_)
-                 (info-lookup-symbol function 'emacs-lisp-mode))
+                 (info-lookup-symbol function 'emacs-lisp-mode t))
        'follow-link t
        'help-echo "mouse-1, RET: show \
 function's documentation in the Info manual"))
-- 
2.34.1

---
Gabriel