earch for STRING in the history list, starting at POS, an absolute index into the list. If DIRECTION is negative, the search proceeds backward from POS, otherwise forward. Returns the absolute index of the history element where STRING was found, or -1 otherwise.