Subject: Re: bug#25209: 25.1; can't delete *Shell Command Output*

From: Eli Zaretskii <[email-masked]>
Date: Fri, 16 Dec 2016 10:39:58 +0200

> Date: Thu, 15 Dec 2016 17:34:23 +0100
> From: Francesco Potortì <[email-masked]>
> 
> On a long-running multi-tty Emacs, at one point the *Shell Command
> Output* buffer refuses to go away.
> 
> If I try to kill it, nothing happens, whether the current buffer is that
> one or any other one.  The contents of the *Shell Command Output* buffer
> are always visible in the minibuffer.  So, to make it unobtrusive, I
> need to issue an
>  M-! echo -n RET
> every time the *Shell Command Output* buffer is dirtied.
> 
> I am still running that Emacs, so I can try to debug something.  If you
> suggest me where to look, I can do that when I have time (probably not
> it nthe next few days).

Some questions come to mind, hopefully one of them will help you:

Are you in recursive edit level, perhaps?

When the cursor is shown in that buffer in the echo area, does typing
C-g or "C-x o" get you out of that, and can you then kill that buffer?
Or maybe try "C-x b" to switch to a minibuffer in that situation.

Do you have some non-nil kill-buffer-hook, and if so, what does that
do?  What about kill-buffer-query-functions -- any non-nil value for
that?

What happens if you set debug-on-error non-nil, and then try to kill
that buffer?  What errors, if any, pop up, and what do they show?

When you attempt to kill the buffer, do you see any messages added to
*Messages*?

The most promising lead, IMO, is the one about this buffer being shown
in the echo area: kill-buffer won't kill the current minibuffer
buffer, so I think you should try to break that link.  Thus the first
2 questions above are the most probable cause of your trouble.