all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Jonas Bernoulli <jonas@bernoul.li>
Cc: 24179@debbugs.gnu.org
Subject: bug#24179: 24179
Date: Thu, 11 Aug 2016 20:15:15 +0300	[thread overview]
Message-ID: <838tw3fcrg.fsf@gnu.org> (raw)
In-Reply-To: <87vaz7xns5.fsf@bernoul.li> (message from Jonas Bernoulli on Thu,  11 Aug 2016 18:39:54 +0200)

> From: Jonas Bernoulli <jonas@bernoul.li>
> 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 "<dot>")
 (setq s2 (concat "<c" (propertize "o" 'cursor t) "mma>"))
 (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?





  reply	other threads:[~2016-08-11 17:15 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-07 21:15 bug#24179: 25.1; scroll-conservatively over SCROLL_LIMIT may put point in the wrong place Alex
2016-08-08  2:39 ` Eli Zaretskii
2016-08-08  5:42   ` Alex
2016-08-08 15:31     ` Eli Zaretskii
2016-08-08 16:35       ` Alex
2016-08-08 16:58         ` Eli Zaretskii
2016-08-08 17:22           ` Alex
2016-08-08 17:35             ` Eli Zaretskii
2016-08-11 15:06             ` Eli Zaretskii
2016-08-11 22:20               ` Alex
2016-08-12 14:17                 ` Eli Zaretskii
2016-08-12 22:01                   ` Alex
2016-08-13  6:52                     ` Eli Zaretskii
2016-08-13 16:59                       ` Alex
2016-08-13 17:25                         ` Eli Zaretskii
2016-08-14 18:27                       ` Eli Zaretskii
2016-08-14 20:05                         ` Alex
2016-08-11 16:39 ` bug#24179: 24179 Jonas Bernoulli
2016-08-11 17:15   ` Eli Zaretskii [this message]
2016-08-11 18:29     ` Jonas Bernoulli
2016-08-11 19:55       ` Eli Zaretskii
2016-08-11 20:07         ` Eli Zaretskii
2016-08-11 22:19           ` Jonas Bernoulli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=838tw3fcrg.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=24179@debbugs.gnu.org \
    --cc=jonas@bernoul.li \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.