[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] Backspacing into folded items
From: |
Martin Pohlack |
Subject: |
Re: [Orgmode] Backspacing into folded items |
Date: |
Fri, 03 Sep 2010 10:06:38 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100821 Thunderbird/3.1.2 |
Hi Bastien
On 03.09.2010 02:02, Bastien wrote:
Hi Martin,
Martin Pohlack<address@hidden> writes:
* You could add a modification hook to all hidden areas to unfold them
on modification, or
* You could set the read-only property for all hidden areas. This could
be setup at the same location where hiding is done.
I'm interested in testing both solutions, as I often delete hidden text
by accident as well.
Can you give more details on how to set this up?
These were just quick ideas, I have no working code here.
Let me quickly draft something up:
* If you want to go for the modification hook:
You could do something very similar to what I did here:
http://patchwork.newartisans.com/patch/31/
You would have to find all places again where the hidden property is
set. There you would also add the modification hook.
The hook would be the place to remove the hidden property again.
You might have to have some policy in there, for example, to only
uncover a single headline at a time etc. I am not sure if hidden
areas are merged and at what granularity the property is set.
Later, you might stumble upon code that tries to modify in hidden
areas under the hood and you don't want all the text to be uncovered
by such actions. You should then "bind inhibit-modification-hooks"
in these functions.
* If you want to go for the read-only property:
You would have to find all places where the hidden property for
regions is set or unset and also set or unset the read-only
property there.
In theory.
There may exist code that wants to modify text blocks that are
hidden. In this code, you would have to temporarily remove the
read-only property (not sure if there is a way to override it).
You may also get into trouble modifying text directly next to a
read-only area because of stickiness
(http://www.gnu.org/software/emacs/elisp/html_node/Sticky-Properties.html#Sticky-Properties).
I just found this in the manual, not sure if this is a problem in
practice.
HTH,
Martin
- Re: [Orgmode] Backspacing into folded items, Bastien, 2010/09/02
- Re: [Orgmode] Backspacing into folded items,
Martin Pohlack <=
- Re: [Orgmode] Backspacing into folded items, Andreas Röhler, 2010/09/03
- Re: [Orgmode] Backspacing into folded items, Lennart Borgman, 2010/09/03
- Re: [Orgmode] Backspacing into folded items, Andreas Röhler, 2010/09/03
- Re: [Orgmode] Backspacing into folded items, Samuel Wales, 2010/09/03
- Re: [Orgmode] Backspacing into folded items, Stefan Monnier, 2010/09/04
- Re: [Orgmode] Backspacing into folded items, Lennart Borgman, 2010/09/03
- Re: [Orgmode] Backspacing into folded items, Stefan Monnier, 2010/09/04