Subject: Re: bug#25522: 26.0.50; (hl-line-maybe-unhighlight): (error "Selecting deleted buffer")

From: Michael Heerdegen <[email-masked]>
Date: Fri, 27 Jan 2017 10:29:07 +0100

Stephen Berman <[email-masked]> writes:

> I think I found out what triggers the error: when you kill a buffer in
> whose mode hl-line-mode is enabled and the mode of the next (now
> current) buffer does not have hl-line-mode enabled, and then you change
> (or Emacs changes) to another buffer in whose mode hl-line-mode is
> enabled -- that raises the error.  Can you confirm this?

Could be.  In my posted recipes, when I turn off hl-line-mode in the
buffer I end up in, there is indeed no error.  An experiment with three
buffers as you described and switching manually to the third also
confirms your assumption.

> Just out of curiosity, because I think the above fix is good enough
> and it's simple, so unless someone sees a problem with it, I'll commit
> it to master.

Yes, it's obvious that it isn't harmful.

Thanks,

Michael