From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: (pos-visible-in-window-p t nil t) returns wrong position/is suboptimally documented. Date: Wed, 30 Sep 2015 08:56:11 +0000 Message-ID: <20150930085611.GA6672@acm.fritz.box> References: <20150927104041.GA2401@acm.fritz.box> <8337y0f7es.fsf@gnu.org> <83twqcbcem.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1443677308 9435 80.91.229.3 (1 Oct 2015 05:28:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 1 Oct 2015 05:28:28 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 01 07:28:17 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZhWPf-0002gX-GR for ged-emacs-devel@m.gmane.org; Thu, 01 Oct 2015 07:28:15 +0200 Original-Received: from localhost ([::1]:38282 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhWPe-0005p3-Oj for ged-emacs-devel@m.gmane.org; Thu, 01 Oct 2015 01:28:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53750) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhDA3-0000G2-DW for emacs-devel@gnu.org; Wed, 30 Sep 2015 04:54:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZhD9y-0000B2-Ds for emacs-devel@gnu.org; Wed, 30 Sep 2015 04:54:51 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:55700) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhD9y-0000Am-4A for emacs-devel@gnu.org; Wed, 30 Sep 2015 04:54:46 -0400 Original-Received: (qmail 20239 invoked by uid 3782); 30 Sep 2015 08:54:44 -0000 Original-Received: from acm.muc.de (p5B147BA3.dip0.t-ipconnect.de [91.20.123.163]) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 30 Sep 2015 10:54:43 +0200 Original-Received: (qmail 16802 invoked by uid 1000); 30 Sep 2015 08:56:11 -0000 Content-Disposition: inline In-Reply-To: <83twqcbcem.fsf@gnu.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-Received-From: 193.149.48.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:190507 Archived-At: Hello, Eli. On Wed, Sep 30, 2015 at 10:21:21AM +0300, Eli Zaretskii wrote: > > Date: Sun, 27 Sep 2015 14:06:35 +0300 > > From: Eli Zaretskii > > Cc: emacs-devel@gnu.org > > > > > Date: Sun, 27 Sep 2015 10:40:41 +0000 > > > From: Alan Mackenzie > > > > > > Which is correct? The function or the documentation? > > > > The function. This has always worked like that. > I've clarified the documentation to match what the function does in > that case. > Thanks. Thank you! However: "If POSITION is `t', that means to check the first visible position of the last visible screen line in WINDOW." doesn't seem quite right. If the text in the window is scrolled such that EOB is in the middle of the window, POSITION t gives the coordinates of the last line containing text, not the last visible screen line. How about something like: "If POSITION is `t', that means to check the first visible position of the last visible screen line in WINDOW which is at or above the end of the window's buffer." ? ------------------------------------------------------------------------- However 2: I think there's a bug in the functionality, too. If there is o - a text buffer o - with no terminating LF on its last line, and o - that last line is above the window's last line then (pos-visible-in-window t nil t) returns the coordinates of the last lines's EOL. This is the case in both a Linux virtual terminal and an X windows session. -- Alan Mackenzie (Nuremberg, Germany).