Add saving of recent expressions. Fix #6091