From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: philip@warpmail.net (Philip K.) Newsgroups: gmane.emacs.bugs Subject: bug#41060: [PATCH] Use write-region when saving recentf file Date: Sun, 03 May 2020 18:43:01 +0200 Message-ID: <87zhapx94a.fsf@bulbul> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="6727"; mail-complaints-to="usenet@ciao.gmane.io" To: 41060@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 03 21:15:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jVK51-0001cH-JG for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 03 May 2020 21:15:12 +0200 Original-Received: from localhost ([::1]:49660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVK50-0000fo-A2 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 03 May 2020 15:15:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34418) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVK4t-0000fc-4a for bug-gnu-emacs@gnu.org; Sun, 03 May 2020 15:15:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46492) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jVK4s-0003L8-2p for bug-gnu-emacs@gnu.org; Sun, 03 May 2020 15:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jVK4r-0005QW-Tu for bug-gnu-emacs@gnu.org; Sun, 03 May 2020 15:15:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: philip@warpmail.net (Philip K.) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 03 May 2020 19:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41060 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.158853329420826 (code B ref -1); Sun, 03 May 2020 19:15:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 May 2020 19:14:54 +0000 Original-Received: from localhost ([127.0.0.1]:58038 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jVK4k-0005Pq-Ix for submit@debbugs.gnu.org; Sun, 03 May 2020 15:14:54 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:54932) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jVK4j-0005Pj-0y for submit@debbugs.gnu.org; Sun, 03 May 2020 15:14:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34416) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVK4i-0000f1-PF for bug-gnu-emacs@gnu.org; Sun, 03 May 2020 15:14:52 -0400 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:52421) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVK4g-0003KM-Gm for bug-gnu-emacs@gnu.org; Sun, 03 May 2020 15:14:52 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 94FE75C00A0 for ; Sun, 3 May 2020 15:14:48 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 03 May 2020 15:14:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=warpmail.net; h= resent-from:resent-date:resent-to:from:to:subject:date :message-id:mime-version:content-type:resent-message-id; s=fm3; bh=qTJJNdQctpcgMioX9C+jtZucJBy1Fk9dlG0tCoyUtpw=; b=BhTOQmS6+yY9 APxQx+/eIQ3t3RyVp4ZLCwM6WWHM8ydyBw35GbJEIC7jUPpWkh8PZZxlgL9pDwyX GK2bgC9fQhh8BvAnQygtOq1RBxMq+ixjg8OA9k8wML+RzoKua21CQ9E4bq4OIuJn Li10hqTv8qLzrKgAXRtgAqtdlux6Q/qnOU1JtsuULUArzZyInyNmkXLP/4/28+gy v4d+t5gRLICMMmzkf88TJN52f8oJ73Ng28fFqtVx7rmU8lWs2E8S8craVmSxowED S1z4iJNmDcN9HRjNwmbUW4tsv1/lHXZVL+dj8Ys9i3PHLU7M9VC0FvggsMfRDBns bsUDLcG2cA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:resent-date:resent-from:resent-message-id :resent-to:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=qTJJNdQctpcgMioX9C+jtZucJBy1F k9dlG0tCoyUtpw=; b=DjdKbvn0hnegqW2fst4EF8ygsJ+tWCCpx8VGAGi9HoFZz 3SCwsf3Oy3s2SK45oj7nARC2FOrqUBjUtBGySoc1DZizIUIfoMrafkzXSy7EaDA1 9cW3UiNcVASL3RmvQ7h8vzw8HguQs0bCI5XfA9Av19q+XUXCxlP35iwlumgtubGk ePM/kw3qMrUyjZ+5gZjB4Bvgqy5ku7rhFuZHQjtfo+UW8Ul93qEOJpuextDEZ8R0 vfdDcrTF47j9TMw5eWcDs16VSA9ak83CIz6dzGNTsLH4fnGjlLtmyzSU6p5PZynW jXWxWleWhw+8GPrZY9O7S8E9F2oE+JGSmQDQyUFYw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrjedvgddufeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkgggtsehmtderredttd dtnecuhfhrohhmpehphhhilhhiphesfigrrhhpmhgrihhlrdhnvghtucdlrfhhihhlihhp ucfmrddmnecuggftrfgrthhtvghrnhephfefhfeuvdeljeeitddtveevjedvgfekgfdtff ekhfejgfefleeihefgffefveeknecukfhppeekjedrudeghedrudefrdduuddtnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhhihhlihhpse ifrghrphhmrghilhdrnhgvth X-ME-Proxy: Original-Received: from localhost (p57910d6e.dip0.t-ipconnect.de [87.145.13.110]) by mail.messagingengine.com (Postfix) with ESMTPA id 24689328005E for ; Sun, 3 May 2020 15:14:48 -0400 (EDT) Resent-From: philip@warpmail.net Resent-Date: 3 May 2020 21:14:45 +0200 Resent-To: bug-gnu-emacs@gnu.org X-RMAIL-ATTRIBUTES: -------- Resent-Message-Id: <20200503191448.24689328005E@mailuser.nyi.internal> Received-SPF: pass client-ip=66.111.4.29; envelope-from=philip@warpmail.net; helo=out5-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/03 15:14:48 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:179607 Archived-At: --=-=-= Content-Type: text/plain I've been playing around with enabling "version-control" for backups, and what I have been noticing is that the ~/.emacs.d/recentf file has had a lot of backups, far more that regular files that I use. My understanding is that this happens because recentf currently uses write-file (that in turn uses the backup'ing save-buffer) instead of directly writing the temporary buffer to the disk. This patch does just that, replacing write-file with write-region, because I argue that an automatically generated file doesn't need backups. -- Philip K. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Use-write-region-when-saving-recentf-file.patch >>From 25700db3f6e8e282f86f1cd3ccc77250834fb7a0 Mon Sep 17 00:00:00 2001 From: Philip K Date: Sun, 3 May 2020 01:13:31 +0200 Subject: [PATCH] Use write-region when saving recentf file --- lisp/recentf.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/recentf.el b/lisp/recentf.el index 27918a9739..877edd4be1 100644 --- a/lisp/recentf.el +++ b/lisp/recentf.el @@ -1289,7 +1289,8 @@ recentf-save-list (insert "\n \n;; Local Variables:\n" (format ";; coding: %s\n" recentf-save-file-coding-system) ";; End:\n") - (write-file (expand-file-name recentf-save-file)) + (write-region (point-min) (point-max) + (expand-file-name recentf-save-file)) (when recentf-save-file-modes (set-file-modes recentf-save-file recentf-save-file-modes)) nil) -- 2.20.1 --=-=-=--