unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#25522: 26.0.50; (hl-line-maybe-unhighlight): (error "Selecting deleted buffer")
@ 2017-01-24 23:26 Michael Heerdegen
  2017-01-24 23:39 ` Michael Heerdegen
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Heerdegen @ 2017-01-24 23:26 UTC (permalink / raw)
  To: 25522; +Cc: Stephen Berman


Hi,

this is on master.  When exiting Gnus, I always get

  Error in post-command-hook (hl-line-maybe-unhighlight): (error "Selecting deleted buffer")

Seems that the new definition of `hl-line-maybe-unhighlight' in commit

  16be3e9054 hl-line.el: Fix flickering of highlighted line (bug#23510)

(by Stephen Berman whom I CC'd)

should test whether the `hl-line-overlay-buffer' is alive before trying
to switch to it?

Please tell me if you need a recipe.


Thanks,

Michael.





In GNU Emacs 26.0.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.6)
 of 2017-01-24 built on drachen
Repository revision: 201dfe311868932d10da146808fcdd681948ba53
Windowing system distributor 'The X.Org Foundation', version 11.0.11900000
System Description:	Debian GNU/Linux 9.0 (stretch)






^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#25522: 26.0.50; (hl-line-maybe-unhighlight): (error "Selecting deleted buffer")
  2017-01-24 23:26 bug#25522: 26.0.50; (hl-line-maybe-unhighlight): (error "Selecting deleted buffer") Michael Heerdegen
@ 2017-01-24 23:39 ` Michael Heerdegen
  2017-01-25 12:16   ` Stephen Berman
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Heerdegen @ 2017-01-24 23:39 UTC (permalink / raw)
  To: 25522; +Cc: Stephen Berman

Michael Heerdegen <michael_heerdegen@web.de> writes:

>   Error in post-command-hook (hl-line-maybe-unhighlight): (error "Selecting deleted buffer")

> Please tell me if you need a recipe.

FWIW this is my setup:

#+begin_src emacs-lisp
(add-hook 'gnus-summary-mode-hook #'hl-line-mode)
(add-hook 'gnus-group-mode-hook #'hl-line-mode)
(add-hook 'gnus-server-mode-hook #'hl-line-mode)
#+end_src


Michael.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#25522: 26.0.50; (hl-line-maybe-unhighlight): (error "Selecting deleted buffer")
  2017-01-24 23:39 ` Michael Heerdegen
@ 2017-01-25 12:16   ` Stephen Berman
  2017-01-26  1:14     ` Michael Heerdegen
  0 siblings, 1 reply; 11+ messages in thread
From: Stephen Berman @ 2017-01-25 12:16 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 25522

On Wed, 25 Jan 2017 00:39:45 +0100 Michael Heerdegen <michael_heerdegen@web.de> wrote:

> Michael Heerdegen <michael_heerdegen@web.de> writes:
>
>>   Error in post-command-hook (hl-line-maybe-unhighlight): (error "Selecting
>> deleted buffer")
>
>> Please tell me if you need a recipe.

I would appreciate one, as I can't reproduce the problem.

> FWIW this is my setup:
>
> #+begin_src emacs-lisp
> (add-hook 'gnus-summary-mode-hook #'hl-line-mode)
> (add-hook 'gnus-group-mode-hook #'hl-line-mode)
> (add-hook 'gnus-server-mode-hook #'hl-line-mode)
> #+end_src

I updated my build to current master, started emacs -Q, evaluated the
above sexps in *scratch*, started Gnus, saw that the current line in the
*Summary* buffer was highlighted, then exited Gnus without getting an
error.  Same thing by making ~/.emacs contain only the above sexps.

Steve Berman





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#25522: 26.0.50; (hl-line-maybe-unhighlight): (error "Selecting deleted buffer")
  2017-01-25 12:16   ` Stephen Berman
@ 2017-01-26  1:14     ` Michael Heerdegen
  2017-01-26  1:21       ` Michael Heerdegen
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Heerdegen @ 2017-01-26  1:14 UTC (permalink / raw)
  To: Stephen Berman; +Cc: 25522

Stephen Berman <stephen.berman@gmx.net> writes:

> >>   Error in post-command-hook (hl-line-maybe-unhighlight): (error
> >> "Selecting deleted buffer")

> > FWIW this is my setup:
> >
> > #+begin_src emacs-lisp
> > (add-hook 'gnus-summary-mode-hook #'hl-line-mode)
> > (add-hook 'gnus-group-mode-hook #'hl-line-mode)
> > (add-hook 'gnus-server-mode-hook #'hl-line-mode)
> > #+end_src
>
> I updated my build to current master, started emacs -Q, evaluated the
> above sexps in *scratch*, started Gnus, saw that the current line in the
> *Summary* buffer was highlighted, then exited Gnus without getting an
> error.  Same thing by making ~/.emacs contain only the above sexps.

Finding a recipe is not easy because I have to find the offending pieces
in my setup.  I tried M-x debug-on-entry hl-line-maybe-unhighlight,
also edebug, but the error magically disappeared.

But I found that I had concealed a related setting in my .emacs:

  (setq-default hl-line-sticky-flag nil)

If you still can't reproduce with that, I will probably have to create a
new user on my system to be able to bisect my setup without messing up
my Gnus.


Regards,

Michael.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#25522: 26.0.50; (hl-line-maybe-unhighlight): (error "Selecting deleted buffer")
  2017-01-26  1:14     ` Michael Heerdegen
@ 2017-01-26  1:21       ` Michael Heerdegen
  2017-01-26  2:07         ` Michael Heerdegen
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Heerdegen @ 2017-01-26  1:21 UTC (permalink / raw)
  To: Stephen Berman; +Cc: 25522

Michael Heerdegen <michael_heerdegen@web.de> writes:

>   (setq-default hl-line-sticky-flag nil)

Removing that from my init file seems to fix the issue.  Maybe we are
lucky and this was already the missing piece.


Michael.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#25522: 26.0.50; (hl-line-maybe-unhighlight): (error "Selecting deleted buffer")
  2017-01-26  1:21       ` Michael Heerdegen
@ 2017-01-26  2:07         ` Michael Heerdegen
  2017-01-26  9:54           ` Stephen Berman
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Heerdegen @ 2017-01-26  2:07 UTC (permalink / raw)
  To: Stephen Berman; +Cc: 25522

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Michael Heerdegen <michael_heerdegen@web.de> writes:
>
> >   (setq-default hl-line-sticky-flag nil)
>
> Removing that from my init file seems to fix the issue.  Maybe we are
> lucky and this was already the missing piece.

I just got the same error message after hitting U x in M-x
list-packages.  Here is an excerpt from `interaction-log':


| x package-menu-execute *Packages*
| Upgrade these 3 packages (helm-20170123.2253, xah-find-20161221.1705, helm-core-20170122.250)? (y or n) y
| Package menu: Operation started [Upgrading 3]
| Contacting host: melpa.org:80
| [...]
| Wrote /home/micha/.emacs.d/elpa/helm-20170124.2354/helm-autoloads.el
| ../../.emacs.d/elpa/helm-20170124.2354/helm-elisp.el: `dont-compile' is an obsolete macro (as of 24.4).
| Loading async...done
| ../../.emacs.d/elpa/helm-20170124.2354/helm-elisp.el: `dont-compile' is an obsolete macro (as of 24.4).
| Package `helm-20170123.2253' deleted.
| Package `xah-find-20161221.1705' deleted.
| Package `helm-core-20170122.250' deleted.
| Package menu: Operation finished [Upgraded 3]
| Error in post-command-hook (hl-line-maybe-unhighlight): (error "Selecting deleted buffer")
| q quit-window *Packages*
| Error in post-command-hook (hl-line-maybe-unhighlight): (error "Selecting deleted buffer") [2 times]


Michael.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#25522: 26.0.50; (hl-line-maybe-unhighlight): (error "Selecting deleted buffer")
  2017-01-26  2:07         ` Michael Heerdegen
@ 2017-01-26  9:54           ` Stephen Berman
  2017-01-26 10:15             ` Michael Heerdegen
  0 siblings, 1 reply; 11+ messages in thread
From: Stephen Berman @ 2017-01-26  9:54 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 25522

On Thu, 26 Jan 2017 03:07:51 +0100 Michael Heerdegen <michael_heerdegen@web.de> wrote:

> Michael Heerdegen <michael_heerdegen@web.de> writes:
>
>> Michael Heerdegen <michael_heerdegen@web.de> writes:
>>
>> >   (setq-default hl-line-sticky-flag nil)
>>
>> Removing that from my init file seems to fix the issue.  Maybe we are
>> lucky and this was already the missing piece.
>
> I just got the same error message after hitting U x in M-x
> list-packages.  Here is an excerpt from `interaction-log':

Is this after removing the above sexp?  Did you have hl-line-mode
enabled in package-menu-mode, and if so, how?  I added this:

(add-hook 'package-menu-mode-hook #'hl-line-mode)

to ~/.emacs and did `I x' in package-menu-mode (I didn't have any
package to update so I just installed a new one), but didn't get the
error (even with the above setq-default).  Anyway, your suggestion to
check hl-line-overlay-buffer appears to eliminate the error when exiting
Gnus, so does the following patch also fix the other error you saw?

Steve Berman

diff --git a/lisp/hl-line.el b/lisp/hl-line.el
index 4cf0573..38fe683 100644
--- a/lisp/hl-line.el
+++ b/lisp/hl-line.el
@@ -189,7 +189,8 @@ hl-line-maybe-unhighlight
 such overlays in all buffers except the current one."
   (let ((hlob hl-line-overlay-buffer)
         (curbuf (current-buffer)))
-    (when (and (not hl-line-sticky-flag)
+    (when (and (buffer-live-p hlob)
+               (not hl-line-sticky-flag)
                (not (eq curbuf hlob))
                (not (minibufferp)))
       (with-current-buffer hlob





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* bug#25522: 26.0.50; (hl-line-maybe-unhighlight): (error "Selecting deleted buffer")
  2017-01-26  9:54           ` Stephen Berman
@ 2017-01-26 10:15             ` Michael Heerdegen
  2017-01-26 19:45               ` Stephen Berman
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Heerdegen @ 2017-01-26 10:15 UTC (permalink / raw)
  To: Stephen Berman; +Cc: 25522

Stephen Berman <stephen.berman@gmx.net> writes:

> > I just got the same error message after hitting U x in M-x
> > list-packages.
>
> Is this after removing the above sexp?

No, still with hl-line-sticky-flag -> nil.


> Did you have hl-line-mode enabled in package-menu-mode, and if so,
> how?  I added this:
>
> (add-hook 'package-menu-mode-hook #'hl-line-mode)

Yes, that's exactly what I use - sorry for my terseness.


> -    (when (and (not hl-line-sticky-flag)
> +    (when (and (buffer-live-p hlob)
> +               (not hl-line-sticky-flag)

Yeah, that seems to fix the problem (I had already tried that ;-)).  I
still wonder why you don't see it...but I'm not sure if it's worth to
investigate (because this will probably take hours).


Thanks,

Michael.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#25522: 26.0.50; (hl-line-maybe-unhighlight): (error "Selecting deleted buffer")
  2017-01-26 10:15             ` Michael Heerdegen
@ 2017-01-26 19:45               ` Stephen Berman
  2017-01-27  9:29                 ` Michael Heerdegen
  0 siblings, 1 reply; 11+ messages in thread
From: Stephen Berman @ 2017-01-26 19:45 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 25522

On Thu, 26 Jan 2017 11:15:24 +0100 Michael Heerdegen <michael_heerdegen@web.de> wrote:

> Stephen Berman <stephen.berman@gmx.net> writes:
>
>> > I just got the same error message after hitting U x in M-x
>> > list-packages.
>>
>> Is this after removing the above sexp?
>
> No, still with hl-line-sticky-flag -> nil.
>
>
>> Did you have hl-line-mode enabled in package-menu-mode, and if so,
>> how?  I added this:
>>
>> (add-hook 'package-menu-mode-hook #'hl-line-mode)
>
> Yes, that's exactly what I use - sorry for my terseness.
>
>
>> -    (when (and (not hl-line-sticky-flag)
>> +    (when (and (buffer-live-p hlob)
>> +               (not hl-line-sticky-flag)
>
> Yeah, that seems to fix the problem (I had already tried that ;-)).  I
> still wonder why you don't see it...but I'm not sure if it's worth to
> investigate (because this will probably take hours).

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?  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.

Steve Berman





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#25522: 26.0.50; (hl-line-maybe-unhighlight): (error "Selecting deleted buffer")
  2017-01-26 19:45               ` Stephen Berman
@ 2017-01-27  9:29                 ` Michael Heerdegen
  2017-01-28 19:52                   ` Stephen Berman
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Heerdegen @ 2017-01-27  9:29 UTC (permalink / raw)
  To: Stephen Berman; +Cc: 25522

Stephen Berman <stephen.berman@gmx.net> 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





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#25522: 26.0.50; (hl-line-maybe-unhighlight): (error "Selecting deleted buffer")
  2017-01-27  9:29                 ` Michael Heerdegen
@ 2017-01-28 19:52                   ` Stephen Berman
  0 siblings, 0 replies; 11+ messages in thread
From: Stephen Berman @ 2017-01-28 19:52 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 25522-done

On Fri, 27 Jan 2017 10:29:07 +0100 Michael Heerdegen <michael_heerdegen@web.de> wrote:

> Stephen Berman <stephen.berman@gmx.net> 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

Pushed as commit d12e1dd and closing the bug.

Steve Berman





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-01-28 19:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-24 23:26 bug#25522: 26.0.50; (hl-line-maybe-unhighlight): (error "Selecting deleted buffer") Michael Heerdegen
2017-01-24 23:39 ` Michael Heerdegen
2017-01-25 12:16   ` Stephen Berman
2017-01-26  1:14     ` Michael Heerdegen
2017-01-26  1:21       ` Michael Heerdegen
2017-01-26  2:07         ` Michael Heerdegen
2017-01-26  9:54           ` Stephen Berman
2017-01-26 10:15             ` Michael Heerdegen
2017-01-26 19:45               ` Stephen Berman
2017-01-27  9:29                 ` Michael Heerdegen
2017-01-28 19:52                   ` Stephen Berman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).