Apply patch provided by Peter Mao
fix single-quote handling with electric-pair mode
fix electric-pair handling of single-quote