From: Joost Kremers <joost.m.kremers@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: insertion in read-only buffer
Date: 27 Sep 2016 08:54:12 GMT [thread overview]
Message-ID: <e4uqdjF2qi3U1@mid.individual.net> (raw)
Hi all,
I'm wondering if there's a way to specify a position in a read-only
buffer where text can be entered, regardless of the buffer's read-only
status. I know about the variable `inhibit-read-only' and the
`inhibit-read-only' text property, but IIUC these won't allow me to do
what I want, which is to allow the user to freely move around in a
read-only buffer and have particular positions in the buffer (indicated
by specific markup tags, which are part of the file) where text can be
entered.
So suppose my buffer contains the following text, with | indicating point:
,----
| Lorem ipsum dolor sit amet, consectetur {++|++} adipiscing elit, sed do
| eiusmod tempor incididunt ut labore et dolore magna aliqua.
`----
then at *this* particular cursor position, I want to be able to enter
text. If I move the cursor anywhere else, the text should be read-only.
The problem with using text properties (or fields, which I also looked
at) is that before text is actually inserted, there is no character to
put a text property on.
I'd be grateful for any suggestions.
--
Joost Kremers joostkremers@fastmail.fm
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)
reply other threads:[~2016-09-27 8:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=e4uqdjF2qi3U1@mid.individual.net \
--to=joost.m.kremers@gmail.com \
--cc=help-gnu-emacs@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.
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).