there is a useful library called [list-abs], which has lots of those sort of things, but in this case, i couldn't find exactly what you're after.  Here's a patch that does what you want though: