From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcin Borkowski Subject: bug#6922: 23.1; Setting read-only property in an overlay has no effect Date: Thu, 18 Feb 2016 06:12:42 +0100 Message-ID: <87h9h6zjn9.fsf@mbork.pl> References: <1282834016.22363.1391876553@webmail.messagingengine.com> <87wpr67ezy.fsf@mbork.pl> <837fj49lni.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Sender: "Debbugs-submit" Resent-Message-ID: In-reply-to: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org To: John Wiegley Cc: Richard Stallman , 6922@debbugs.gnu.org, emacs-devel , Org-Mode mailing list , mt_void@warpmail.net List-Id: emacs-orgmode.gnu.org On 2016-02-07, at 23:24, John Wiegley wrote: >>>>>> Eli Zaretskii writes: > >> What is the current consensus? should we adjust the documentation or fix the >> code? John? Richard? > > I think read-only overlays could be very useful. For example: > > 1. Create a command called `mask-regexp'. It creates read-only overlays for > matching text throughout the buffer. > 2. There should also be a way to add manual masks, using `mask-region'. > 3. Now use `replace-string' or any other command to bulk transform text. > However, masked text is not changed. > 4. Then execute unmask-all, and the mask disappears. > > This method of editing is key to video editing workflows. I think the only > reason I never thought to use it in Emacs is because it's never been there > (and so never occurred to me until now). Hi, I just realized that this idea could be /extremely/ useful. Here's the case: I start a clock in Org-mode (C-c C-x C-i), and an entry with the starting time is added in the :LOGBOOK: drawer (and btw, it is invisible). While working on the file, I hit C-/ (undo) once too many, and the entry disappears (and this fact is still invisible to me!). Then, after some more work, I stop the clock only to see "org-clock-out: Clock start time is gone", and my clock is still going on (!). While the last thing (about the clock still going on) is probably an Org-mode bug (I'll propbably report it later "officially", I'm now Cc-ing this message to the Org-mode ML), the whole experience (and yes, it happened to me) is /very/ confusing. When read-only properties and masking are here, Org could just mark the half-done entry as read-only. I suspect that trying to undo it would perhaps trigger some error, which could be confusing, but it would be still better than silently removing a vital information. Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University