all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* A question about text-property stickiness
@ 2010-08-13 22:18 Darren Hoo
  0 siblings, 0 replies; 2+ messages in thread
From: Darren Hoo @ 2010-08-13 22:18 UTC (permalink / raw)
  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?



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: A question about text-property stickiness
       [not found] <mailman.3.1281766374.27799.help-gnu-emacs@gnu.org>
@ 2010-08-16 10:07 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2010-08-16 10:07 UTC (permalink / raw)
  To: help-gnu-emacs

> 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-16 10:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-13 22:18 A question about text-property stickiness Darren Hoo
     [not found] <mailman.3.1281766374.27799.help-gnu-emacs@gnu.org>
2010-08-16 10:07 ` Stefan Monnier

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.