emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* export to latex, make-backup-files, vc-make-backup-files
@ 2019-06-21 12:24 Uwe Brauer
  2019-06-21 14:54 ` Fraga, Eric
  2019-06-21 17:22 ` Nick Dokos
  0 siblings, 2 replies; 10+ messages in thread
From: Uwe Brauer @ 2019-06-21 12:24 UTC (permalink / raw)
  To: emacs-orgmode


Hi 

The following kills me.

I have set

make-backup-files t, 
vc-make-backup-files nil

I am in a directory which is under version control (mercurial).

The file test.org and test.tex are *both* under VC control.

However when I export test.org to test.tex say twice
the files 

test.tex
and 

test.tex.~1~

are generated and if I export once again I will have another backup
file.


I even set in my orgfile 
#+BEGIN_SRC emacs-lisp 
(set (make-local-variable 'make-backup-files) nil)
#+END_SRC

But it does not help

Is this a bug?

Regards

Uwe Brauer 

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

* Re: export to latex, make-backup-files, vc-make-backup-files
  2019-06-21 12:24 export to latex, make-backup-files, vc-make-backup-files Uwe Brauer
@ 2019-06-21 14:54 ` Fraga, Eric
  2019-06-21 15:22   ` Uwe Brauer
  2019-06-21 17:22 ` Nick Dokos
  1 sibling, 1 reply; 10+ messages in thread
From: Fraga, Eric @ 2019-06-21 14:54 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

On Friday, 21 Jun 2019 at 14:24, Uwe Brauer wrote:
> I even set in my orgfile 
>
> #+BEGIN_SRC emacs-lisp 
> (set (make-local-variable 'make-backup-files) nil)
> #+END_SRC

but this will not affect the setting of that variable for the .tex file,
only the current org file where you execute this lisp code, which is why
you get the backup copy being made.
-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.4-379-g1b74ae

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

* Re: export to latex, make-backup-files, vc-make-backup-files
  2019-06-21 14:54 ` Fraga, Eric
@ 2019-06-21 15:22   ` Uwe Brauer
  2019-06-21 16:23     ` Fraga, Eric
  0 siblings, 1 reply; 10+ messages in thread
From: Uwe Brauer @ 2019-06-21 15:22 UTC (permalink / raw)
  To: emacs-orgmode


>>> "FE" == Fraga, Eric <e.fraga@ucl.ac.uk> writes:

> On Friday, 21 Jun 2019 at 14:24, Uwe Brauer wrote:
>> I even set in my orgfile 
>> 
>> #+BEGIN_SRC emacs-lisp 
>> (set (make-local-variable 'make-backup-files) nil)
>> #+END_SRC

> but this will not affect the setting of that variable for the .tex file,
> only the current org file where you execute this lisp code, which is why
> you get the backup copy being made.

But the .tex file is under VC control, so no backup copy should be made,
since
vc-make-backup-files nil
(but that may only apply I make in the file)

Do you have any idea how to avoid the creation of the backup files,
without setting the make-backup-files variable globally to nil.

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

* Re: export to latex, make-backup-files, vc-make-backup-files
  2019-06-21 15:22   ` Uwe Brauer
@ 2019-06-21 16:23     ` Fraga, Eric
  0 siblings, 0 replies; 10+ messages in thread
From: Fraga, Eric @ 2019-06-21 16:23 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

On Friday, 21 Jun 2019 at 17:22, Uwe Brauer wrote:
> Do you have any idea how to avoid the creation of the backup files,
> without setting the make-backup-files variable globally to nil.

I can only suggest that you might be able to make that variable local to
the .tex file using some hook?  I have no idea which hook or whether
such is possible, mind you.

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.4-379-g1b74ae

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

* Re: export to latex, make-backup-files, vc-make-backup-files
  2019-06-21 12:24 export to latex, make-backup-files, vc-make-backup-files Uwe Brauer
  2019-06-21 14:54 ` Fraga, Eric
@ 2019-06-21 17:22 ` Nick Dokos
  2019-06-22 10:50   ` Uwe Brauer
                     ` (2 more replies)
  1 sibling, 3 replies; 10+ messages in thread
From: Nick Dokos @ 2019-06-21 17:22 UTC (permalink / raw)
  To: emacs-orgmode

Uwe Brauer <oub@mat.ucm.es> writes:

> Hi 
>
> The following kills me.
>
> I have set
>
> make-backup-files t, 
> vc-make-backup-files nil
>
> I am in a directory which is under version control (mercurial).
>
> The file test.org and test.tex are *both* under VC control.
>
> However when I export test.org to test.tex say twice
> the files 
>
> test.tex
> and 
>
> test.tex.~1~
>
> are generated and if I export once again I will have another backup
> file.
>
> ...
>
> But it does not help
>
> Is this a bug?
>

FWIW, I tried a set-up with git (I don't have mercurial available) and I cannot
reproduce this.

I'm not using numbered backups but the two variables you mention are set the
same way for me. Here's what I did:

- created a directory "foo" and cd'ed to it.
- `git init'
- create "test.org" and export to create "test.tex".
- `git add test.org test.tex'
- `git status' to check that everything looks good.
- modify test.org and export a few times.
- at every export, do `ls -la'. I always get this:

,----
| $ ls -la
| total 12
| drwxrwxr-x.  4 nick nick   62 Jun 21 13:04 .
| drwxrwxr-x. 14 nick nick 4096 Jun 21 13:03 ..
| drwxrwxr-x.  2 nick nick   21 Jun 21 13:04 auto
| drwxrwxr-x.  7 nick nick  132 Jun 21 13:04 .git
| -rw-rw-r--.  1 nick nick   67 Jun 21 13:04 test.org
| -rw-rw-r--.  1 nick nick  788 Jun 21 13:04 test.tex
`----

with no trace of backups.

Maybe try with git and see if you can reproduce the problem?
If not, I'd suspect either that the tex file is not under VC
or there is some incompatibility between mercurial and the
emacs vc package.

Also, there are two ways to make a backup (renaming and copying -
I use copying) and maybe the method you use is incompatible with
mercurial. Maybe you can try the other method: check the setting
of `make-backup-by-copying'.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler

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

* Re: export to latex, make-backup-files, vc-make-backup-files
  2019-06-21 17:22 ` Nick Dokos
@ 2019-06-22 10:50   ` Uwe Brauer
  2019-06-22 14:07   ` Uwe Brauer
  2019-06-22 14:15   ` [[Kludge]] (was: export to latex, make-backup-files, vc-make-backup-files) Uwe Brauer
  2 siblings, 0 replies; 10+ messages in thread
From: Uwe Brauer @ 2019-06-22 10:50 UTC (permalink / raw)
  To: emacs-orgmode

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


   > Uwe Brauer <oub@mat.ucm.es> writes:

Thanks for you response.


   > FWIW, I tried a set-up with git (I don't have mercurial available) and I cannot
   > reproduce this.

   > I'm not using numbered backups but the two variables you mention are set the
   > same way for me. Here's what I did:

A wait what do you mean you have not set up numbered backups, maybe this already is
the difference. I will come back to the point later

   > - created a directory "foo" and cd'ed to it.
   > - `git init'
   > - create "test.org" and export to create "test.tex".
   > - `git add test.org test.tex'
   > - `git status' to check that everything looks good.
   > - modify test.org and export a few times.
   > - at every export, do `ls -la'. I always get this:

   > ,----
   > | $ ls -la
   > | total 12
   > | drwxrwxr-x.  4 nick nick   62 Jun 21 13:04 .
   > | drwxrwxr-x. 14 nick nick 4096 Jun 21 13:03 ..
   > | drwxrwxr-x.  2 nick nick   21 Jun 21 13:04 auto
   > | drwxrwxr-x.  7 nick nick  132 Jun 21 13:04 .git
   > | -rw-rw-r--.  1 nick nick   67 Jun 21 13:04 test.org
   > | -rw-rw-r--.  1 nick nick  788 Jun 21 13:04 test.tex
   > `----

   > with no trace of backups.

Which is the expected behavior.


   > Maybe try with git and see if you can reproduce the problem?

I did and yes the problem also occurs in git, so the
problem is my setting not git/mercurial, which is good.


   > If not, I'd suspect either that the tex file is not under VC
   > or there is some incompatibility between mercurial and the
   > emacs vc package.

   > Also, there are two ways to make a backup (renaming and copying -
   > I use copying) and maybe the method you use is incompatible with
   > mercurial. Maybe you can try the other method: check the setting
   > of `make-backup-by-copying'.

I have a relatively recent version of GNU emacs master, but cannot find
the variables make-backup-by-copying. Could you please explain.


I had however 

backup-by-copying set nil, now it is t, but still the behavior is the
same.

So maybe it boils down to what you said at the beginning

   > I'm not using numbered backups
https://www.gnu.org/software/emacs/manual/html_node/elisp/Numbered-Backups.html

Ok I had 

Version-control set  to t.
I changed it to nil: no change 
I changed it to never: emacs now makes test.tex~ instead of test.tex.~1~

I am running out of ideas.

Where is the mistake?

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5025 bytes --]

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

* Re: export to latex, make-backup-files, vc-make-backup-files
  2019-06-21 17:22 ` Nick Dokos
  2019-06-22 10:50   ` Uwe Brauer
@ 2019-06-22 14:07   ` Uwe Brauer
  2019-06-24 13:10     ` Nick Dokos
  2019-06-22 14:15   ` [[Kludge]] (was: export to latex, make-backup-files, vc-make-backup-files) Uwe Brauer
  2 siblings, 1 reply; 10+ messages in thread
From: Uwe Brauer @ 2019-06-22 14:07 UTC (permalink / raw)
  To: emacs-orgmode

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


   > Uwe Brauer <oub@mat.ucm.es> writes:

   > FWIW, I tried a set-up with git (I don't have mercurial available) and I cannot
   > reproduce this.

   > I'm not using numbered backups but the two variables you mention are set the
   > same way for me. Here's what I did:

Do you have really 
 make-backup-files t, 
 vc-make-backup-files nil


The only way I can stop the backup nightmare, is set it to nil,
globally, which is not what I want.

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5025 bytes --]

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

* [[Kludge]] (was: export to latex, make-backup-files, vc-make-backup-files)
  2019-06-21 17:22 ` Nick Dokos
  2019-06-22 10:50   ` Uwe Brauer
  2019-06-22 14:07   ` Uwe Brauer
@ 2019-06-22 14:15   ` Uwe Brauer
  2 siblings, 0 replies; 10+ messages in thread
From: Uwe Brauer @ 2019-06-22 14:15 UTC (permalink / raw)
  To: emacs-orgmode

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


   > Uwe Brauer <oub@mat.ucm.es> writes:

   > FWIW, I tried a set-up with git (I don't have mercurial available) and I cannot
   > reproduce this.

Finally 

(setq backup-directory-alist '(("" . "~/.emacs.d/backup")))

Sort of solves my problem. (What I cannot see does not exist)

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5025 bytes --]

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

* Re: export to latex, make-backup-files, vc-make-backup-files
  2019-06-22 14:07   ` Uwe Brauer
@ 2019-06-24 13:10     ` Nick Dokos
  2019-06-24 16:53       ` Uwe Brauer
  0 siblings, 1 reply; 10+ messages in thread
From: Nick Dokos @ 2019-06-24 13:10 UTC (permalink / raw)
  To: emacs-orgmode

Uwe Brauer <oub@mat.ucm.es> writes:

>    > Uwe Brauer <oub@mat.ucm.es> writes:
>
>    > FWIW, I tried a set-up with git (I don't have mercurial available) and I cannot
>    > reproduce this.
>
>    > I'm not using numbered backups but the two variables you mention are set the
>    > same way for me. Here's what I did:
>
> Do you have really 
>  make-backup-files t, 
>  vc-make-backup-files nil
>

Those are the setting I have.

>
> The only way I can stop the backup nightmare, is set it to nil,
> globally, which is not what I want.
>

Why not? If it's under VC, why do you need emacs to make backups for you?

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler

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

* Re: export to latex, make-backup-files, vc-make-backup-files
  2019-06-24 13:10     ` Nick Dokos
@ 2019-06-24 16:53       ` Uwe Brauer
  0 siblings, 0 replies; 10+ messages in thread
From: Uwe Brauer @ 2019-06-24 16:53 UTC (permalink / raw)
  To: emacs-orgmode

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


> Uwe Brauer <oub@mat.ucm.es> writes:

> Those are the setting I have.


> Why not? If it's under VC, why do you need emacs to make backups for you?

But only some of my files are, most of them are not under VC, so if I
set this variable globally to nil, no backups for files which are not
under VC control

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5025 bytes --]

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

end of thread, other threads:[~2019-06-24 16:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-21 12:24 export to latex, make-backup-files, vc-make-backup-files Uwe Brauer
2019-06-21 14:54 ` Fraga, Eric
2019-06-21 15:22   ` Uwe Brauer
2019-06-21 16:23     ` Fraga, Eric
2019-06-21 17:22 ` Nick Dokos
2019-06-22 10:50   ` Uwe Brauer
2019-06-22 14:07   ` Uwe Brauer
2019-06-24 13:10     ` Nick Dokos
2019-06-24 16:53       ` Uwe Brauer
2019-06-22 14:15   ` [[Kludge]] (was: export to latex, make-backup-files, vc-make-backup-files) Uwe Brauer

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