From 36440b15d3552908614f0bd52f4defed8c1deed5 Mon Sep 17 00:00:00 2001 From: Matt Armstrong Date: Mon, 22 Feb 2021 16:40:05 -0800 Subject: [PATCH] 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 68894ca2ce0..e5fa1d8b224 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 403861351c9..f8050091d58 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)) -- 2.39.2