From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#18285: 24.3.92; A combination of `display' on text and `invisible' and `before/after-string' leads to the before/after string being displayed twice Date: Thu, 21 Aug 2014 18:07:07 +0400 Message-ID: <53F5FD0B.1070800@yandex.ru> References: <86d2bypwx1.fsf@yandex.ru> <83k365defw.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1408630104 17579 80.91.229.3 (21 Aug 2014 14:08:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Aug 2014 14:08:24 +0000 (UTC) Cc: 18285@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 21 16:08: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 1XKT2H-0001Kd-AC for geb-bug-gnu-emacs@m.gmane.org; Thu, 21 Aug 2014 16:08:17 +0200 Original-Received: from localhost ([::1]:60888 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKT2G-0002CF-S1 for geb-bug-gnu-emacs@m.gmane.org; Thu, 21 Aug 2014 10:08:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39494) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKT28-0002Bs-S5 for bug-gnu-emacs@gnu.org; Thu, 21 Aug 2014 10:08:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XKT22-00021T-RI for bug-gnu-emacs@gnu.org; Thu, 21 Aug 2014 10:08:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42084) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKT22-00021P-Mj for bug-gnu-emacs@gnu.org; Thu, 21 Aug 2014 10:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XKT22-0003Kn-Bs for bug-gnu-emacs@gnu.org; Thu, 21 Aug 2014 10:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 Aug 2014 14:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18285 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18285-submit@debbugs.gnu.org id=B18285.140863003912764 (code B ref 18285); Thu, 21 Aug 2014 14:08:02 +0000 Original-Received: (at 18285) by debbugs.gnu.org; 21 Aug 2014 14:07:19 +0000 Original-Received: from localhost ([127.0.0.1]:49027 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XKT1K-0003Jn-Le for submit@debbugs.gnu.org; Thu, 21 Aug 2014 10:07:19 -0400 Original-Received: from mail-la0-f52.google.com ([209.85.215.52]:52549) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XKT1I-0003JZ-8q for 18285@debbugs.gnu.org; Thu, 21 Aug 2014 10:07:17 -0400 Original-Received: by mail-la0-f52.google.com with SMTP id b17so8731123lan.11 for <18285@debbugs.gnu.org>; Thu, 21 Aug 2014 07:07:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=x2HEfsviRk392atplOOr5geHGSTBdXvfQpCk9GCFPck=; b=kBp17x65/34PHgVJTEuHpAC08CbW0g5z9bRA4OKy24GynOKLDp5h4MR4ZDhGdA9x8V HQR1OdToG5C3BMDlFnlADzDEJZ/KAim/1Bv4e/5ViZhLvoeODcnyz+fpw5xDDkrSj6NY ZcEYgNPtYNybun0Jkr/orI0c/YtcWOSEvDmzhsw9VJTdmC2d7LKuiuNt1cpZ1F6938Nw hGvJ1aGPtp4SQUBXdR+xHvWwU8RgEqi+gueCsOXdewri9P823oIC3hk+M8AngaQbo6UC xPkiaS/S/Gxi4FIdgiNOSZ6WWNTPQuv92kXZhGnyZeKIdvovBrMj/YnPkCuFCee2G+1Y VAqQ== X-Received: by 10.112.78.38 with SMTP id y6mr21415736lbw.94.1408630030197; Thu, 21 Aug 2014 07:07:10 -0700 (PDT) Original-Received: from [192.168.1.3] ([178.252.98.87]) by mx.google.com with ESMTPSA id y1sm16398014laj.5.2014.08.21.07.07.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Aug 2014 07:07:09 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 In-Reply-To: <83k365defw.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:92563 Archived-At: On 08/18/2014 07:07 PM, Eli Zaretskii wrote: > Believe it or not, but this is how the code was written 14 years ago, > although perhaps this particular consequence wasn't intended. But it > follows logically from how the display engine works. I can believe it all right. I guess the question is, could there be a modification of the current logic that would preserve most of the current behavior, except for the weird situations like this one. If not, that's all right by me. The workaround of replacing `before-string' + `invisible' with just `display' seems to function just fine so far. For some reason, Nikolaj opted to render the completion tooltip in Company with the former option, so I tried not to change it too much. Maybe that worked around some bugs in older Emacs, which we don't support anymore. > The fundamental issue here is that the 'invisible' property makes all > the character positions between the start and the end of the overlay > indistinguishable. Therefore, the display engine considers the > 'before-string' and 'after-string' of an overlay that spans invisible > text to be applicable to both the start and the end of the overlay, > something it wouldn't do if the 'invisible' property were not present. Hmm. Maybe the fix could be to make the `invisible' property disable `display': as long as former is present, the latter won't work. After all, that was the intention behind the code I encountered this bug in. And with the current logic, like you say, if `display' is set, `invisible' is redundant. > I think it's not worth to try to fix this (by complicating the heck > out of the display engine) on the account of this use case. Maybe so, but see above. > My crystal ball says ... > ... IOW, without the 'invisible' property getting in the way, > the 'before-string' is displayed before the display property, and > the 'after-string' is displayed after it. Yes, sure. I just meant that the bug is the same with `invisible' on. > Btw, there was a discussion of a similar issue starting at > > http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00674.html > > It was inconclusive. Thanks. That looks very much like a bug as well, though maybe again, too expensive to fix. FWIW, for that issue, if myov2 has higher priority than myov1 (if only by virtue of being inside and shorter), I'd display just "STRING2" ("STRING1" would not be visible at all). But that's just going by logic; maybe there's a use case that would break.