From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Taylor R Campbell Newsgroups: gmane.emacs.bugs 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 Message-ID: <20090628181318.3ABDA9828B@pluto.mumble.net> Reply-To: Taylor R Campbell , 3702@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1246216062 32398 80.91.229.12 (28 Jun 2009 19:07:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Jun 2009 19:07:42 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 28 21:07:35 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MKziw-0005Oa-QZ for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Jun 2009 21:07:35 +0200 Original-Received: from localhost ([127.0.0.1]:44681 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MKziw-0002oE-2K for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Jun 2009 15:07:34 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MKzG0-0002rQ-B6 for bug-gnu-emacs@gnu.org; Sun, 28 Jun 2009 14:37:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MKzFt-0002q9-Op for bug-gnu-emacs@gnu.org; Sun, 28 Jun 2009 14:37:39 -0400 Original-Received: from [199.232.76.173] (port=53603 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MKzFt-0002pq-CM for bug-gnu-emacs@gnu.org; Sun, 28 Jun 2009 14:37:33 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:48329) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MKzFr-00064S-LF for bug-gnu-emacs@gnu.org; Sun, 28 Jun 2009 14:37:32 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n5SIbOSe020819; Sun, 28 Jun 2009 11:37:26 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n5SIK443017866; Sun, 28 Jun 2009 11:20:04 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Taylor R Campbell Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 28 Jun 2009 18:20:03 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 3702 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.124621281216963 (code B ref -1); Sun, 28 Jun 2009 18:20:03 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 28 Jun 2009 18:13:32 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n5SIDRvP016958 for ; Sun, 28 Jun 2009 11:13:28 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MKysY-00057r-Vs for bug-gnu-emacs@gnu.org; Sun, 28 Jun 2009 14:13:27 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MKysU-000574-Rr for bug-gnu-emacs@gnu.org; Sun, 28 Jun 2009 14:13:26 -0400 Original-Received: from [199.232.76.173] (port=33715 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MKysU-000571-Ot for bug-gnu-emacs@gnu.org; Sun, 28 Jun 2009 14:13:22 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:52408) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MKysU-0007ZC-N5 for bug-gnu-emacs@gnu.org; Sun, 28 Jun 2009 14:13:22 -0400 Original-Received: from pluto.mumble.net ([206.123.75.20]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MKysS-0003vQ-JG for bug-gnu-emacs@gnu.org; Sun, 28 Jun 2009 14:13:20 -0400 Original-Received: from Oberon.local (localhost [127.0.0.1]) by pluto.mumble.net (Postfix) with ESMTP id 3ABDA9828B; Sun, 28 Jun 2009 18:13:18 +0000 (UTC) User-Agent: IMAIL/1.21; Edwin/3.116; MIT-Scheme/7.7.90.+ X-Detected-Operating-System: by mx20.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Sun, 28 Jun 2009 14:37:39 -0400 X-Mailman-Approved-At: Sun, 28 Jun 2009 15:06:16 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:29055 Archived-At: 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)