emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Martin Pohlack <mp26@os.inf.tu-dresden.de>
To: Bastien <bastien.guerry@wikimedia.fr>
Cc: David Abrahams <dave@boostpro.com>, org-mode <emacs-orgmode@gnu.org>
Subject: Re: Backspacing into folded items
Date: Fri, 03 Sep 2010 10:06:38 +0200	[thread overview]
Message-ID: <4C80AC8E.8020002@os.inf.tu-dresden.de> (raw)
In-Reply-To: <87iq2ny9rk.fsf@gnu.org>

Hi Bastien

On 03.09.2010 02:02, Bastien wrote:
> Hi Martin,
>
> Martin Pohlack<mp26@os.inf.tu-dresden.de>  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

  reply	other threads:[~2010-09-03  8:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-25  9:22 Backspacing into folded items David Abrahams
2010-08-25 22:28 ` Martin Pohlack
2010-09-03  0:02   ` Bastien
2010-09-03  8:06     ` Martin Pohlack [this message]
2010-09-03 13:03       ` Bastien
2010-09-03 13:40   ` Andreas Röhler
2010-09-03 14:13     ` [Orgmode] " Lennart Borgman
2010-09-03 15:40       ` Andreas Röhler
2010-09-03 15:44       ` Samuel Wales
2010-09-03 21:21       ` [Orgmode] " Stefan Monnier
2010-09-03 21:31         ` Lennart Borgman
2010-09-04  8:42           ` Stefan Monnier

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.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C80AC8E.8020002@os.inf.tu-dresden.de \
    --to=mp26@os.inf.tu-dresden.de \
    --cc=bastien.guerry@wikimedia.fr \
    --cc=dave@boostpro.com \
    --cc=emacs-orgmode@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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).