>> && EQ (XBUFFER (XWINDOW (selected_window)->contents), current_buffer) > in that case, you don't need EQ, just use == to > compare 2 C pointers. Ok, I pushed that solution as d31cd49 and I mark the bug as done. Thanks for your guidance. -- Nico.