From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
To: emacs-devel@gnu.org
Subject: text_property_stickiness() ignores `text-property-default-nonsticky'
Date: Mon, 04 Jul 2011 03:56:25 +0400 [thread overview]
Message-ID: <87aacuq5p2.fsf@gmail.com> (raw)
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
next reply other threads:[~2011-07-03 23:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-03 23:56 Dmitry Kurochkin [this message]
2011-07-04 16:53 ` text_property_stickiness() ignores `text-property-default-nonsticky' Stefan Monnier
2011-07-05 2:15 ` Dmitry Kurochkin
2011-07-05 3:50 ` Stefan Monnier
2011-07-05 4:13 ` Dmitry Kurochkin
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=87aacuq5p2.fsf@gmail.com \
--to=dmitry.kurochkin@gmail.com \
--cc=emacs-devel@gnu.org \
/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.