1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-05 11:21:04 -08:00

Improve shortdoc documentation

* doc/emacs/help.texi (Name Help):
* doc/lispref/help.texi (Documentation Groups): Refer to
'shortdoc' convenience alias instead of 'shortdoc-display-group'.
* lisp/emacs-lisp/shortdoc.el: Add Commentary.
(shortdoc-next, shortdoc-previous)
(shortdoc-next-section, shortdoc-previous-section): Doc fixes.
This commit is contained in:
Stefan Kangas 2022-09-25 14:26:40 +02:00
parent a256f49f08
commit 489bca19b7
3 changed files with 22 additions and 14 deletions

View file

@ -311,12 +311,11 @@ doc string to display. In that case, if
to load the file in which the function is defined to see whether to load the file in which the function is defined to see whether
there's a doc string there. there's a doc string there.
@findex shortdoc-display-group @findex shortdoc
You can get an overview of functions relevant for a particular topic You can get an overview of functions relevant for a particular topic
by using the @kbd{M-x shortdoc-display-group} command. This will by using the @kbd{M-x shortdoc} command. This will prompt you for an
prompt you for an area of interest, e.g., @code{string}, and pop you area of interest, e.g., @code{string}, and pop you to a buffer where
to a buffer where many of the functions relevant for handling strings many of the functions relevant for handling strings are listed.
are listed.
@kindex C-h v @kindex C-h v
@findex describe-variable @findex describe-variable

View file

@ -827,7 +827,7 @@ if the user types the help character again.
Emacs can list functions based on various groupings. For instance, Emacs can list functions based on various groupings. For instance,
@code{string-trim} and @code{mapconcat} are ``string'' functions, so @code{string-trim} and @code{mapconcat} are ``string'' functions, so
@kbd{M-x shortdoc-display-group RET string RET} will give an overview @kbd{M-x shortdoc RET string RET} will give an overview
of functions that operate on strings. of functions that operate on strings.
The documentation groups are created with the The documentation groups are created with the

View file

@ -22,6 +22,15 @@
;;; Commentary: ;;; Commentary:
;; This package lists functions based on various groupings.
;;
;; For instance, `string-trim' and `mapconcat' are `string' functions,
;; so `M-x shortdoc RET string RET' will give an overview of functions
;; that operate on strings.
;;
;; The documentation groups are created with the
;; `define-short-documentation-group' macro.
;;; Code: ;;; Code:
(require 'seq) (require 'seq)
@ -1533,27 +1542,27 @@ Example:
(setq arg (1- arg)))) (setq arg (1- arg))))
(defun shortdoc-next (&optional arg) (defun shortdoc-next (&optional arg)
"Move cursor to the next function. "Move point to the next function.
With ARG, do it that many times." With prefix argument ARG, do it that many times."
(interactive "p" shortdoc-mode) (interactive "p" shortdoc-mode)
(shortdoc--goto-section arg 'shortdoc-function)) (shortdoc--goto-section arg 'shortdoc-function))
(defun shortdoc-previous (&optional arg) (defun shortdoc-previous (&optional arg)
"Move cursor to the previous function. "Move point to the previous function.
With ARG, do it that many times." With prefix argument ARG, do it that many times."
(interactive "p" shortdoc-mode) (interactive "p" shortdoc-mode)
(shortdoc--goto-section arg 'shortdoc-function t) (shortdoc--goto-section arg 'shortdoc-function t)
(backward-char 1)) (backward-char 1))
(defun shortdoc-next-section (&optional arg) (defun shortdoc-next-section (&optional arg)
"Move cursor to the next section. "Move point to the next section.
With ARG, do it that many times." With prefix argument ARG, do it that many times."
(interactive "p" shortdoc-mode) (interactive "p" shortdoc-mode)
(shortdoc--goto-section arg 'shortdoc-section)) (shortdoc--goto-section arg 'shortdoc-section))
(defun shortdoc-previous-section (&optional arg) (defun shortdoc-previous-section (&optional arg)
"Move cursor to the previous section. "Move point to the previous section.
With ARG, do it that many times." With prefix argument ARG, do it that many times."
(interactive "p" shortdoc-mode) (interactive "p" shortdoc-mode)
(shortdoc--goto-section arg 'shortdoc-section t) (shortdoc--goto-section arg 'shortdoc-section t)
(forward-line -2)) (forward-line -2))