In Elisp, I'm trying to test whether a string is a prefix of another.
Poking around the documentation, I stumbled upon `compare-strings',
which seems to do the job fairly well. The interface is a bit weird
(at least as seen from Lisp) It feels more like C's strcmp.
It returns t on exact match, and some numbers on mismatch. I understand
that the result might be useful in some cases (it tells one by how many
chars we miss a match), but then I can't just do
(when (compare-strings foo 0 5 bar 0 5)
...)
but must do
(when (eq (compare-strings foo 0 5 bar 0 5) t)
...)
which looks rather funny. My question: are there better idioms? Am I
barking up the wrong function?