I would like to have a function that pastes a certain heading:
"#+TITLE:\n#+STARTUP: overview"
I tried using insert-buffer-substring
:
(insert-buffer-substring "#+TITLE:\n#+STARTUP: overview")
but it's not working.
As @NickD suggested in a comment, you can use function insert
.
(insert "#+TITLE:\n#+STARTUP: overview")
C-h f insert-buffer-substring
tells you that you need to pass it a buffer as argument. And the rest of what it tells you makes clear that it doesn't at all do what you're looking for.
C-h f insert
tells you:
insert
is a built-in function inC source code
.
(insert &rest ARGS)
Insert the arguments, either strings or characters, at point. ...
insert
.