emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 36440b1: Remove unecessary unlock-buffer calls


From: Eli Zaretskii
Subject: master 36440b1: Remove unecessary unlock-buffer calls
Date: Sat, 27 Feb 2021 09:21:53 -0500 (EST)

branch: master
commit 36440b15d3552908614f0bd52f4defed8c1deed5
Author: Matt Armstrong <matt@rfc20.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Remove unecessary unlock-buffer calls
    
    * lisp/files.el (revert-buffer-insert-file-contents--default-function):
    Remove vestigial call to `unlock-buffer'.
    * lisp/simple.el (primitive-undo): Assume unlock-buffer is always
    bound.  (Bug#46701)
---
 lisp/files.el  | 5 -----
 lisp/simple.el | 3 +--
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/lisp/files.el b/lisp/files.el
index 68894ca..e5fa1d8 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -6235,11 +6235,6 @@ an auto-save file."
              "Cannot revert unreadable file %s")
            file-name))
    (t
-    ;; Bind buffer-file-name to nil
-    ;; so that we don't try to lock the file.
-    (let ((buffer-file-name nil))
-      (or auto-save-p
-          (unlock-buffer)))
     (widen)
     (let ((coding-system-for-read
            ;; Auto-saved file should be read by Emacs's
diff --git a/lisp/simple.el b/lisp/simple.el
index 4038613..f805009 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3043,8 +3043,7 @@ Return what remains of the list."
                      (and (consp time)
                           (equal (list (car time) (cdr time))
                                  (visited-file-modtime))))
-             (when (fboundp 'unlock-buffer)
-               (unlock-buffer))
+             (unlock-buffer)
              (set-buffer-modified-p nil)))
           ;; Element (nil PROP VAL BEG . END) is property change.
           (`(nil . ,(or `(,prop ,val ,beg . ,end) pcase--dontcare))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]