Use insert-buffer-substring instead of insert-buffer in denote--file-with-temp-buffer

The function insert-buffer is meant to be for interactive use only.

This follows the change made by duli in commit 0f71f12 via pull
request 672: <https://github.com/protesilaos/denote/pull/672>. The
author of the original change has assigned copyright to the Free
Software Foundation.

Also thanks to Jean-Philippe Gagné Guay for reviewing the change and
for reporting a problem with an earlier version of the code in issue
670: <https://github.com/protesilaos/denote/issues/670>.
This commit is contained in:
Protesilaos Stavrou 2026-01-18 09:07:49 +02:00
parent 927c862685
commit e9c44eec58
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA

View file

@ -2634,7 +2634,7 @@ BODY."
(file-exist (file-exists-p ,file)))
(with-temp-buffer
(cond
(buffer (insert-buffer buffer))
(buffer (insert-buffer-substring buffer))
(file-exist (insert-file-contents ,file))
(t (error "Cannot find anything about file `%s'" ,file)))
(goto-char (point-min))