Re: [O] org-indent-mode corrupted most of a big org file

2013-12-12 Thread Rainer Stengele
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



Re: [O] org-indent-mode corrupted most of a big org file

2013-12-07 Thread Alexander Baier
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.ba...@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



Re: [O] org-indent-mode corrupted most of a big org file

2013-12-06 Thread Johann Spies
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.ba...@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)


Re: [O] org-indent-mode corrupted most of a big org file

2013-12-04 Thread Nicolas Goaziou
Hello,

Rainer Stengele rainer.steng...@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



Re: [O] org-indent-mode corrupted most of a big org file

2013-12-04 Thread Alexander Baier
On 13-12-03 19:30 Nick Dokos wrote:
 Alexander Baier lexi.ba...@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



Re: [O] org-indent-mode corrupted most of a big org file

2013-12-04 Thread Rainer Stengele
Am 04.12.2013 09:25, schrieb Nicolas Goaziou:
 Hello,

 Rainer Stengele rainer.steng...@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




Re: [O] org-indent-mode corrupted most of a big org file

2013-12-04 Thread Nicolas Goaziou
Hello,

Rainer Stengele rainer.steng...@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



Re: [O] org-indent-mode corrupted most of a big org file

2013-12-03 Thread Johann Spies
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.ba...@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)


Re: [O] org-indent-mode corrupted most of a big org file

2013-12-03 Thread Alexander Baier
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.ba...@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






Re: [O] org-indent-mode corrupted most of a big org file

2013-12-03 Thread Johann Spies

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



Re: [O] org-indent-mode corrupted most of a big org file

2013-12-03 Thread Alexander Baier
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



Re: [O] org-indent-mode corrupted most of a big org file

2013-12-03 Thread Nick Dokos
Johann Spies johann.sp...@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







Re: [O] org-indent-mode corrupted most of a big org file

2013-12-03 Thread Alexander Baier
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



Re: [O] org-indent-mode corrupted most of a big org file (solved backups)

2013-12-03 Thread Johann Spies
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



Re: [O] org-indent-mode corrupted most of a big org file

2013-12-03 Thread Nick Dokos
Alexander Baier lexi.ba...@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





Re: [O] org-indent-mode corrupted most of a big org file

2013-12-03 Thread Sebastien Vauban
Nick Dokos,

Nick Dokos wrote:
 Alexander Baier lexi.ba...@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?

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




Re: [O] org-indent-mode corrupted most of a big org file

2013-12-02 Thread Sebastien Vauban
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



Re: [O] org-indent-mode corrupted most of a big org file

2013-12-02 Thread Carsten Dominik

On Dec 2, 2013, at 12:31 PM, Sebastien Vauban sva-n...@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
 




Re: [O] org-indent-mode corrupted most of a big org file

2013-12-02 Thread Alexander Baier
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



Re: [O] org-indent-mode corrupted most of a big org file

2013-12-02 Thread Nicolas Richard
Alexander Baier lexi.ba...@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.