Commit c48bb7de authored by Mattias Engdegård's avatar Mattias Engdegård

Preserve match data in 'kbd'

* lisp/subr.el (kbd): Preserve match data since this function is
declared pure (see discussion in bug#42147).
parent 3b0cb1c4
Pipeline #6166 failed with stage
in 22 seconds
......@@ -893,8 +893,9 @@ This is the same format used for saving keyboard macros (see
For an approximate inverse of this, see `key-description'."
;; Don't use a defalias, since the `pure' property is true only for
;; the calling convention of `kbd'.
(read-kbd-macro keys))
(put 'kbd 'pure t)
(declare (pure t))
;; A pure function is expected to preserve the match data.
(save-match-data (read-kbd-macro keys)))
(defun undefined ()
"Beep to tell the user this binding is undefined."
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment