 (defun convert-chords (chords lyrics result)
   "This function converts a line of chords and a line of lyrics into a list of strings
 in reverse order.  We do it this way to take advantage of tail recursion."
-  (cond ((null chords)
-	 (if (null lyrics)
-	     result
-	   (convert-chords nil (cdr lyrics) (cons (car lyrics) result))))
+  (cond ((and (null chords) (null lyrics))
+	 result)			; we're done
+	((null chords)
+	 ;; nothing left in chords; this just pushes the remaining lyrics onto result
+	 (convert-chords nil (cdr lyrics) (cons (car lyrics) result)))
 	((equal " " (car chords))
 	 (if (null lyrics)
 	     (convert-chords (cdr chords) nil (cons " " result))

  "Convert a chord at the front of lyrics, and follow it with the remaining lyrics.
The lyrics under the chord are accumulated in a string."
  (cond ((or (null chords) (equal " " (car chords)))
	 (convert-chords chords lyrics (cons (concat "]" lyrics-under-chord) result)))
	((null lyrics)
	 (convert-chord (cdr chords) nil

;;;

(provide 'flktex-utils)

(defun inline-chords-at-point ()
    "Convert the two lines at point from chords-over-lyrics to chords-inline.
