From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andrew Hyatt 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: Fri, 17 Jun 2016 23:37:28 -0400 Message-ID: References: <20090628181318.3ABDA9828B@pluto.mumble.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1466221107 24145 80.91.229.3 (18 Jun 2016 03:38:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 18 Jun 2016 03:38:27 +0000 (UTC) Cc: 3702@debbugs.gnu.org To: Taylor R Campbell Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 18 05:38:16 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bE75J-0003OT-QU for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 Jun 2016 05:38:14 +0200 Original-Received: from localhost ([::1]:32907 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bE75I-0001mF-E2 for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 Jun 2016 23:38:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bE75C-0001iO-Pe for bug-gnu-emacs@gnu.org; Fri, 17 Jun 2016 23:38:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bE758-0000IE-LU for bug-gnu-emacs@gnu.org; Fri, 17 Jun 2016 23:38:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60552) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bE758-0000IA-H2 for bug-gnu-emacs@gnu.org; Fri, 17 Jun 2016 23:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bE758-0001r7-4n for bug-gnu-emacs@gnu.org; Fri, 17 Jun 2016 23:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrew Hyatt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Jun 2016 03:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 3702 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 3702-submit@debbugs.gnu.org id=B3702.14662210677110 (code B ref 3702); Sat, 18 Jun 2016 03:38:02 +0000 Original-Received: (at 3702) by debbugs.gnu.org; 18 Jun 2016 03:37:47 +0000 Original-Received: from localhost ([127.0.0.1]:44656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bE74t-0001qc-6N for submit@debbugs.gnu.org; Fri, 17 Jun 2016 23:37:47 -0400 Original-Received: from mail-qk0-f177.google.com ([209.85.220.177]:35035) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bE74q-0001qK-AA for 3702@debbugs.gnu.org; Fri, 17 Jun 2016 23:37:45 -0400 Original-Received: by mail-qk0-f177.google.com with SMTP id c73so105137486qkg.2 for <3702@debbugs.gnu.org>; Fri, 17 Jun 2016 20:37:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=97eGH+v6yPGd6qWQcBO2bSqB15MqEEz9Qw3PO2rq3gk=; b=X/OsIhmjCWPmLVfmVCFaJg7sAvuLpcNta41fZEA2RkePFt+YvFZhIIaP8r9w9p6KIU bqbosoEkmkkElv43U2pCV/cgT9ag2joxC82Vr3w+la/kLN9sM3lbWAZQquAZ36Nfz8ly 8/AfTeEvfe8e7kchOc2CUNLQIjSM8fBu+08Gk7021TnPZz2eFounDQ0iw2K/p9jSk4Oj thSwW08bRptQTpIcX76KGlAZOIWln6bIcjeV7GbvPj3Z0B/PlwOF/PnSNsNxcjNhQQXQ rYT5Kju2oabo/Aj1spfAUTkEZV7TBTggugI9Ie5Po+BSCiZwyMQvh+tr0Ptc36uCjhuI fSCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=97eGH+v6yPGd6qWQcBO2bSqB15MqEEz9Qw3PO2rq3gk=; b=LroXnocNkA+Xe07YV2LV7LG/S0HoC2IaWN9DD2XGLum8/FxVGjtvyS90nKqnqN4tmq o+G5vEo7cB8oDsHy2m31cnCAjZuiFtc723GpYwv2FfNa47zliUey1e1JGAXPxUvuYDqd nx9+SP9GSbzg6YQL5t/Qy46633UoGM4LzB4iaFHLS8rhYLVAYxViTndPpV9Q3Dp/PMx1 CP7LufsSVbZghfqUJNiejpZzTwLHCM3yknLqOVKvQUa53C7Z58eF3m0otb7ZZeRk6OMc Eg8Jhv2HWyE9BX+Q++7j6y8cqbS+JH3NY7EqwX9zXGqtJft/egYVHlRv7WIybhk7uKqa uPLA== X-Gm-Message-State: ALyK8tLBkVJKj9g4E3MV+Qh5keMRiEJ0XplVW4mTjKtlcJ3SzJgx1DIgoSgDqacKdni8RQ== X-Received: by 10.55.118.196 with SMTP id r187mr6456745qkc.32.1466221058492; Fri, 17 Jun 2016 20:37:38 -0700 (PDT) Original-Received: from Andrews-MacBook-Pro.local (cpe-74-73-128-199.nyc.res.rr.com. [74.73.128.199]) by smtp.gmail.com with ESMTPSA id 61sm15044817qte.38.2016.06.17.20.37.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Jun 2016 20:37:35 -0700 (PDT) In-Reply-To: <20090628181318.3ABDA9828B@pluto.mumble.net> (Taylor R. Campbell's message of "Sun, 28 Jun 2009 14:13:16 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (darwin) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:119709 Archived-At: Sorry for the late reply on this one. This problem still exists in Emacs 25. I agree that the current behavior doesn't match up with the documentation. This probably is fixable by adding another free variable set by save-buffer and read in various functions, but there's a lot of those kind of variables already - the logic here, IMHO, could use a rewrite to make the interactions clear. Maybe someone familiar with this code might give their opinion. Taylor R Campbell writes: > 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)