From: Konstantin Kharlamov <hi-angel@yandex.ru>
To: 49893@debbugs.gnu.org
Subject: bug#49893: [PATCH] Reset mtime of a reverted buffer
Date: Thu, 05 Aug 2021 18:28:28 +0300 [thread overview]
Message-ID: <40b594e36f8d8d8b200b91238d2208c8d25fd2c9.camel@yandex.ru> (raw)
[-- 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
next reply other threads:[~2021-08-05 15:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-05 15:28 Konstantin Kharlamov [this message]
2021-08-05 16:36 ` bug#49893: [PATCH] Reset mtime of a reverted buffer Eli Zaretskii
2021-08-05 16:54 ` Konstantin Kharlamov
2021-08-05 17:51 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40b594e36f8d8d8b200b91238d2208c8d25fd2c9.camel@yandex.ru \
--to=hi-angel@yandex.ru \
--cc=49893@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.