From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#24179: 24179 Date: Thu, 11 Aug 2016 20:15:15 +0300 Message-ID: <838tw3fcrg.fsf@gnu.org> References: <87y448s2k8.fsf@gmail.com> <87vaz7xns5.fsf@bernoul.li> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1470935780 1828 195.159.176.226 (11 Aug 2016 17:16:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 11 Aug 2016 17:16:20 +0000 (UTC) Cc: 24179@debbugs.gnu.org To: Jonas Bernoulli Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 11 19:16:16 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXtaZ-0000Lz-6s for geb-bug-gnu-emacs@m.gmane.org; Thu, 11 Aug 2016 19:16:15 +0200 Original-Received: from localhost ([::1]:49847 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXtaW-0003kj-5i for geb-bug-gnu-emacs@m.gmane.org; Thu, 11 Aug 2016 13:16:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56612) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXtaQ-0003kc-7K for bug-gnu-emacs@gnu.org; Thu, 11 Aug 2016 13:16:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXtaL-0008Gm-VI for bug-gnu-emacs@gnu.org; Thu, 11 Aug 2016 13:16:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56559) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXtaL-0008Gi-SE for bug-gnu-emacs@gnu.org; Thu, 11 Aug 2016 13:16:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bXtaL-0007T6-LA for bug-gnu-emacs@gnu.org; Thu, 11 Aug 2016 13:16: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: Thu, 11 Aug 2016 17:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24179 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24179-submit@debbugs.gnu.org id=B24179.147093573928678 (code B ref 24179); Thu, 11 Aug 2016 17:16:01 +0000 Original-Received: (at 24179) by debbugs.gnu.org; 11 Aug 2016 17:15:39 +0000 Original-Received: from localhost ([127.0.0.1]:54271 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXtZz-0007SU-Bz for submit@debbugs.gnu.org; Thu, 11 Aug 2016 13:15:39 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37323) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXtZy-0007SG-1c for 24179@debbugs.gnu.org; Thu, 11 Aug 2016 13:15:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXtZp-0008Dv-MG for 24179@debbugs.gnu.org; Thu, 11 Aug 2016 13:15:32 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34946) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXtZp-0008Di-IR; Thu, 11 Aug 2016 13:15:29 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2046 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bXtZl-0004Xq-Gm; Thu, 11 Aug 2016 13:15:26 -0400 In-reply-to: <87vaz7xns5.fsf@bernoul.li> (message from Jonas Bernoulli on Thu, 11 Aug 2016 18:39:54 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:122090 Archived-At: > From: Jonas Bernoulli > Date: Thu, 11 Aug 2016 18:39:54 +0200 > > (with-current-buffer (get-buffer-create "demo") > (pop-to-buffer (current-buffer)) > (erase-buffer) > (insert "one\ntwo\nthree") > (backward-word 2) > (let ((ov (make-overlay (point) > (save-excursion > (forward-line 1) > (point)))) > (heading "before two\n")) > (put-text-property 0 1 'cursor (length heading) heading) > (overlay-put ov 'before-string heading) > (overlay-put ov 'the-value "two") > (overlay-put ov 'evaporate t))) > > However I would then expect that it would become possible for the cursor > to be displayed "on" the "b" because of this: "In other words, the > string character with the ‘cursor’ property of any non-‘nil’ value is > the character where to display the cursor. The value of the property > says for which buffer positions to display the cursor there." > > one > *efore two > two > three > > That would be a change in behavior* but I am not seeing any change so I > am unsure whether I am doing this all wrong. If so, then please correct > the above code. It looks like I misremembered: before-strings cannot benefit from this feature, because they don't conceal any buffer positions. Emacs only considers the cursor property when the buffer position of point is not visible on the screen, so you need to use 'display' properties. Sorry about that. Here's an example that will allow you to experiment: (setq s1 "") (setq s2 (concat "")) (setq c1 (propertize "..." 'display s1)) (setq c2 (propertize ",,," 'display s2)) (insert "abc" c1 "def" c2 "xyz" c1 c2 "123" c2 "456" c1 c2 c1 "789" c2 "end\n") > * However if that is possible, I would prefer to use the `cursor' > property to provide the hint to the display engine that the cursor > should keep ending up here (as it does without fiddling with `cursor' at > all): > > one > before two > *wo > three That already happens, doesn't it?