* About the `cursor' property
@ 2013-03-08 12:45 Xue Fuqiao
2013-03-08 13:05 ` Jambunathan K
2013-03-08 14:15 ` Eli Zaretskii
0 siblings, 2 replies; 3+ messages in thread
From: Xue Fuqiao @ 2013-03-08 12:45 UTC (permalink / raw)
To: help-gnu-emacs
In (info "(elisp) Special Properties"), there is a `cursor' property.
It says that:
`cursor'
Normally, the cursor is displayed at the beginning or the end of
any overlay and text property strings present at the current
buffer position. You can place the cursor on any desired
character of these strings by giving that character a non-`nil'
`cursor' text property. [...]
I had read through this node, but I still didn't know how to use this
property. I tried "(add-text-properties 1 5 '(cursor 2))" in
*scratch*, but the cursor didn't move. Can anybody help? Thanks.
--
Best regards, Xue Fuqiao.
http://www.emacswiki.org/emacs/XueFuqiao
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: About the `cursor' property
2013-03-08 12:45 About the `cursor' property Xue Fuqiao
@ 2013-03-08 13:05 ` Jambunathan K
2013-03-08 14:15 ` Eli Zaretskii
1 sibling, 0 replies; 3+ messages in thread
From: Jambunathan K @ 2013-03-08 13:05 UTC (permalink / raw)
To: Xue Fuqiao; +Cc: help-gnu-emacs
Xue Fuqiao <xfq.free@gmail.com> writes:
> In (info "(elisp) Special Properties"), there is a `cursor' property.
>
> It says that:
>
> `cursor'
> Normally, the cursor is displayed at the beginning or the end of
> any overlay and text property strings present at the current
> buffer position. You can place the cursor on any desired
> character of these strings by giving that character a non-`nil'
> `cursor' text property. [...]
>
> I had read through this node, but I still didn't know how to use this
> property. I tried "(add-text-properties 1 5 '(cursor 2))" in
> *scratch*, but the cursor didn't move. Can anybody help? Thanks.
Copy-pasta from icomplete.el.
(put-text-property 0 1 'cursor t text)
--
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: About the `cursor' property
2013-03-08 12:45 About the `cursor' property Xue Fuqiao
2013-03-08 13:05 ` Jambunathan K
@ 2013-03-08 14:15 ` Eli Zaretskii
1 sibling, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2013-03-08 14:15 UTC (permalink / raw)
To: help-gnu-emacs
> Date: Fri, 8 Mar 2013 20:45:47 +0800
> From: Xue Fuqiao <xfq.free@gmail.com>
>
> In (info "(elisp) Special Properties"), there is a `cursor' property.
>
> It says that:
>
> `cursor'
> Normally, the cursor is displayed at the beginning or the end of
> any overlay and text property strings present at the current
> buffer position. You can place the cursor on any desired
> character of these strings by giving that character a non-`nil'
> `cursor' text property. [...]
>
> I had read through this node, but I still didn't know how to use this
> property. I tried "(add-text-properties 1 5 '(cursor 2))" in
> *scratch*, but the cursor didn't move. Can anybody help? Thanks.
Look at cua-rect.el, there are some revealing examples of how to use
this feature, including setting the property to a numerical value
(which was introduced because cua-rect needed something like this).
In any case, putting this property on buffer text doesn't have any
effect, as Emacs only considers this property on display and overlay
strings. The fragment you cited from the manual explicitly speaks
about display and overlay strings, for that very reason.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-03-08 14:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-08 12:45 About the `cursor' property Xue Fuqiao
2013-03-08 13:05 ` Jambunathan K
2013-03-08 14:15 ` Eli Zaretskii
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).