Making @shadow files readonly

1 view
Skip to first unread message

Ville M. Vainio

unread,
Sep 5, 2008, 4:08:54 PM9/5/08
to leo-e...@googlegroups.com
I was wondering, is it possible to prevent "save" operation of leo
document from writing out modified @shadow files nodes? I'm using
@shadow to get a "view" to a source tree that is edited elsewhere (c++
ide), and don't want my random ctrl+s pressing to cause false version
control "positives" or worse, causing my accidental edits in leo to
overwrite "valuable" changes I've made elsewhere.

BTW, I think we should prevent shadow files from accidentally
overwriting valuable stuff:

- Store modification time of the file on shadow import
- When you "save", check if modification time has changed and ask the
user if they really want to overwrite the changes. Or, reuse to do it
altogether and require explicit save-at-shadow-nodes in those
occasions. That's considered "good form" in editors in general, and
since pressing ctrl+S in leo has even more significant implications we
should be absolutely certain everything happens safely.

--
Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'

Edward K. Ream

unread,
Sep 6, 2008, 10:12:42 AM9/6/08
to leo-e...@googlegroups.com
On Fri, Sep 5, 2008 at 3:08 PM, Ville M. Vainio <viva...@gmail.com> wrote:
>
> I was wondering, is it possible to prevent "save" operation of leo
> document from writing out modified @shadow files nodes?

Sure. Just add @ignore at to the top-level @shadow node. Works for
other kinds of @file nodes as well.

> BTW, I think we should prevent shadow files from accidentally
> overwriting valuable stuff:
>
> - Store modification time of the file on shadow import
> - When you "save", check if modification time has changed and ask the
> user if they really want to overwrite the changes. Or, reuse to do it
> altogether and require explicit save-at-shadow-nodes in those
> occasions. That's considered "good form" in editors in general, and
> since pressing ctrl+S in leo has even more significant implications we
> should be absolutely certain everything happens safely.

Interesting. I hadn't thought of this parallel, but it seems
reasonable to me. I'll consider it, as a user option, for Leo 4.5.2.

Edward

Edward K. Ream

unread,
Sep 6, 2008, 10:26:47 AM9/6/08
to leo-editor


On Sep 5, 3:08 pm, "Ville M. Vainio" <vivai...@gmail.com> wrote:

> BTW, I think we should prevent shadow files from accidentally
> overwriting valuable stuff:

I suppose similar remarks apply to @auto nodes as well...

Edward
Reply all
Reply to author
Forward
0 new messages