Subject: 30.1; Possible documentation bug for isearch-allow-motion (substitute-command-keys)

From: martin <[email-masked]>
Date: Sun, 20 Jul 2025 11:07:03 -0700

When using `describe-variable` to read about `isearch-allow-motion`, the
following paragraph is displayed in the *Help* buffer:

> Whether to allow movement between isearch matches by cursor motion commands.
> If non-nil, the four motion commands <, >, SPC and DEL, when invoked during
> Isearch, move respectively to the first occurrence of the current search string
> in the buffer, the last one, the first one after the current window, and the
> last one before the current window.
> If nil, these motion commands normally exit Isearch and are executed.

This leads to confusion, because in most buffers those keys, "<, >, SPC
and DEL", don't have the described effect "when invoked during Isearch".

A check of the source shows that the listed keys are generated by
`substitute-command-keys`, and the intended commands are respectively
`beginning-of-buffer`, `end-of-buffer`, `scroll-up-command` and
`scroll-down-command`.

It appears that `substitute-command-keys` inserts those keys because
they're bound to those commands in the *Help* buffer's `help-mode-map`.

I think it would be best in this case to refer to the commands by name,
unless there's some way to exclude `help-mode-map` from the keys
`substitute-command-keys` selects from.

Martin