One more minor simplification: W->region_showing may be only nil or t, so it may be reduced to a bitfield. Hard case: if (((!NILP (Vtransient_mark_mode) && !NILP (BVAR (XBUFFER (w->buffer), mark_active))) != !NILP (w->region_showing)) || (!NILP (w->region_showing) && !EQ (w->region_showing, Fmarker_position (BVAR (XBUFFER (w->buffer), mark))))) There are two possible cases: - both w->region_showing and Fmarker_position (BVAR (XBUFFER (w->buffer), mark)) are nil; - w->region_showing is t and Fmarker_position (BVAR (XBUFFER (w->buffer), mark)) is a number, so !EQ (...) is always non-zero. So if-statement may be simplified to: if (((!NILP (Vtransient_mark_mode) && !NILP (BVAR (XBUFFER (w->buffer), mark_active))) != w->region_showing) || w->region_showing) Dmitry