GNU bug report logs - #24804
25.1; posn-at-point erroneously signals an error

Previous Next

Package: emacs;

Reported by: Andreas Politz <politza <at> hochschule-trier.de>

Date: Wed, 26 Oct 2016 19:45:01 UTC

Severity: normal

Merged with 21732, 23809

Found in versions 24.5, 25.0.50, 25.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #13 received at 24804 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Andreas Politz <politza <at> hochschule-trier.de>, 24804 <at> debbugs.gnu.org
Subject: Re: bug#24804: 25.1; posn-at-point erroneously signals an error
Date: Thu, 27 Oct 2016 19:35:55 +0200
> The documentation of the function posn-at-point states
>
> "Return nil if position is not visible in window.",
>
> but it may also signal an error in this case.  This happens, if
> Fpos_visible_in_window_p returns a list of (X Y RTOP RBOT ROWH VPOS)
> and at least Y is negative (which indicates, that pos is not visible
> IIUC).  The error is then signaled by Fposn_at_x_y, which only accpets
> non-negative numbers (neglecting the exceptional case of -1 for X).
>
> I think this function should include a similar test for y, as is already
> in place for x, returning nil if it is negative (see below).

Thanks.  But according to Eli the problem is in Fpos_visible_in_window_p
which should never return a negative y in the first place.

> Reproducing this state may be a little bit tricky, anyway evaluate the
> following lines, starting with `emacs -Q'.
>
> (defvar img "foo.png");; The image should be taller then the window
>                        ;; it's displayed in.
> (setq debug-on-error t)
> (find-file img)
> (redisplay t)         ;; If in batch mode.
> (image-scroll-up 999)
> ;; The image should be scrolled to the bottom now, while point equals 1.
> (posn-at-point (point-max) (selected-window))

That's a valuable information.  I indeed can reproduce the problem with
this scenario (but only on another machine where I can display images
and the Emacs there must be repaired).  Could you try answering the
question Eli asked for bug#23809 namely:

  . Can you show the entire value returned by Fpos_visible_in_window_p
    when its call from Fposn_at_point returns, when this problem is
    reproduced?

Thanks again, martin




This bug report was last modified 8 years and 209 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.