From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: New text property: `inhibit-read-only' Date: Mon, 17 Nov 2014 11:20:31 +0100 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1416219694 28283 80.91.229.3 (17 Nov 2014 10:21:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 17 Nov 2014 10:21:34 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 17 11:21:28 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XqJR0-00019K-MK for ged-emacs-devel@m.gmane.org; Mon, 17 Nov 2014 11:21:26 +0100 Original-Received: from localhost ([::1]:47008 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqJR0-0007sz-9q for ged-emacs-devel@m.gmane.org; Mon, 17 Nov 2014 05:21:26 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqJQZ-0007li-8x for emacs-devel@gnu.org; Mon, 17 Nov 2014 05:21:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XqJQT-0003wh-VR for emacs-devel@gnu.org; Mon, 17 Nov 2014 05:20:59 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:51100) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqJQT-0003wH-GX for emacs-devel@gnu.org; Mon, 17 Nov 2014 05:20:53 -0500 Original-Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58] helo=stories.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1XqJQ8-0001Zx-A8; Mon, 17 Nov 2014 11:20:32 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEUxLi8UDg8HAgMNBwh9 c2Xc1q1ZPV4UAAACQ0lEQVQ4jV2UzXYaMQyFZXD2Np7sYabdjy0eYAB5TxP7/V+lVzIEWp0scvzN 1b+gQGZxmBf3+O/5MixUubDaE4TxXZp6v8wwIAA4Mw8upo/eb/MgBrz0JtTc2nvf6fvCeYDa1e7T AAv+FETyfZjyg3l6AOk/1gYoTInjVF+gb0S7RbMCCO8Aoq1o8JTzf6ALElBFjr69I5E90iItf2rv 4cXvDGhiIvJ634pWSLwCEIlarebpYC0ZxbsYxJsOvYnziRSkHFnLpM1aIBu+VZAC+q0pWG9abaIO ABht33NiCDNitCYOIRNlnogS6oRiGmnpfBIUK4UUAZwbZQLUpgqN7lB/aI/K0e0tEx5zIodWPqeC vPstUoZzJpd/5ogKWyVHaXWardb+VFTx/qIt0Z3b/Fsft/XzAsVYRXl1vm2xAmR99vLveKtDr1wI tL05wgodWyZb1fDMqIttyvmuo2XOYTRchIKCud7YFFFTQicSz0eAy7HvzRWGVBs6ze4wLwDXj8Y6 c11FcczlfCvzSRX1G8ug797OpWQM+2gJ7MpC9v2GOVl65Vdv2O2CGOiqbHE8M8+/+x8EXBJTJqyF gaKH8dm/Jmn5AFdk98dLwTLN80f/OvnGu8XSjSZRgNjXeWq2ojir+IhRFOzmtR4UFEhMpp5OemvH iq22FSVsiOUEBdwc6xUKnGHYO4A4XN2XB4Bij4k4XWDmc79DITdeRnfLKellJfw0XBXcE2Jwxsbl bElHgIVXEb0PpF90WGmAfeHstxT/AiT/zy9yz+OlAAAAAElFTkSuQmCC X-Now-Playing: The Cure's _The Head On The Door_: "The Blood" X-Hashcash: 1:23:141117:monnier@iro.umontreal.ca::iVIj/OjDekKYH+Jg:000000000000000000000000000000000000075xt X-Hashcash: 1:23:141117:emacs-devel@gnu.org::n8x2VH5XskjH2EG1:000000000000000000000000000000000000000000Eu8V In-Reply-To: (Stefan Monnier's message of "Sun, 16 Nov 2014 23:30:14 -0500") User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux) X-MailScanner-ID: 1XqJQ8-0001Zx-A8 MailScanner-NULL-Check: 1416824432.71439@B4DpzSKWioMCuXnhbh5gQw X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.224.195 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:177395 Archived-At: Stefan Monnier 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 #) signal(text-read-only (#)) 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