Improve a 'smart-insert-comma' function.