unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#49893: [PATCH] Reset mtime of a reverted buffer
@ 2021-08-05 15:28 Konstantin Kharlamov
  2021-08-05 16:36 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Konstantin Kharlamov @ 2021-08-05 15:28 UTC (permalink / raw)
  To: 49893

[-- Attachment #1: Type: text/plain, Size: 106 bytes --]

Patch is attached. This resolves the problem reported at https://github.com/emacs-evil/evil/issues/1504



[-- Attachment #2: 1.patch --]
[-- Type: text/x-patch, Size: 994 bytes --]

From 99266c4ba2d0391572a9b06149a0f50031bb44a2 Mon Sep 17 00:00:00 2001
From: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Date: Thu, 5 Aug 2021 18:25:56 +0300
Subject: [PATCH] Reset mtime of a reverted buffer

* lisp/files.el (revert-buffer-insert-file-contents-delicately):
Once buffer is reverted, reset its mtime to that of the file.
---
 lisp/files.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/files.el b/lisp/files.el
index 2b13d04bcbe..c2607956915 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -6533,7 +6533,8 @@ revert-buffer-insert-file-contents-delicately
       ;; See comments in revert-buffer-with-fine-grain for an explanation.
       (defun revert-buffer-with-fine-grain-success-p ()
         success))
-    (set-buffer-modified-p nil))))
+    (set-buffer-modified-p nil)
+    (set-visited-file-modtime))))
 
 (defun revert-buffer-with-fine-grain (&optional ignore-auto noconfirm)
   "Revert buffer preserving markers, overlays, etc.
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-05 17:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-05 15:28 bug#49893: [PATCH] Reset mtime of a reverted buffer Konstantin Kharlamov
2021-08-05 16:36 ` Eli Zaretskii
2021-08-05 16:54   ` Konstantin Kharlamov
2021-08-05 17:51     ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).