fix(lib): void-function insert-into-buffer on Emacs 27

insert-into-buffer was introduced in 28.1
This commit is contained in:
Henrik Lissner 2022-09-12 14:06:43 +02:00
parent 6a83079d2e
commit dde728d847
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -261,7 +261,12 @@ If BEG and/or END are integers, only that region will be read from FILE."
(insert-file-contents-literally buffer-file-name nil beg end))
(pcase by
('insert
(insert-into-buffer old-buffer)
(if (fboundp 'insert-into-buffer)
(insert-into-buffer old-buffer)
;; DEPRECATED: Remove fallback when 27.x support is dropped.
(let ((input (buffer-substring-no-properties (point-min) (point-max))))
(with-current-buffer old-buffer
(insert input))))
t)
('buffer-string
(buffer-substring-no-properties (point-min) (point-max)))