[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New text property: `inhibit-read-only'
From: |
Lars Magne Ingebrigtsen |
Subject: |
Re: New text property: `inhibit-read-only' |
Date: |
Mon, 17 Nov 2014 11:20:31 +0100 |
User-agent: |
Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
> What is different that the solution used in Custom buffers can't be used
> or doesn't work well in eww?
Custom buffers uses a bewildering number of hooks, bindings and
... mysteries to achieve this pretty trivial thing. It binds all
inserting commands to `Custom-no-edit' (and then has an overlay over the
text input bits that has a different keymap).
To inhibit deletions, it uses
(add-hook 'before-change-functions 'widget-before-change nil t)
that checks stuff in some contexts
Debugger entered--Lisp error: (text-read-only "Attempt to change text outside
editable field")
signal(text-read-only ("Attempt to change text outside editable field"))
widget-before-change(3 6)
delete-region(3 6)
Hm. After that backtrace I'm now able to delete text in the Custom
buffer.
Anyway, with a new buffer `C-k' again fails as it should with
Debugger entered--Lisp error: (text-read-only #<buffer *Customize Apropos*>)
signal(text-read-only (#<buffer *Customize Apropos*>))
kill-region(124 126 region)
but I'm not quite sure how that's set up.
And and.
It just seems ridiculous to me that all modes that need this simple
thing (a read-only buffer with some bits that are editable) would have
to jump through all these vaguely defined hoops.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no