Subject: bug#21732: closed (Re: bug#24804: 25.1; posn-at-point erroneously signals an error)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 29 Oct 2016 22:04:02 +0000

Your bug report

#24804: 25.0.50; intermittent failure using windmove when in doc-view buffer

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
24804: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24804
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#24804: 25.1; posn-at-point erroneously signals an error
From: Eli Zaretskii <[email-masked]>
To: Andreas Politz <[email-masked]>
Cc: [email-masked]
Date: Sun, 30 Oct 2016 01:03:17 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Andreas Politz <[email-masked]>
> Cc: [email-masked]
> Date: Sat, 29 Oct 2016 22:33:00 +0200
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > Done.  Let me know if something else should be done before closing
> > this bug.
> 
> Nothing.  I'm not clear about the general semantics of this function,
> but we don't need to discuss this right now.

OK, I'm therefore closing the bug (and the two merged with it).
People who think there are still leftovers are welcome to reopen with
details.

As for your questions about the semantics, I suggest to start a
discussion on emacs-devel.

Thanks.

Subject: 25.0.50; intermittent failure using windmove when in doc-view buffer
From: Daniel McClanahan <[email-masked]>
To: [email-masked]
Date: Thu, 22 Oct 2015 02:12:05 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

I've been experiencing this issue at least for months, I don't think I
remember a time when it wasn't happening (I've only used emacs for a
year or so). Occasionally, when viewing a file in doc-view-mode, I've
noticed that using windmove (which I use for all my window movements)
left, right, up, or down occasionally fails, throwing the error "Wrong
type argument: wholenump, -<num>", for some number num.

I've attached gdb and found that this is because "cursor.y" of the
window being chosen is negative, which I found after attaching a
breakpoint to "posn-at-point," which was throwing the error, and
following it down a few calls to "pos_visible_p", and checking the
value of "w" in there. I don't know what "w->cursor.y" represents (I
know it's cursor position, but I don't know how that maps to the
cursor's lisp representation), and although I've delved into xdisp.c
to see why that would be negative (but only sometimes) in doc-view
buffers, I haven't been able to see where the cursor position is
updated, and I've spent a few hours checking it out but am finding it
difficult to follow a lot of the xdisp.c code.

Is this something that has been seen before? I encounter it relatively
often when working with a text buffer open in one window and a pdf
open in doc-view-mode in an adjacent window.

Steps to reproduce: kind of hard, since it's very intermittent.
Basically, just switch window focus between a pdf and another buffer a
few times over a period of editing time, and it should show up
(typically within 30 minutes for me).

I've also noticed that when this "wholenump" error occurs, the line
number in the mode line is set to (1- the number of lines in the
document), when the line number in the mode line for doc-view-mode is
usually set to 1. I don't recall when this is changed. Also, after
this situation occurs (the wholenump error appears), I cannot zoom in
or out or change pages.

Sorry for the poor report, I wish I had more information but wanted to
know if this was a known problem already.