From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alp Aker Newsgroups: gmane.emacs.bugs Subject: bug#18417: 24.3.93; posn-at-point confused by fill-column-indicator Date: Sun, 7 Sep 2014 23:11:35 -0400 Message-ID: References: <86sik513vf.fsf@yandex.ru> <837g1fcpm9.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8f64672f2a642c0502852dc8 X-Trace: ger.gmane.org 1410145945 14678 80.91.229.3 (8 Sep 2014 03:12:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 8 Sep 2014 03:12:25 +0000 (UTC) Cc: 18417@debbugs.gnu.org, Dmitry To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 08 05:12:18 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 1XQpNJ-0003do-T0 for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Sep 2014 05:12:18 +0200 Original-Received: from localhost ([::1]:40359 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQpNJ-0001rN-Bp for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Sep 2014 23:12:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQpNA-0001qO-Bp for bug-gnu-emacs@gnu.org; Sun, 07 Sep 2014 23:12:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XQpN4-0005OR-5t for bug-gnu-emacs@gnu.org; Sun, 07 Sep 2014 23:12:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41576) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQpN4-0005ON-2I for bug-gnu-emacs@gnu.org; Sun, 07 Sep 2014 23:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XQpN3-0002yw-NC for bug-gnu-emacs@gnu.org; Sun, 07 Sep 2014 23:12:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alp Aker Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Sep 2014 03:12: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.141014590411437 (code B ref 18417); Mon, 08 Sep 2014 03:12:01 +0000 Original-Received: (at 18417) by debbugs.gnu.org; 8 Sep 2014 03:11:44 +0000 Original-Received: from localhost ([127.0.0.1]:33140 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XQpMm-0002yP-2M for submit@debbugs.gnu.org; Sun, 07 Sep 2014 23:11:44 -0400 Original-Received: from mail-wi0-f170.google.com ([209.85.212.170]:34374) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XQpMi-0002y7-TT for 18417@debbugs.gnu.org; Sun, 07 Sep 2014 23:11:41 -0400 Original-Received: by mail-wi0-f170.google.com with SMTP id cc10so1953684wib.5 for <18417@debbugs.gnu.org>; Sun, 07 Sep 2014 20:11:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=sVLpMD3AN4+xhUXa//q5ox5t+Bz/LYalbKJuuPnsQqM=; b=htTyRhBS07snyHtXsYVRByGJxhtwIRP58KnE5aUz5bYJ+PcPnsn3c6u2LISQZdYPJh PGm6L1cWFssOsDTzruiNX8HpCVMdAbw8ptlhgBHcFYPjKLwZ1GZj2JvCZ3emXMOx5ixI Z96B2qGBnm+zYhY6omn6R+L3CuSsmjDMwSQEPDQQuflzQ4w0BTTtd2YcKUf9KhjmmZ2W DdPMEz3KH2mUPHclG+T08hRKqNm7KoYO9I4O3zcdxFXlM+Pvf2ZzDPOPYHU4fFLoygVb xYGRrfyY0IBaAZQoCtEc3pOzPQH9pOnPgVZ+rH4s9XeUwy4e4WIPMs5353TCMV78HZ6O el8w== X-Received: by 10.180.36.236 with SMTP id t12mr19779856wij.38.1410145895210; Sun, 07 Sep 2014 20:11:35 -0700 (PDT) Original-Received: by 10.217.39.84 with HTTP; Sun, 7 Sep 2014 20:11:35 -0700 (PDT) In-Reply-To: <837g1fcpm9.fsf@gnu.org> 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:93134 Archived-At: --e89a8f64672f2a642c0502852dc8 Content-Type: text/plain; charset=UTF-8 > 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. [snip] > 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. I'm not sure it's due to the overlay having zero length. Here's a minimal recipe that provokes the same behavior using a overlay of length 1 (covering the newline): (progn (delete-all-overlays) (goto-char (point-min)) (insert "\n") (setq o (make-overlay 1 2) s (propertize " " 'display '(space :align-to 10) 'cursor t)) (overlay-put o 'before-string s) (goto-char (point-min)) (setq col (car (posn-col-row (posn-at-point (point))))) (message (concat "Current column: " (number-to-string col)))) --e89a8f64672f2a642c0502852dc8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
> 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.
[snip]<= br>> Since the buffer position of the newline is not "covered"= by the
> empty overlay, Emacs happily stops when it reaches the newl= ine,
> oblivious to the fact that on the way it produced the stretch<= br>> glyph of a very large width.

I'm not sure it's= due to the overlay having zero length.=C2=A0 Here's a minimal recipe t= hat provokes the same behavior using a overlay of length 1 (covering the ne= wline):

(progn
=C2=A0 (delete-all-overlays)
=C2=A0 (goto-char = (point-min))
=C2=A0 (insert "\n")
=C2=A0 (setq o (make-over= lay 1 2)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 s (propertize "= "
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 'displa= y '(space :align-to 10)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 'cursor t))
=C2=A0 (overlay-put o 'before-string s)=C2=A0 (goto-char (point-min))
=C2=A0 (setq col (car (posn-col-row (pos= n-at-point (point)))))
=C2=A0 (message (concat "Current column: &qu= ot; (number-to-string col))))


--e89a8f64672f2a642c0502852dc8--