Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

A question about text-property stickiness

4 views
Skip to first unread message

Darren Hoo

unread,
Aug 13, 2010, 6:18:49 PM8/13/10
to help-gnu-emacs
Hi,

From elisp Manual:
The text properties `front-sticky' and `rear-nonsticky', when
used, take precedence over the default NONSTICKINESS specified in
`text-property-default-nonsticky'.

but the following snip seems not work for me:

(with-current-buffer (get-buffer-create "aaaaa")
(insert "a")
(save-excursion
(backward-char)
(let ((p (point)))
(setplist 'mycat '(face highlight rear-nonsticky nil))
(setq text-property-default-nonsticky '((category . t)))
(add-text-properties p (1+ p) '(category mycat))))
(insert-and-inherit "b"))

I expect "b" to be highlighted but it is not, why?

Stefan Monnier

unread,
Aug 16, 2010, 6:07:22 AM8/16/10
to
> From elisp Manual:
> The text properties `front-sticky' and `rear-nonsticky', when
> used, take precedence over the default NONSTICKINESS specified in
> `text-property-default-nonsticky'.

> but the following snip seems not work for me:

> (with-current-buffer (get-buffer-create "aaaaa")
> (insert "a")
> (save-excursion
> (backward-char)
> (let ((p (point)))
> (setplist 'mycat '(face highlight rear-nonsticky nil))

A nil property value is the same no property value at all (i.e. it's the
default). So it can't be used to "override" anything.


Stefan

0 new messages