> Here the first evaluation gets me 1 and the second 0. I suppose > it's the latter you want. Martin, thanks for your feedback. My use of the variable POSITON was a mistake on my part, the correct thing to do was calling (point), as the point had already been set to POSITION (by goto-char), and then moved by forward-line. While fixing the mistake, I found the function line-number-at-pos, which uses the same method I was using (after your correction) to calculate the line number. I'm attaching a new patch which uses this function instead. Slightly related question: is it better for me to keep sending patches with all my changes and fixes included, or is it better to send an initial one, and then send additional (smaller) patches with fixes to the first one?