Check whether 'yank-transform-functions' is bound

* eat.el (eat-yank, eat-yank-from-kill-ring): Check whether
'yank-transform-functions' is bound before using it's value.
The variable is not available in Emacs 28.
This commit is contained in:
Akib Azmain Turja 2022-12-11 18:40:27 +06:00
parent 731ead9bfb
commit fffca2c06e
No known key found for this signature in database
GPG key ID: 5535FCF54D88616B

6
eat.el
View file

@ -4581,7 +4581,8 @@ ARG is passed to `yank', which see."
(when eat--terminal
(funcall eat--synchronize-scroll-function)
(eat-send-string-as-yank
eat--terminal (let ((yank-hook yank-transform-functions))
eat--terminal
(let ((yank-hook (bound-and-true-p yank-transform-functions)))
(with-temp-buffer
(setq-local yank-transform-functions yank-hook)
(yank arg)
@ -4596,7 +4597,8 @@ STRING and ARG are passed to `yank-pop', which see."
(when eat--terminal
(funcall eat--synchronize-scroll-function)
(eat-send-string-as-yank
eat--terminal (let ((yank-hook yank-transform-functions))
eat--terminal
(let ((yank-hook (bound-and-true-p yank-transform-functions)))
(with-temp-buffer
(setq-local yank-transform-functions yank-hook)
(yank-from-kill-ring string arg)