help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to force auto-save of buffers not visiting files, right now?


From: Jean Louis
Subject: Re: how to force auto-save of buffers not visiting files, right now?
Date: Mon, 21 Mar 2022 10:22:34 +0300
User-agent: Mutt/2.2.0 (2022-02-12)

* Michael Heerdegen <michael_heerdegen@web.de> [2022-03-19 06:48]:
> hw <hw@adminart.net> writes:
> 
> > > But why isn't your code located in a buffer visiting a file?
> >
> > It is.  The output of perltidy replaces it.
> 
> Ok - but does it have to be auto-save?  Why not just use normal backup
> files?  You can explicitly force the creation of backup files.  And keep
> a lot of them around.  See (info "(emacs) Backup") and
> (info "(emacs) Backup Deletion").  You can, for example, have hundred
> backups of each file you edit - in a folder of your choice so that they
> don't clobber your working directories.

Exactly so.

My backup files look as these:

  -rw-r--r-- 1  19K Feb  7 19:36 double-opt-in.el
  -rw-r--r-- 1  19K Aug 11  2021 double-opt-in.el~

In reality I almost never use them.

> If you are familiar with git, I suggest to have a look at Magit and the
> wip modes.  After some setup, you get a backup for every save - or even
> two, if the original state of the file was not yet backed up.  Due to
> git's delta compression it doesn't waste much disk space.  The interface
> lets you browse the versions and diff them etc.

Good idea.

I got tired of it all and made 

Emacs: RCD Version Control system with PostgreSQL backend: 
https://hyperscope.link/3/6/7/9/6/Emacs-RCD-Version-Control-system-with-PostgreSQL-backend-36796.html

And now it is all without thinking and my backup files I just recall
by using a function. Not as sophisticated, though very automatic. 

A version of file is in the database. If I need it, I get it
back. Sometimes I do need to repair functions from past. If the file
name location change, I will still be able to find the file in the
database, or save it to file system from there. 

                             ID   44774
                   Date created   "2022-03-19 13:17:14.745576"
                  Date modified   nil
                   User created   "maddox"
                  User modified   "maddox"
                          Table   nil
                         Column   nil
                       Table ID   nil
                          Value   "-- \\i 
/usr/share/postgresql/8.3/contrib/insert_username.sql ..."
                  PGP Signature   nil
              Short description   "Automatic revision: 2022-03-19-15:17:13"
                    Description   nil
                      File name   
"/home/data1/protected/public_html/rcd-business/rcdbusiness.sql"
                       Revision   nil
                         Buffer   nil
                         Schema   nil
                       Database   nil
                       Hostname   nil


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]