fix(lib): void-function insert-into-buffer on Emacs 27
insert-into-buffer was introduced in 28.1
This commit is contained in:
parent
6a83079d2e
commit
dde728d847
1 changed files with 6 additions and 1 deletions
|
@ -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))
|
(insert-file-contents-literally buffer-file-name nil beg end))
|
||||||
(pcase by
|
(pcase by
|
||||||
('insert
|
('insert
|
||||||
|
(if (fboundp 'insert-into-buffer)
|
||||||
(insert-into-buffer old-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)
|
t)
|
||||||
('buffer-string
|
('buffer-string
|
||||||
(buffer-substring-no-properties (point-min) (point-max)))
|
(buffer-substring-no-properties (point-min) (point-max)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue