From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#18417: 24.3.93; posn-at-point confused by fill-column-indicator Date: Sun, 07 Sep 2014 20:22:22 +0300 Message-ID: <837g1fcpm9.fsf@gnu.org> References: <86sik513vf.fsf@yandex.ru> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1410110604 10351 80.91.229.3 (7 Sep 2014 17:23:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 7 Sep 2014 17:23:24 +0000 (UTC) Cc: 18417@debbugs.gnu.org To: Dmitry Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 07 19:23:17 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1XQgBJ-0001HT-8c for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Sep 2014 19:23:17 +0200 Original-Received: from localhost ([::1]:39021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQgBI-0006Iw-Rg for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Sep 2014 13:23:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51950) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQgB9-0006EE-2v for bug-gnu-emacs@gnu.org; Sun, 07 Sep 2014 13:23:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XQgB4-0005OM-6x for bug-gnu-emacs@gnu.org; Sun, 07 Sep 2014 13:23:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41404) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQgB4-0005OI-3z for bug-gnu-emacs@gnu.org; Sun, 07 Sep 2014 13:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XQgB3-0003zX-Nh for bug-gnu-emacs@gnu.org; Sun, 07 Sep 2014 13:23:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Sep 2014 17:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18417 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18417-submit@debbugs.gnu.org id=B18417.141011054615292 (code B ref 18417); Sun, 07 Sep 2014 17:23:01 +0000 Original-Received: (at 18417) by debbugs.gnu.org; 7 Sep 2014 17:22:26 +0000 Original-Received: from localhost ([127.0.0.1]:32968 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XQgAT-0003yZ-Hr for submit@debbugs.gnu.org; Sun, 07 Sep 2014 13:22:26 -0400 Original-Received: from mtaout28.012.net.il ([80.179.55.184]:48293) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XQgAR-0003yJ-B6 for 18417@debbugs.gnu.org; Sun, 07 Sep 2014 13:22:24 -0400 Original-Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0NBJ00I00K3H5000@mtaout28.012.net.il> for 18417@debbugs.gnu.org; Sun, 07 Sep 2014 20:21:00 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NBJ00GGXK701320@mtaout28.012.net.il>; Sun, 07 Sep 2014 20:21:00 +0300 (IDT) In-reply-to: <86sik513vf.fsf@yandex.ru> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:93109 Archived-At: > From: Dmitry > Date: Sat, 06 Sep 2014 13:43:00 +0400 > > 1. Download, put inside load-path and require fill-column-indicator.el, > from https://github.com/alpaker/Fill-Column-Indicator. > 2. Open an empty buffer, add a newline inside it. > 3. Toggle fcm-mode on. Notice the indicator at the end of the empty > line. ^^^^^^^^ I assume you meant "fci-mode". > 4. With point at the beginning of that line, evaluate > > (posn-col-row (posn-at-point (point))) > > and see it evaluate to (71 . 0). > > The problem is probably not in posn-col-row, because (posn-x-y > (posn-at-point (point))) also returns a large non-zero value in car. This was previously reported and discussed here: http://lists.gnu.org/archive/html/emacs-devel/2013-07/msg00445.html My correspondent there expressed interest in fixing this, but I never heard from him about this since then, although I pointed him at posn-at-point as the most probable culprit. Anyway, I'm not going to lose sleep over this, sorry. The recipe in effect invokes undefined behavior in posn-at-point, because fci-mode uses a zero-length (a.k.a. "empty") overlay to place, in a very convoluted way, a stretch of whitespace followed by an image, before the newline. Since "at point" means "before point", and the recipe asks for coordinates at the newline position, it is not clear whether the reported coordinates should or shouldn't include the stretch glyph. The result you see is the consequence of the implementation details of the functions that simulate display in order to compute screen coordinates at a given buffer position. Since the buffer position of the newline is not "covered" by the empty overlay, Emacs happily stops when it reaches the newline, oblivious to the fact that on the way it produced the stretch glyph of a very large width. If someone wants to work on this, patches will be welcome, of course.