From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: (pos-visible-in-window-p t nil t) returns wrong position/is suboptimally documented. Date: Thu, 01 Oct 2015 10:36:01 +0300 Message-ID: <83twqb9h26.fsf@gnu.org> References: <20150927104041.GA2401@acm.fritz.box> <8337y0f7es.fsf@gnu.org> <83twqcbcem.fsf@gnu.org> <20150930085611.GA6672@acm.fritz.box> <83lhbob6bs.fsf@gnu.org> <20150930102231.GB6672@acm.fritz.box> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1443708513 20549 80.91.229.3 (1 Oct 2015 14:08:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 1 Oct 2015 14:08:33 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 01 16:08:20 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 1ZheWv-000095-BL for ged-emacs-devel@m.gmane.org; Thu, 01 Oct 2015 16:08:17 +0200 Original-Received: from localhost ([::1]:50576 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZheWu-0008A8-Op for ged-emacs-devel@m.gmane.org; Thu, 01 Oct 2015 10:08:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59100) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhYPh-0008HY-W9 for emacs-devel@gnu.org; Thu, 01 Oct 2015 03:36:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZhYPd-0001AV-0H for emacs-devel@gnu.org; Thu, 01 Oct 2015 03:36:25 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:64281) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhYPc-0001AG-Om for emacs-devel@gnu.org; Thu, 01 Oct 2015 03:36:20 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NVJ00600649M800@a-mtaout22.012.net.il> for emacs-devel@gnu.org; Thu, 01 Oct 2015 10:36:11 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NVJ006K96GANI00@a-mtaout22.012.net.il>; Thu, 01 Oct 2015 10:36:11 +0300 (IDT) In-reply-to: <20150930102231.GB6672@acm.fritz.box> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.172 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:190544 Archived-At: > Date: Wed, 30 Sep 2015 10:22:31 +0000 > From: Alan Mackenzie > Cc: emacs-devel@gnu.org > > Hello, Eli. > > > > 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. > > > It's not a bug. If you think it's important to mention this marginal > > use case, I can add that, too. > > OK, it's deliberate. It's a touch puzzling, though. To understand it, you need to keep in mind that this function considers only the vertical dimension; the horizontal dimensions you get are the side effect. In particular when POS is t, the function tries to get to the largest Y coordinate visible in the window; once it gets there, it just reports where that is.