summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVisuwesh <visuweshm@gmail.com>2025-10-18 18:31:00 +0200
committerPhilip Kaludercic <pkal@posteo.net>2025-10-18 18:31:24 +0200
commit0cb6b9cb842b1607c06acdc0818175623e3f004a (patch)
treedb946a150c5813d2336dd67187f7971feedc5258
parent28412c81c3b046616fd8edf82d05bb2d83d0c306 (diff)
Ensure that 'vc-backup-find-file-hook' is setexternals/vc-backup
We need this to ensure that having vc-backup active doesn't suppress the generation of backup files.
-rw-r--r--vc-backup.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/vc-backup.el b/vc-backup.el
index 963f57e..177dd71 100644
--- a/vc-backup.el
+++ b/vc-backup.el
@@ -1,6 +1,6 @@
;;; vc-backup.el --- VC backend for versioned backups -*- lexical-binding: t; -*-
-;; Copyright (C) 2021, 2022 Free Software Foundation, Inc.
+;; Copyright (C) 2021, 2022, 2025 Free Software Foundation, Inc.
;; Author: Philip Kaludercic <philipk@posteo.net>
;; Maintainer: Philip Kaludercic <philipk@posteo.net>
@@ -102,7 +102,7 @@
;; - check-headers () ??
;; - delete-file (file) OK
;; - rename-file (old new) OK
-;; - find-file-hook () ??
+;; - find-file-hook () OK
;; - extra-menu () ??
;; - extra-dir-menu () ??
;; - conflicted-files (dir) ??
@@ -445,6 +445,13 @@ BUFFER and ASYNC as interpreted as specified in vc.el."
;; - find-file-hook ()
+;; We need this ugly hack because vc-backup, being a vc backend,
+;; blocks the creation of backup files. We work around it by setting
+;; `vc-make-backup-files' to t buffer-locally.
+(defun vc-backup-find-file-hook ()
+ "Ensure that backup file generation is enabled for current buffer."
+ (setq-local vc-make-backup-files t))
+
;; - extra-menu ()
;; - extra-dir-menu ()