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

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

Re: Automatic versioning


From: Kevin Rodgers
Subject: Re: Automatic versioning
Date: Fri, 04 Apr 2008 06:24:58 -0600
User-agent: Thunderbird 2.0.0.12 (Macintosh/20080213)

Timothy Hobbs wrote:
Kevin Rodgers <kevin.d.rodgers@gmail.com> writes:

(defadvice save-buffer (before version activate)
  "I wish to have all files versioned, period."
  (ad-set-arg 0 '(64)))

What exactly does this do?

It makes save-buffer behave as if it were invoked as
`C-u C-u C-u C-x C-s' (see "Prefixed with three C-u's"
below).

,----[ C-h k C-x C-s ]
| C-x C-s runs the command save-buffer
|   which is an interactive compiled Lisp function in `files.el'.
| It is bound to C-x C-s, <menu-bar> <file> <save-buffer>.
| (save-buffer &optional args)
|
| Save current buffer in visited file if modified.
| Variations are described below.
|
| By default, makes the previous version into a backup file
|  if previously requested or if this is the first save.
| Prefixed with one C-u, marks this version
|  to become a backup when the next save is done.
| Prefixed with two C-u's,
|  unconditionally makes the previous version into a backup file.
| Prefixed with three C-u's, marks this version
|  to become a backup when the next save is done,
|  and unconditionally makes the previous version into a backup file.
|
| With a numeric argument of 0, never make the previous version
| into a backup file.
|
| If a file's name is FOO, the names of its numbered backup versions are
| FOO.~i~ for various integers i. A non-numbered backup file is called FOO~.
| Numeric backups (rather than FOO~) will be made if value of
|  `version-control' is not the atom `never' and either there are already
|  numeric versions of the file being backed up, or `version-control' is
|  non-nil.
| We don't want excessive versions piling up, so there are variables
|  `kept-old-versions', which tells Emacs how many oldest versions to keep,
|  and `kept-new-versions', which tells how many newest versions to keep.
|  Defaults are 2 old versions and 2 new.
| `dired-kept-versions' controls dired's clean-directory (.) command.
| If `delete-old-versions' is nil, system will query user
|  before trimming versions.  Otherwise it does it silently.
|
| If `vc-make-backup-files' is nil, which is the default,
|  no backup files are made for files managed by version control.
| (This is because the version control system itself records previous versions.)
|
| See the subroutine `basic-save-buffer' for more information.
|
| [back]
`----


--
Kevin Rodgers
Denver, Colorado, USA





reply via email to

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