From: Eli Zaretskii <eliz@gnu.org>
To: Matt Armstrong <matt@rfc20.org>
Cc: 46701@debbugs.gnu.org
Subject: bug#46701: [PATCH] small cleanups related to `unlock-buffer'
Date: Mon, 22 Feb 2021 18:27:29 +0200 [thread overview]
Message-ID: <831rd8vzim.fsf@gnu.org> (raw)
In-Reply-To: <m2y2fgybtn.fsf@matts-mbp-2016.lan> (message from Matt Armstrong on Sun, 21 Feb 2021 20:18:44 -0800)
> From: Matt Armstrong <matt@rfc20.org>
> Date: Sun, 21 Feb 2021 20:18:44 -0800
>
> Subject: [PATCH 1/4] Remove unecessary (unlock-buffer) calls.
>
> * lisp/type-break.el (type-break-mode): Remove an (unlock-buffer) call
> implied by (set-buffer-modified nil).
> * lisp/simple.el (primitive-undo): ditto.
My reading of the code is that the above is true only if
inhibit-modification-hooks is nil. Otherwise, these calls are not
no-ops.
> --- a/lisp/files.el
> +++ b/lisp/files.el
> @@ -6234,11 +6234,8 @@ revert-buffer-insert-file-contents--default-function
> "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)))
> + (unless auto-save-p
> + (unlock-buffer))
And here, I think we just forgot to update the Lisp code when
unlock-buffer started to look at buffer-file-truename instead of
buffer-file-name. But otherwise, I see no reason why we should remove
the call to unlock-buffer; what did I miss?
Thanks.
next prev parent reply other threads:[~2021-02-22 16:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-22 4:18 bug#46701: [PATCH] small cleanups related to `unlock-buffer' Matt Armstrong
2021-02-22 16:27 ` Eli Zaretskii [this message]
2021-02-23 0:56 ` Matt Armstrong
2021-02-26 0:45 ` Stefan Kangas
2021-02-27 14:22 ` Eli Zaretskii
2021-02-27 14:24 ` 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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=831rd8vzim.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=46701@debbugs.gnu.org \
--cc=matt@rfc20.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 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).