I’m trying to insert in a buffer the length of a lisp list as follows:
(insert "The list has " (length my-list) " elements")
However this produces a strange not printable character instead of the number of elements, so the result is something like
The list has ^A elements
Do I have to convert the return value? The list is not empty.
You need the
formatfunction.Alternatively, in this case, you can convert the integer to a string:
Control-A is ASCII code 1. Apparently your list had one element when you tried.