all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Taylor R Campbell <campbell@mumble.net>
To: bug-gnu-emacs@gnu.org
Subject: bug#3702: Emacs fails to respect the intent in `C-u C-u C-x C-s' of making a backup
Date: Sun, 28 Jun 2009 14:13:16 -0400	[thread overview]
Message-ID: <20090628181318.3ABDA9828B@pluto.mumble.net> (raw)

Often, when saving a file, I want to make a backup.  The only way I
know to express this intent is `C-u C-u C-x C-s'.  When I type `C-u
C-u C-x C-s', I mean to tell Emacs:  `I want you to make a backup and
then save this file.'  The documentation for the `save-buffer' command
says:

   Prefixed by two C-u's,
    unconditionally makes the previous version into a backup file.
    ^^^^^^^^^^^^^^^
Unfortunately, Emacs fails to respect my intent in many circumstances.
First, I set `version-control' to t in order to keep numbered backups.
Then in order to make backups in directories such as /tmp, I set
`backup-enable-predicate' to be a function that always returns t.
Next, in order to make backups when `vc' is involved, I set
`vc-make-backup-files' to t, which confused me because it didn't take
effect immediately -- I had to reload all my buffers before it did.
This is because some vc hook set another variable, `backup-inhibited',
when I first loaded those buffers.

There are plenty of other documented ways for arbitrary modes to
interfere with my intent when I type `C-u C-u' -- there are several
hooks that are run during `save-buffer' before `backup-buffer' and
conditions under which backups will be made.  This contradicts the
documentation of `save-buffer' which explicitly says that `C-u C-u'
means a backup will be made *unconditionally*.  I don't mind that
there may be various heuristics for choosing whether to make a backup
file when the user has not indicated a preference either way (by
typing `C-u 0' or `C-u C-u' or whatnot), but it is very frustrating
when the documentation says `unconditionally' and the implementation
has many documented ways to interfere and add conditions.  Of course,
the documentation could simply omit the word `unconditionally', but I
don't want that either -- I want it really to be unconditional (as far
as the documented hooks in Emacs go; of course someone could redefine
`save-buffer', but it's the documented hooks and conditions such as
`backup-inhibited' that bother me).

I am using

GNU Emacs 22.2.1 (i386-apple-darwin8.11.1, GTK+ Version 2.10.13) of 2008-07-06 on Oberon.local.

In my .emacs file, relevant to backups, I have

(defun always-backup (filename) filename t)
(setq-default backup-enable-predicate 'always-backup)
(setq-default version-control t)
(setq-default vc-make-backup-files t)
(setq-default backup-inhibited nil)
(setq-default make-backup-files t)






             reply	other threads:[~2009-06-28 18:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-28 18:13 Taylor R Campbell [this message]
2016-06-18  3:37 ` bug#3702: Emacs fails to respect the intent in `C-u C-u C-x C-s' of making a backup Andrew Hyatt
2016-06-18  8:14   ` Eli Zaretskii
     [not found]     ` <m2r3bkeirh.fsf@Andrews-MacBook-Pro.local>
2016-07-09 11:19       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090628181318.3ABDA9828B@pluto.mumble.net \
    --to=campbell@mumble.net \
    --cc=3702@emacsbugs.donarmstrong.com \
    --cc=bug-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.