I am reading this function and still don't see why it doesn't delete both the buffer and window. Currently it open a new window, and when I hit
C-g another buffer (even duplicated to the one I am editing) appears in that window, created unwanted layout. See attach screenshot.
What I want is to get the window behavior like
*Help buffer when one calls
M-x describe-key for example: It opens its own window, move focus there, and closes it when I hit