>> But actually the customization for "1" doesn't affect popping to "2" >> because pop-to-buffer still selects windows and creates such layout: >> >> *scratch* >> Buffer "1" >> Buffer "2" >> >> Only post-command-hook selects the original window afterwards >> instead of leaving the buffer "2" selected. > > And if the customization for "2" meant to select the window, the final > outcome will depend on whichever (de-)selection comes last in the > 'post-command-hook'. You should at least document that in the manual. > It looks pretty fragile to me. A practical use of this feature is for commands that display a single buffer that is an overwhelming majority of the commands. However, the name 'select-window' would be too confusing for users because based on such name they will expect that it will select the window immediately after it's displayed. Therefore I propose to rename it to the less ambiguous name 'post-command-select-window'. Of course it should be documented in any case, but this will help the users who never read the documentation. Ok, here is a complete patch with the documentation: