I would like the whole intangible text to be deleted by delete-char and backward-delete-char. Any easy way?
(put-text-property (point-at-bol) (point-at-eol) 'intangible t)
kill-word and backward-kill-word will delete the intangible text, and I’d like the *-char commands to do the same.
In the user interface I am building, some critical text is invisible and intangible. So when user presses DEL (C-d) just after (before) the hidden, intangible text, the whole text should disappear.
Thanks!
Using an Emacs without any initialization files, and the
(put-text...code you provided, I can delete characters at the beginning of the line with M-x delete-char (C-d), and delete characters at the end of the line with M-x backward-delete-char (DEL (well, that’s reallydelete-backward-char)).Edited upon clarification of question:
These two pieces of advice will delete the entire intangible region:
The advice checks to ensure that the command is being called with an argument of 1, and only then will delete the entire intangible region, otherwise it behaves as normal.