From: Matt Armstrong Date: Tue, 23 Feb 2021 00:40:05 +0000 (-0800) Subject: Remove unecessary unlock-buffer calls X-Git-Tag: emacs-28.0.90~3519 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=36440b15d3552908614f0bd52f4defed8c1deed5;p=emacs.git 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) --- 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))