From: Lars Magne Ingebrigtsen <larsi@gnus.org>
To: emacs-devel@gnu.org
Subject: New text property: `inhibit-read-only'
Date: Sun, 16 Nov 2014 23:45:30 +0100 [thread overview]
Message-ID: <m34mtyix2t.fsf@stories.gnus.org> (raw)
As previously discussed (like a year or two ago), we have certain modes
that basically have read-only buffers, but that need certain bits to be
writable.
eww is one of them -- we need to write things into search fields and the
like.
So I've just implemented an `inhibit-read-only' text property and pushed
it. I'm sure there are cases that I haven't covered yet, so please give
it a whirl and let me know where I forgot to add checks.
This is a test snippet:
(progn
(pop-to-buffer "*test*")
(insert "This is a test This is a test\nThis is a test This is a test")
(put-text-property 10 20 'inhibit-read-only t)
(put-text-property 10 20 'face '(:background "red"))
(setq buffer-read-only t))
The red text should be editable.
Commands like `C-k' and stuff don't really work in this particular
scenario, but I don't things that's necessarily a bug.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
next reply other threads:[~2014-11-16 22:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-16 22:45 Lars Magne Ingebrigtsen [this message]
2014-11-17 4:30 ` New text property: `inhibit-read-only' Stefan Monnier
2014-11-17 7:47 ` Lars Brinkhoff
2014-11-17 10:20 ` Lars Magne Ingebrigtsen
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m34mtyix2t.fsf@stories.gnus.org \
--to=larsi@gnus.org \
--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 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).