unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* text_property_stickiness() ignores `text-property-default-nonsticky'
@ 2011-07-03 23:56 Dmitry Kurochkin
  2011-07-04 16:53 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Kurochkin @ 2011-07-03 23:56 UTC (permalink / raw)
  To: emacs-devel

Hello.

I am trying to make `keymap' property rear-nonsticky, so that it does
not affect the next character after the region the property is applied
to.  If I do it by setting rear-nonsticky text property to 't or to a
list that contains 'keymap, it works fine:

  (let ((map (make-sparse-keymap)))
    (define-key map (kbd "RET") 'bug)
    (switch-to-buffer "test")
    (insert "123456")
    (put-text-property 1 4 'keymap map)
    (put-text-property (point-min) (point-max) 'rear-nonsticky '(keymap))
    (goto-char 4)
    (message "keymap: %s" (get-text-property (point) 'keymap))
    (message "key-binding: %s" (key-binding (kbd "RET"))))

But if I set `text-property-default-nonsticky' variable instead, it does
not work:

  (let ((map (make-sparse-keymap)))
    (define-key map (kbd "RET") 'bug)
    (switch-to-buffer "test")
    (insert "123456")
    (put-text-property 1 4 'keymap map)
    (make-local-variable 'text-property-default-nonsticky)
    (add-to-list 'text-property-default-nonsticky '(keymap . t))
    (goto-char 4)
    (message "keymap: %s" (get-text-property (point) 'keymap))
    (message "key-binding: %s" (key-binding (kbd "RET"))))

Looking through the code, I got down to text_property_stickiness()
function in src/textprop.c, which is used by get_pos_property(), which
is used by get_local_map().  There are checks for `front-sticky' and
`rear-nonsticky' properties, but no checks for
`text-property-default-nonsticky' variable.  Before opening false bug
reports, I would like to confirm that this is an issue indeed, and it is
not me doing something stupid.

Regards,
  Dmitry



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

end of thread, other threads:[~2011-07-05  4:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-03 23:56 text_property_stickiness() ignores `text-property-default-nonsticky' Dmitry Kurochkin
2011-07-04 16:53 ` Stefan Monnier
2011-07-05  2:15   ` Dmitry Kurochkin
2011-07-05  3:50     ` Stefan Monnier
2011-07-05  4:13       ` Dmitry Kurochkin

Code repositories for project(s) associated with this public inbox

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

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).