]> git.eshelyaron.com Git - emacs.git/commit
Don't error out on invalid literal key substitutions
authorStefan Kangas <stefan@marxist.se>
Sat, 25 Jun 2022 10:25:58 +0000 (12:25 +0200)
committerStefan Kangas <stefan@marxist.se>
Sat, 25 Jun 2022 10:25:58 +0000 (12:25 +0200)
commit37315f9895406e7ba4c7dce3a5fe179fa658c04c
treea6cf04a77a0c9ac7b2f0dac660630e29b86eebab
parent2f346b0ab10a8777ff5629af30a224b4f0ea16a6
Don't error out on invalid literal key substitutions

It would be backwards-incompatible to error out on invalid literal key
substitutions.  Consider this docstring fragment, where "\\`" should
have been escaped but wasn't:

    "Example value: \"\\(?:\\`[#.]\\)\\|\\(?:[#~]\\'\\)\"."

If we error out, we can't display this docstring at all.  However, it
is clearly better to display something in such cases, even if
suboptimal, than refusing to display anything at all.

* lisp/help.el (substitute-command-keys): Don't error out on invalid
literal key substitutions: just ignore them instead.
* test/lisp/help-tests.el
(help-tests-substitute-command-keys/literal-key-sequence-errors):
Delete test.
(help-tests-substitute-command-keys/literal-key-sequence-ignore-invalid):
New test.
lisp/help.el
test/lisp/help-tests.el