emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-indent-mode corrupted most of a big org file
@ 2013-12-02 11:21 Rainer Stengele
  2013-12-02 11:31 ` Sebastien Vauban
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Rainer Stengele @ 2013-12-02 11:21 UTC (permalink / raw)
  To: emacs-orgmode

All,

last week I played around with org-indent-mode in my biggest (37.000 lines) org file.
3 days later I detected that most of the file was corrupted.
WHy so late? Using the agenda I only saw the todos and did not recognise the corrupted structures.
Most "*" items had been placed at the beginning of the line and therefore now became headlines.
I do not know how this happened. I am not sure if I myself was the reason somehow.
Anyway I had to spend a fair amount of work to get the old file format from
subversion and insert the changes since the corruption.

This is just a warning to have backups at hand before changing to org-indent mode.
Then immediately and check often the contents of the file until you are sure all is running well.

Maybe someone has an idea.

I will try to convert again later but then be much more careful.

Rainer

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: org-indent-mode corrupted most of a big org file
  2013-12-02 11:21 org-indent-mode corrupted most of a big org file Rainer Stengele
@ 2013-12-02 11:31 ` Sebastien Vauban
  2013-12-02 12:06   ` Carsten Dominik
  2013-12-02 15:37 ` Alexander Baier
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 21+ messages in thread
From: Sebastien Vauban @ 2013-12-02 11:31 UTC (permalink / raw)
  To: Rainer Stengele; +Cc: emacs-orgmode-mXXj517/zsQ

Rainer Stengele wrote:
> last week I played around with org-indent-mode in my biggest (37.000 lines) org file.
> 3 days later I detected that most of the file was corrupted.
> WHy so late? Using the agenda I only saw the todos and did not recognise the corrupted structures.
> Most "*" items had been placed at the beginning of the line and therefore now became headlines.
> I do not know how this happened. I am not sure if I myself was the reason somehow.
> Anyway I had to spend a fair amount of work to get the old file format from
> subversion and insert the changes since the corruption.
>
> This is just a warning to have backups at hand before changing to org-indent mode.
> Then immediately and check often the contents of the file until you are sure all is running well.
>
> Maybe someone has an idea.
>
> I will try to convert again later but then be much more careful.

Last week, I also "lost" contents in the file I worked a lot in (R code,
published to slides). In fact, I did not really lose it, thanks to SVN...

That seems to have been a nasty bug in the caching. I should be fixed AFAICT.
But, yes, this can always happen. Better to have fallback mechanisms when it
occurs -- even if we've to admit it is very, very seldsom, and only with the
dev trunk.

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: org-indent-mode corrupted most of a big org file
  2013-12-02 11:31 ` Sebastien Vauban
@ 2013-12-02 12:06   ` Carsten Dominik
  0 siblings, 0 replies; 21+ messages in thread
From: Carsten Dominik @ 2013-12-02 12:06 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: Rainer Stengele, emacs-orgmode


On Dec 2, 2013, at 12:31 PM, Sebastien Vauban <sva-news@mygooglest.com> wrote:

> Rainer Stengele wrote:
>> last week I played around with org-indent-mode in my biggest (37.000 lines) org file.
>> 3 days later I detected that most of the file was corrupted.
>> WHy so late? Using the agenda I only saw the todos and did not recognise the corrupted structures.
>> Most "*" items had been placed at the beginning of the line and therefore now became headlines.
>> I do not know how this happened. I am not sure if I myself was the reason somehow.
>> Anyway I had to spend a fair amount of work to get the old file format from
>> subversion and insert the changes since the corruption.
>> 
>> This is just a warning to have backups at hand before changing to org-indent mode.
>> Then immediately and check often the contents of the file until you are sure all is running well.
>> 
>> Maybe someone has an idea.
>> 
>> I will try to convert again later but then be much more careful.
> 
> Last week, I also "lost" contents in the file I worked a lot in (R code,
> published to slides). In fact, I did not really lose it, thanks to SVN...
> 
> That seems to have been a nasty bug in the caching. I should be fixed AFAICT.
> But, yes, this can always happen. Better to have fallback mechanisms when it
> occurs -- even if we've to admit it is very, very seldsom, and only with the
> dev trunk.

This is great advice, in particular while testing fundamental changes like the caching mechanism.  git-up everybody!

- Carsten

> 
> Best regards,
>  Seb
> 
> -- 
> Sebastien Vauban
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: org-indent-mode corrupted most of a big org file
  2013-12-02 11:21 org-indent-mode corrupted most of a big org file Rainer Stengele
  2013-12-02 11:31 ` Sebastien Vauban
@ 2013-12-02 15:37 ` Alexander Baier
  2013-12-02 19:11   ` Nicolas Richard
  2013-12-03  8:33   ` Johann Spies
  2013-12-04  8:25 ` Nicolas Goaziou
  2013-12-12 14:48 ` Rainer Stengele
  3 siblings, 2 replies; 21+ messages in thread
From: Alexander Baier @ 2013-12-02 15:37 UTC (permalink / raw)
  To: Rainer Stengele; +Cc: emacs-orgmode

On 13-12-02 12:21 Rainer Stengele wrote:
> All,
>
> last week I played around with org-indent-mode in my biggest (37.000 lines) org file.
> 3 days later I detected that most of the file was corrupted.
> WHy so late? Using the agenda I only saw the todos and did not recognise the corrupted structures.
> Most "*" items had been placed at the beginning of the line and therefore now became headlines.
> I do not know how this happened. I am not sure if I myself was the reason somehow.
> Anyway I had to spend a fair amount of work to get the old file format from
> subversion and insert the changes since the corruption.
>
> This is just a warning to have backups at hand before changing to org-indent mode.
> Then immediately and check often the contents of the file until you are sure all is running well.
>
> Maybe someone has an idea.
>
> I will try to convert again later but then be much more careful.
>
> Rainer
>
>

FWIW, I have the following snippet in my init file, that uses emacs'
build-in backup machanism to save me from such things.  As emacs stuffs
them all in one central location, I do not have to worry about polluting
my filesystem.

#+begin_src emacs-lisp
  (setq make-backup-files t)
  (setq backup-directory-alist '(("/home/delexi/*" . "/home/delexi/.emacs.d/backup")))
  (setq backup-by-copying t      ; don't use symlinks
        delete-old-versions t    ; don't ask me about deleting backups
        kept-new-versions 20
        kept-old-versions 5
        version-control t)       ; use versioned backups
#+end_src

If you want to make backups from files under version control, you also
have to set the following:

#+begin_src emacs-lisp
  (setq vc-make-backup-files t)
#+end_src

This already saved me a couple of times.

Regards,
-- 
 Alexander Baier

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: org-indent-mode corrupted most of a big org file
  2013-12-02 15:37 ` Alexander Baier
@ 2013-12-02 19:11   ` Nicolas Richard
  2013-12-03  8:33   ` Johann Spies
  1 sibling, 0 replies; 21+ messages in thread
From: Nicolas Richard @ 2013-12-02 19:11 UTC (permalink / raw)
  To: Rainer Stengele; +Cc: emacs-orgmode

Alexander Baier <lexi.baier@gmail.com> writes:
>   (setq backup-by-copying t      ; don't use symlinks

Thanks for sharing your setup, I think I'll use a similar one. Just a
comment though on the above line : that comment is misleading because
emacs is not going to make a backup by making a symlink anyway. (the
full story is in the docstring.)

Nico.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: org-indent-mode corrupted most of a big org file
  2013-12-02 15:37 ` Alexander Baier
  2013-12-02 19:11   ` Nicolas Richard
@ 2013-12-03  8:33   ` Johann Spies
  2013-12-03 12:58     ` Alexander Baier
  1 sibling, 1 reply; 21+ messages in thread
From: Johann Spies @ 2013-12-03  8:33 UTC (permalink / raw)
  To: Rainer Stengele, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2607 bytes --]

Thanks for sharing this. However, after adding this to my ~/.emacs I do not
see anything appearing in my .emacs.d/backup directory.

#+begin_src emacs-lisp
  (setq make-backup-files t)
  (setq backup-directory-alist '(("/home/js/*" . "/home/js/.emacs.d/backup")))
  (setq backup-by-copying t      ; don't use symlinks
        delete-old-versions t    ; don't ask me about deleting backups
        kept-new-versions 20
        kept-old-versions 5
        version-control t)       ; use versioned backups
#+end_src



Regards
Johann


On 2 December 2013 17:37, Alexander Baier <lexi.baier@gmail.com> wrote:

> On 13-12-02 12:21 Rainer Stengele wrote:
> > All,
> >
> > last week I played around with org-indent-mode in my biggest (37.000
> lines) org file.
> > 3 days later I detected that most of the file was corrupted.
> > WHy so late? Using the agenda I only saw the todos and did not recognise
> the corrupted structures.
> > Most "*" items had been placed at the beginning of the line and
> therefore now became headlines.
> > I do not know how this happened. I am not sure if I myself was the
> reason somehow.
> > Anyway I had to spend a fair amount of work to get the old file format
> from
> > subversion and insert the changes since the corruption.
> >
> > This is just a warning to have backups at hand before changing to
> org-indent mode.
> > Then immediately and check often the contents of the file until you are
> sure all is running well.
> >
> > Maybe someone has an idea.
> >
> > I will try to convert again later but then be much more careful.
> >
> > Rainer
> >
> >
>
> FWIW, I have the following snippet in my init file, that uses emacs'
> build-in backup machanism to save me from such things.  As emacs stuffs
> them all in one central location, I do not have to worry about polluting
> my filesystem.
>
> #+begin_src emacs-lisp
>   (setq make-backup-files t)
>   (setq backup-directory-alist '(("/home/delexi/*" .
> "/home/delexi/.emacs.d/backup")))
>   (setq backup-by-copying t      ; don't use symlinks
>         delete-old-versions t    ; don't ask me about deleting backups
>         kept-new-versions 20
>         kept-old-versions 5
>         version-control t)       ; use versioned backups
> #+end_src
>
> If you want to make backups from files under version control, you also
> have to set the following:
>
> #+begin_src emacs-lisp
>   (setq vc-make-backup-files t)
> #+end_src
>
> This already saved me a couple of times.
>
> Regards,
> --
>  Alexander Baier
>
>


-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

[-- Attachment #2: Type: text/html, Size: 3366 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: org-indent-mode corrupted most of a big org file
  2013-12-03  8:33   ` Johann Spies
@ 2013-12-03 12:58     ` Alexander Baier
  2013-12-03 17:23       ` Johann Spies
  2013-12-06 14:41       ` org-indent-mode corrupted most of a big org file Johann Spies
  0 siblings, 2 replies; 21+ messages in thread
From: Alexander Baier @ 2013-12-03 12:58 UTC (permalink / raw)
  To: Johann Spies; +Cc: Rainer Stengele, emacs-orgmode

Hello Johann,

that is strange.  I cannot remember doing something else besides putting
the mentioned code into my init file.  I can only think of these
"trivial" reason why this does not work for you:

- Did you evaluate the code or restarted your emacs?
- Are the files you are editing somewhere under /home/js/?
- Did you really edit and save a file since adding the code to your init
  file?
- In case you are editing files under version control: Did you turn on
  vc-make-backup-files?
  
HTH,
-- 
 Alexander Baier

On 13-12-03 09:33 Johann Spies wrote:
> Thanks for sharing this. However, after adding this to my ~/.emacs I do not
> see anything appearing in my .emacs.d/backup directory.
>
> #+begin_src emacs-lisp
>   (setq make-backup-files t)
>   (setq backup-directory-alist '(("/home/js/*" . "/home/js/.emacs.d/backup")))
>   (setq backup-by-copying t      ; don't use symlinks
>         delete-old-versions t    ; don't ask me about deleting backups
>         kept-new-versions 20
>         kept-old-versions 5
>         version-control t)       ; use versioned backups
> #+end_src
>
>
>
> Regards
> Johann
>
>
> On 2 December 2013 17:37, Alexander Baier <lexi.baier@gmail.com> wrote:
>
>> On 13-12-02 12:21 Rainer Stengele wrote:
>> > All,
>> >
>> > last week I played around with org-indent-mode in my biggest (37.000
>> lines) org file.
>> > 3 days later I detected that most of the file was corrupted.
>> > WHy so late? Using the agenda I only saw the todos and did not recognise
>> the corrupted structures.
>> > Most "*" items had been placed at the beginning of the line and
>> therefore now became headlines.
>> > I do not know how this happened. I am not sure if I myself was the
>> reason somehow.
>> > Anyway I had to spend a fair amount of work to get the old file format
>> from
>> > subversion and insert the changes since the corruption.
>> >
>> > This is just a warning to have backups at hand before changing to
>> org-indent mode.
>> > Then immediately and check often the contents of the file until you are
>> sure all is running well.
>> >
>> > Maybe someone has an idea.
>> >
>> > I will try to convert again later but then be much more careful.
>> >
>> > Rainer
>> >
>> >
>>
>> FWIW, I have the following snippet in my init file, that uses emacs'
>> build-in backup machanism to save me from such things.  As emacs stuffs
>> them all in one central location, I do not have to worry about polluting
>> my filesystem.
>>
>> #+begin_src emacs-lisp
>>   (setq make-backup-files t)
>>   (setq backup-directory-alist '(("/home/delexi/*" .
>> "/home/delexi/.emacs.d/backup")))
>>   (setq backup-by-copying t      ; don't use symlinks
>>         delete-old-versions t    ; don't ask me about deleting backups
>>         kept-new-versions 20
>>         kept-old-versions 5
>>         version-control t)       ; use versioned backups
>> #+end_src
>>
>> If you want to make backups from files under version control, you also
>> have to set the following:
>>
>> #+begin_src emacs-lisp
>>   (setq vc-make-backup-files t)
>> #+end_src
>>
>> This already saved me a couple of times.
>>
>> Regards,
>> --
>>  Alexander Baier
>>
>>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: org-indent-mode corrupted most of a big org file
  2013-12-03 12:58     ` Alexander Baier
@ 2013-12-03 17:23       ` Johann Spies
  2013-12-03 17:37         ` Alexander Baier
                           ` (2 more replies)
  2013-12-06 14:41       ` org-indent-mode corrupted most of a big org file Johann Spies
  1 sibling, 3 replies; 21+ messages in thread
From: Johann Spies @ 2013-12-03 17:23 UTC (permalink / raw)
  To: Rainer Stengele, emacs-orgmode

Hello Alexander,

Thanks for your attention.
>
> that is strange.  I cannot remember doing something else besides putting
> the mentioned code into my init file.  I can only think of these
> "trivial" reason why this does not work for you:
>
> - Did you evaluate the code or restarted your emacs?

Yes, I killed emacs (daemon) and restarted it.  How do you evaluate 
(reload) ~/.emacs from emacs running?

> - Are the files you are editing somewhere under /home/js/?

Yes: in /home/js/DropBox/orgmode  and then /home/js/.emacs

> - Did you really edit and save a file since adding the code to your init
>    file?
Yes

> - In case you are editing files under version control: Did you turn on
>    vc-make-backup-files?

None of those files are under version control.

I have done this on two computers - at work (the earlier message) and home.

Regards
Johann


-- 
J.H. Spies - Tel. 021-982 2694 / 082 782 0336 / 021-808 4699(w)
              Posbus 4668, Tygervallei 7536

      "Submit yourselves therefore to God. Resist the devil,
       and he will flee from you."          James 4:7

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: org-indent-mode corrupted most of a big org file
  2013-12-03 17:23       ` Johann Spies
@ 2013-12-03 17:37         ` Alexander Baier
  2013-12-03 17:43         ` Nick Dokos
  2013-12-03 18:15         ` org-indent-mode corrupted most of a big org file (solved backups) Johann Spies
  2 siblings, 0 replies; 21+ messages in thread
From: Alexander Baier @ 2013-12-03 17:37 UTC (permalink / raw)
  To: Johann Spies; +Cc: Rainer Stengele, emacs-orgmode

Hello Johann,

On 13-12-03 18:23 Johann Spies wrote:
> Hello Alexander,
>
> Thanks for your attention.
>>
>> that is strange.  I cannot remember doing something else besides putting
>> the mentioned code into my init file.  I can only think of these
>> "trivial" reason why this does not work for you:
>>
>> - Did you evaluate the code or restarted your emacs?
>
> Yes, I killed emacs (daemon) and restarted it.  How do you evaluate
> (reload) ~/.emacs from emacs running?
>

There are several ways of doing this.  You can open your ~/.emacs and
simply do M-x eval-buffer RET.  But it would also be sufficient to just
evaluate the newly added sexp, e.g. by marking them and calling M-x
eval-region.


[...]

> I have done this on two computers - at work (the earlier message) and home.

Than I am out of ideas.  You could take a look at the manual yourself
and see, if we missed something: (info "(Emacs) Backup").

(In case you do not know how to open the manual based on the expression
above: Place your curser after the ')' closing the info expression and
press `C-x C-e'.)

Regards,
-- 
 Alexander Baier

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: org-indent-mode corrupted most of a big org file
  2013-12-03 17:23       ` Johann Spies
  2013-12-03 17:37         ` Alexander Baier
@ 2013-12-03 17:43         ` Nick Dokos
  2013-12-03 17:53           ` Alexander Baier
  2013-12-03 18:15         ` org-indent-mode corrupted most of a big org file (solved backups) Johann Spies
  2 siblings, 1 reply; 21+ messages in thread
From: Nick Dokos @ 2013-12-03 17:43 UTC (permalink / raw)
  To: emacs-orgmode

Johann Spies <johann.spies@gmail.com> writes:

> Hello Alexander,
>
> Thanks for your attention.
>>
>> that is strange.  I cannot remember doing something else besides putting
>> the mentioned code into my init file.  I can only think of these
>> "trivial" reason why this does not work for you:
>>
>> - Did you evaluate the code or restarted your emacs?
>
> Yes, I killed emacs (daemon) and restarted it.  How do you evaluate
> (reload) ~/.emacs from emacs running?
>
>> - Are the files you are editing somewhere under /home/js/?
>
> Yes: in /home/js/DropBox/orgmode  and then /home/js/.emacs
>
>> - Did you really edit and save a file since adding the code to your init
>>    file?
> Yes
>
>> - In case you are editing files under version control: Did you turn on
>>    vc-make-backup-files?
>
> None of those files are under version control.
>
> I have done this on two computers - at work (the earlier message) and home.
>

The docstring for backup-directory-alist says

,----
| For the common case of all backups going into one directory, the alist
| should contain a single element pairing "." with the appropriate
| directory name.
`----

FWIW, I tried

 (setq backup-directory-alist '(("." . "/home/nick/.emacs.d/backup-dir")))

and it seems to work. I don't remember if I had to create the backup-dir
beforehand.

Nick

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: org-indent-mode corrupted most of a big org file
  2013-12-03 17:43         ` Nick Dokos
@ 2013-12-03 17:53           ` Alexander Baier
  2013-12-03 18:30             ` Nick Dokos
  0 siblings, 1 reply; 21+ messages in thread
From: Alexander Baier @ 2013-12-03 17:53 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

Hello Nick,

On 13-12-03 18:43 Nick Dokos wrote:
[...]
>
> The docstring for backup-directory-alist says
>
> ,----
> | For the common case of all backups going into one directory, the alist
> | should contain a single element pairing "." with the appropriate
> | directory name.
> `----
>
> FWIW, I tried
>
>  (setq backup-directory-alist '(("." . "/home/nick/.emacs.d/backup-dir")))
>
> and it seems to work. I don't remember if I had to create the backup-dir
> beforehand.
>
> Nick
>

I used to set up backup-directory-alist the same way you have, but
changed it, when I noticed emacs putting backups of files I edited as
root into that directory.  That was something I did not want to do.

Regards,
-- 
 Alexander Baier

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: org-indent-mode corrupted most of a big org file (solved backups)
  2013-12-03 17:23       ` Johann Spies
  2013-12-03 17:37         ` Alexander Baier
  2013-12-03 17:43         ` Nick Dokos
@ 2013-12-03 18:15         ` Johann Spies
  2 siblings, 0 replies; 21+ messages in thread
From: Johann Spies @ 2013-12-03 18:15 UTC (permalink / raw)
  To: Rainer Stengele, emacs-orgmode

After reading a little bit about emacs backup functions I experimented 
with customising emacs using the 'options' menu and succeeded in getting 
the type of backups you were talking about.

It looks similar to yours (I even tried a version from the emacs 
backup-wiki without success) and I don't know why it did not work 
previously.

Anyhow thanks again for your pointer.

Regards
Johann


-- 
J.H. Spies - Tel. 021-982 2694 / 082 782 0336 / 021-808 4699(w)
              Posbus 4668, Tygervallei 7536

      "Submit yourselves therefore to God. Resist the devil,
       and he will flee from you."          James 4:7

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: org-indent-mode corrupted most of a big org file
  2013-12-03 17:53           ` Alexander Baier
@ 2013-12-03 18:30             ` Nick Dokos
  2013-12-03 19:29               ` Sebastien Vauban
  2013-12-04  9:43               ` Alexander Baier
  0 siblings, 2 replies; 21+ messages in thread
From: Nick Dokos @ 2013-12-03 18:30 UTC (permalink / raw)
  To: emacs-orgmode

Alexander Baier <lexi.baier@gmail.com> writes:


> I used to set up backup-directory-alist the same way you have, but
> changed it, when I noticed emacs putting backups of files I edited as
> root into that directory.  That was something I did not want to do.
>

OK - I haven't lived with this setup long enough to know better.

On another subject:

>   (setq backup-directory-alist 
>             '(("/home/delexi/*" . "/home/delexi/.emacs.d/backup")))

the docstring says that the car of each dotted pair in the alist is a
regexp: I presume an emacs regexp, not a shell glob pattern. So the
setting should be

(setq backup-directory-alist '(("/home/delexi/.*" . "/some/dir")))

- no?

Nick

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: org-indent-mode corrupted most of a big org file
  2013-12-03 18:30             ` Nick Dokos
@ 2013-12-03 19:29               ` Sebastien Vauban
  2013-12-04  9:43               ` Alexander Baier
  1 sibling, 0 replies; 21+ messages in thread
From: Sebastien Vauban @ 2013-12-03 19:29 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Nick Dokos,

Nick Dokos wrote:
> Alexander Baier <lexi.baier-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
>> I used to set up backup-directory-alist the same way you have, but
>> changed it, when I noticed emacs putting backups of files I edited as
>> root into that directory.  That was something I did not want to do.
>>
>
> OK - I haven't lived with this setup long enough to know better.
>
> On another subject:
>
>>   (setq backup-directory-alist 
>>             '(("/home/delexi/*" . "/home/delexi/.emacs.d/backup")))
>
> the docstring says that the car of each dotted pair in the alist is a
> regexp: I presume an emacs regexp, not a shell glob pattern. So the
> setting should be
>
> (setq backup-directory-alist '(("/home/delexi/.*" . "/some/dir")))
>
> - no?

Yes, I do have (for years) the following:

--8<---------------cut here---------------start------------->8---
    (setq backup-directory-alist
          '((".*" . "~/.emacs.d/backups/")))
--8<---------------cut here---------------end--------------->8---

Emacs will `make-directory' it, if necessary.

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: org-indent-mode corrupted most of a big org file
  2013-12-02 11:21 org-indent-mode corrupted most of a big org file Rainer Stengele
  2013-12-02 11:31 ` Sebastien Vauban
  2013-12-02 15:37 ` Alexander Baier
@ 2013-12-04  8:25 ` Nicolas Goaziou
  2013-12-04 11:26   ` Rainer Stengele
  2013-12-12 14:48 ` Rainer Stengele
  3 siblings, 1 reply; 21+ messages in thread
From: Nicolas Goaziou @ 2013-12-04  8:25 UTC (permalink / raw)
  To: Rainer Stengele; +Cc: emacs-orgmode

Hello,

Rainer Stengele <rainer.stengele@online.de> writes:

> last week I played around with org-indent-mode in my biggest (37.000 lines) org file.
> 3 days later I detected that most of the file was corrupted.
> WHy so late? Using the agenda I only saw the todos and did not recognise the corrupted structures.
> Most "*" items had been placed at the beginning of the line and therefore now became headlines.
> I do not know how this happened. I am not sure if I myself was the reason somehow.
> Anyway I had to spend a fair amount of work to get the old file format from
> subversion and insert the changes since the corruption.
>
> This is just a warning to have backups at hand before changing to org-indent mode.
> Then immediately and check often the contents of the file until you are sure all is running well.
>
> Maybe someone has an idea.
>
> I will try to convert again later but then be much more careful.

For the sake of correctness, `org-indent-mode' cannot corrupt a file. It
only modifies two text properties, `line-prefix' and `wrap-prefix',
never the contents of the file.

Something else corrupted that file. `org-indent-mode' possibly made it
harder to notice, but you're looking after the wrong culprit.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: org-indent-mode corrupted most of a big org file
  2013-12-03 18:30             ` Nick Dokos
  2013-12-03 19:29               ` Sebastien Vauban
@ 2013-12-04  9:43               ` Alexander Baier
  1 sibling, 0 replies; 21+ messages in thread
From: Alexander Baier @ 2013-12-04  9:43 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

On 13-12-03 19:30 Nick Dokos wrote:
> Alexander Baier <lexi.baier@gmail.com> writes:
>
>
>> I used to set up backup-directory-alist the same way you have, but
>> changed it, when I noticed emacs putting backups of files I edited as
>> root into that directory.  That was something I did not want to do.
>>
>
> OK - I haven't lived with this setup long enough to know better.
>
> On another subject:
>
>>   (setq backup-directory-alist 
>>             '(("/home/delexi/*" . "/home/delexi/.emacs.d/backup")))
>
> the docstring says that the car of each dotted pair in the alist is a
> regexp: I presume an emacs regexp, not a shell glob pattern. So the
> setting should be
>
> (setq backup-directory-alist '(("/home/delexi/.*" . "/some/dir")))
>
> - no?
>
> Nick
>
Yes, you are right.  Although "/home/delexi/*" is a valid regexp, it
sure is not what I meant to express.  As you said, "/home/delexi/.*" is
the way I wanted to go.

Thanks,
-- 
 Alexander Baier

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: org-indent-mode corrupted most of a big org file
  2013-12-04  8:25 ` Nicolas Goaziou
@ 2013-12-04 11:26   ` Rainer Stengele
  2013-12-04 13:16     ` Nicolas Goaziou
  0 siblings, 1 reply; 21+ messages in thread
From: Rainer Stengele @ 2013-12-04 11:26 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Am 04.12.2013 09:25, schrieb Nicolas Goaziou:
> Hello,
>
> Rainer Stengele <rainer.stengele@online.de> writes:
>
>> last week I played around with org-indent-mode in my biggest (37.000 lines) org file.
>> 3 days later I detected that most of the file was corrupted.
>> WHy so late? Using the agenda I only saw the todos and did not recognise the corrupted structures.
>> Most "*" items had been placed at the beginning of the line and therefore now became headlines.
>> I do not know how this happened. I am not sure if I myself was the reason somehow.
>> Anyway I had to spend a fair amount of work to get the old file format from
>> subversion and insert the changes since the corruption.
>>
>> This is just a warning to have backups at hand before changing to org-indent mode.
>> Then immediately and check often the contents of the file until you are sure all is running well.
>>
>> Maybe someone has an idea.
>>
>> I will try to convert again later but then be much more careful.
> For the sake of correctness, `org-indent-mode' cannot corrupt a file. It
> only modifies two text properties, `line-prefix' and `wrap-prefix',
> never the contents of the file.
>
> Something else corrupted that file. `org-indent-mode' possibly made it
> harder to notice, but you're looking after the wrong culprit.
>
>
> Regards,
>
Good to know.
But the indent-mode made it quite easy to mess up most of the file.
I think I tried somehow to delete the now no more needed whitespace and messed things up without noticing it.
I am afraid there is no easy way to "convert" a non org-indent-mode to a nice formatted org-indent-file.
For smaller files I went through them page by page and left shifted lists and items manually.
As far as I remember even Bernt Hansen did the work manually after switching.
Maybe someone has a suggestion.

Regards, Rainer

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: org-indent-mode corrupted most of a big org file
  2013-12-04 11:26   ` Rainer Stengele
@ 2013-12-04 13:16     ` Nicolas Goaziou
  0 siblings, 0 replies; 21+ messages in thread
From: Nicolas Goaziou @ 2013-12-04 13:16 UTC (permalink / raw)
  To: Rainer Stengele; +Cc: emacs-orgmode

Hello,

Rainer Stengele <rainer.stengele@online.de> writes:

> I am afraid there is no easy way to "convert" a non org-indent-mode to
> a nice formatted org-indent-file.

Don't be afraid. There is `org-unindent-buffer'.

Admittedly, it doesn't handle starred items, but that shouldn't be hard
to fix.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: org-indent-mode corrupted most of a big org file
  2013-12-03 12:58     ` Alexander Baier
  2013-12-03 17:23       ` Johann Spies
@ 2013-12-06 14:41       ` Johann Spies
  2013-12-07 10:48         ` Alexander Baier
  1 sibling, 1 reply; 21+ messages in thread
From: Johann Spies @ 2013-12-06 14:41 UTC (permalink / raw)
  To: Johann Spies, Rainer Stengele, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 3805 bytes --]

Hello Alexander,

Thanks for your attention.  The message I sent earlier was of my experience
on my work computer.

I have now tried the same on my home computer.  The files on both edited
was in /home/js/Dropbox/orgmode.

I have also edited ~/.emacs and saved it.

that is strange.  I cannot remember doing something else besides putting
> the mentioned code into my init file.  I can only think of these
> "trivial" reason why this does not work for you:
>
> - Did you evaluate the code or restarted your emacs?
>

I have killed and restarted emacs.  How do I evaluate (reload) .emacs when
emacs is running?


> - Are the files you are editing somewhere under /home/js/?
> - Did you really edit and save a file since adding the code to your init
>   file?
> - In case you are editing files under version control: Did you turn on
>   vc-make-backup-files?
>
> HTH,
> --
>  Alexander Baier
>
> On 13-12-03 09:33 Johann Spies wrote:
> > Thanks for sharing this. However, after adding this to my ~/.emacs I do
> not
> > see anything appearing in my .emacs.d/backup directory.
> >
> > #+begin_src emacs-lisp
> >   (setq make-backup-files t)
> >   (setq backup-directory-alist '(("/home/js/*" .
> "/home/js/.emacs.d/backup")))
> >   (setq backup-by-copying t      ; don't use symlinks
> >         delete-old-versions t    ; don't ask me about deleting backups
> >         kept-new-versions 20
> >         kept-old-versions 5
> >         version-control t)       ; use versioned backups
> > #+end_src
> >
> >
> >
> > Regards
> > Johann
> >
> >
> > On 2 December 2013 17:37, Alexander Baier <lexi.baier@gmail.com> wrote:
> >
> >> On 13-12-02 12:21 Rainer Stengele wrote:
> >> > All,
> >> >
> >> > last week I played around with org-indent-mode in my biggest (37.000
> >> lines) org file.
> >> > 3 days later I detected that most of the file was corrupted.
> >> > WHy so late? Using the agenda I only saw the todos and did not
> recognise
> >> the corrupted structures.
> >> > Most "*" items had been placed at the beginning of the line and
> >> therefore now became headlines.
> >> > I do not know how this happened. I am not sure if I myself was the
> >> reason somehow.
> >> > Anyway I had to spend a fair amount of work to get the old file format
> >> from
> >> > subversion and insert the changes since the corruption.
> >> >
> >> > This is just a warning to have backups at hand before changing to
> >> org-indent mode.
> >> > Then immediately and check often the contents of the file until you
> are
> >> sure all is running well.
> >> >
> >> > Maybe someone has an idea.
> >> >
> >> > I will try to convert again later but then be much more careful.
> >> >
> >> > Rainer
> >> >
> >> >
> >>
> >> FWIW, I have the following snippet in my init file, that uses emacs'
> >> build-in backup machanism to save me from such things.  As emacs stuffs
> >> them all in one central location, I do not have to worry about polluting
> >> my filesystem.
> >>
> >> #+begin_src emacs-lisp
> >>   (setq make-backup-files t)
> >>   (setq backup-directory-alist '(("/home/delexi/*" .
> >> "/home/delexi/.emacs.d/backup")))
> >>   (setq backup-by-copying t      ; don't use symlinks
> >>         delete-old-versions t    ; don't ask me about deleting backups
> >>         kept-new-versions 20
> >>         kept-old-versions 5
> >>         version-control t)       ; use versioned backups
> >> #+end_src
> >>
> >> If you want to make backups from files under version control, you also
> >> have to set the following:
> >>
> >> #+begin_src emacs-lisp
> >>   (setq vc-make-backup-files t)
> >> #+end_src
> >>
> >> This already saved me a couple of times.
> >>
> >> Regards,
> >> --
> >>  Alexander Baier
> >>
> >>
>
>


-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

[-- Attachment #2: Type: text/html, Size: 5267 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: org-indent-mode corrupted most of a big org file
  2013-12-06 14:41       ` org-indent-mode corrupted most of a big org file Johann Spies
@ 2013-12-07 10:48         ` Alexander Baier
  0 siblings, 0 replies; 21+ messages in thread
From: Alexander Baier @ 2013-12-07 10:48 UTC (permalink / raw)
  To: Johann Spies; +Cc: Rainer Stengele, emacs-orgmode

Hello Johann,

I can't quite follow you. I was under the impression that your issue has
been resolved.

If that is not the case, you might want to share the relevant code in
your init file here.

On 2013-12-06 15:41 Johann Spies wrote:
> Hello Alexander,
>
> Thanks for your attention.  The message I sent earlier was of my experience
> on my work computer.
>
> I have now tried the same on my home computer.  The files on both edited
> was in /home/js/Dropbox/orgmode.
>
> I have also edited ~/.emacs and saved it.
>
> that is strange.  I cannot remember doing something else besides putting
>> the mentioned code into my init file.  I can only think of these
>> "trivial" reason why this does not work for you:
>>
>> - Did you evaluate the code or restarted your emacs?
>>
>
> I have killed and restarted emacs.  How do I evaluate (reload) .emacs when
> emacs is running?
>
>
>> - Are the files you are editing somewhere under /home/js/?
>> - Did you really edit and save a file since adding the code to your init
>>   file?
>> - In case you are editing files under version control: Did you turn on
>>   vc-make-backup-files?
>>
>> HTH,
>> --
>>  Alexander Baier
>>
>> On 13-12-03 09:33 Johann Spies wrote:
>> > Thanks for sharing this. However, after adding this to my ~/.emacs I do
>> not
>> > see anything appearing in my .emacs.d/backup directory.
>> >
>> > #+begin_src emacs-lisp
>> >   (setq make-backup-files t)
>> >   (setq backup-directory-alist '(("/home/js/*" .
>> "/home/js/.emacs.d/backup")))
>> >   (setq backup-by-copying t      ; don't use symlinks
>> >         delete-old-versions t    ; don't ask me about deleting backups
>> >         kept-new-versions 20
>> >         kept-old-versions 5
>> >         version-control t)       ; use versioned backups
>> > #+end_src
>> >
>> >
>> >
>> > Regards
>> > Johann
>> >
>> >
>> > On 2 December 2013 17:37, Alexander Baier <lexi.baier@gmail.com> wrote:
>> >
>> >> On 13-12-02 12:21 Rainer Stengele wrote:
>> >> > All,
>> >> >
>> >> > last week I played around with org-indent-mode in my biggest (37.000
>> >> lines) org file.
>> >> > 3 days later I detected that most of the file was corrupted.
>> >> > WHy so late? Using the agenda I only saw the todos and did not
>> recognise
>> >> the corrupted structures.
>> >> > Most "*" items had been placed at the beginning of the line and
>> >> therefore now became headlines.
>> >> > I do not know how this happened. I am not sure if I myself was the
>> >> reason somehow.
>> >> > Anyway I had to spend a fair amount of work to get the old file format
>> >> from
>> >> > subversion and insert the changes since the corruption.
>> >> >
>> >> > This is just a warning to have backups at hand before changing to
>> >> org-indent mode.
>> >> > Then immediately and check often the contents of the file until you
>> are
>> >> sure all is running well.
>> >> >
>> >> > Maybe someone has an idea.
>> >> >
>> >> > I will try to convert again later but then be much more careful.
>> >> >
>> >> > Rainer
>> >> >
>> >> >
>> >>
>> >> FWIW, I have the following snippet in my init file, that uses emacs'
>> >> build-in backup machanism to save me from such things.  As emacs stuffs
>> >> them all in one central location, I do not have to worry about polluting
>> >> my filesystem.
>> >>
>> >> #+begin_src emacs-lisp
>> >>   (setq make-backup-files t)
>> >>   (setq backup-directory-alist '(("/home/delexi/*" .
>> >> "/home/delexi/.emacs.d/backup")))
>> >>   (setq backup-by-copying t      ; don't use symlinks
>> >>         delete-old-versions t    ; don't ask me about deleting backups
>> >>         kept-new-versions 20
>> >>         kept-old-versions 5
>> >>         version-control t)       ; use versioned backups
>> >> #+end_src
>> >>
>> >> If you want to make backups from files under version control, you also
>> >> have to set the following:
>> >>
>> >> #+begin_src emacs-lisp
>> >>   (setq vc-make-backup-files t)
>> >> #+end_src
>> >>
>> >> This already saved me a couple of times.
>> >>
>> >> Regards,
>> >> --
>> >>  Alexander Baier
>> >>
>> >>
>>
>>

Regards,
-- 
 Alexander Baier

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: org-indent-mode corrupted most of a big org file
  2013-12-02 11:21 org-indent-mode corrupted most of a big org file Rainer Stengele
                   ` (2 preceding siblings ...)
  2013-12-04  8:25 ` Nicolas Goaziou
@ 2013-12-12 14:48 ` Rainer Stengele
  3 siblings, 0 replies; 21+ messages in thread
From: Rainer Stengele @ 2013-12-12 14:48 UTC (permalink / raw)
  To: emacs-orgmode

Am 02.12.2013 12:21, schrieb Rainer Stengele:
> All,
> 
> last week I played around with org-indent-mode in my biggest (37.000 lines) org file.
> 3 days later I detected that most of the file was corrupted.
> WHy so late? Using the agenda I only saw the todos and did not recognise the corrupted structures.
> Most "*" items had been placed at the beginning of the line and therefore now became headlines.
> I do not know how this happened. I am not sure if I myself was the reason somehow.
> Anyway I had to spend a fair amount of work to get the old file format from
> subversion and insert the changes since the corruption.
> 
> This is just a warning to have backups at hand before changing to org-indent mode.
> Then immediately and check often the contents of the file until you are sure all is running well.
> 
> Maybe someone has an idea.
> 
> I will try to convert again later but then be much more careful.
> 
> Rainer
> 
> 
> 
Hi,

I believe I found the function that "corrupted" most of my buffer.
Trying to convert the indented org contents to unindented I "discovered" that
delete-whitespace-rectangle did a nice job.

Imagine you see something like this, cursor at ^.

*** headline0
     CLOCK: [2013-10-11 Fr 16:45]--[2013-10-11 Fr 17:00] =>  0:15
^    CLOCK: [2013-10-01 Di 14:30]--[2013-10-01 Di 23:00] =>  8:30
     CLOCK: [2013-10-01 Di 09:45]--[2013-10-01 Di 10:15] =>  0:30
     CLOCK: [2013-09-30 Mo 13:30]--[2013-09-30 Mo 17:00] =>  3:30
**** headline1
**** headline2

calling delete-whitespace-rectangle results in:

*** headline0
CLOCK: [2013-10-11 Fr 16:45]--[2013-10-11 Fr 17:00] =>  0:15
CLOCK: [2013-10-01 Di 14:30]--[2013-10-01 Di 23:00] =>  8:30
CLOCK: [2013-10-01 Di 09:45]--[2013-10-01 Di 10:15] =>  0:30
CLOCK: [2013-09-30 Mo 13:30]--[2013-09-30 Mo 17:00] =>  3:30
**** headline1
**** headline2

Looks good.
Cycling headline2 shows, that all item lists which began
with "*" are now at the beginning of the line and therefore became headlines level 1!
That of course is only visible after cycling.
The mistake is maybe using the wrong rectangle, but anyway it
changes the invisible buffer contents.

Rainer

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2013-12-12 14:48 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-02 11:21 org-indent-mode corrupted most of a big org file Rainer Stengele
2013-12-02 11:31 ` Sebastien Vauban
2013-12-02 12:06   ` Carsten Dominik
2013-12-02 15:37 ` Alexander Baier
2013-12-02 19:11   ` Nicolas Richard
2013-12-03  8:33   ` Johann Spies
2013-12-03 12:58     ` Alexander Baier
2013-12-03 17:23       ` Johann Spies
2013-12-03 17:37         ` Alexander Baier
2013-12-03 17:43         ` Nick Dokos
2013-12-03 17:53           ` Alexander Baier
2013-12-03 18:30             ` Nick Dokos
2013-12-03 19:29               ` Sebastien Vauban
2013-12-04  9:43               ` Alexander Baier
2013-12-03 18:15         ` org-indent-mode corrupted most of a big org file (solved backups) Johann Spies
2013-12-06 14:41       ` org-indent-mode corrupted most of a big org file Johann Spies
2013-12-07 10:48         ` Alexander Baier
2013-12-04  8:25 ` Nicolas Goaziou
2013-12-04 11:26   ` Rainer Stengele
2013-12-04 13:16     ` Nicolas Goaziou
2013-12-12 14:48 ` Rainer Stengele

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