diff options
| author | Eli Zaretskii | 2020-11-07 12:29:41 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2020-11-07 12:29:41 +0200 |
| commit | a5867ddfbd721568005175bf6c725f7834b21ea4 (patch) | |
| tree | de702b8a5a7fbc0a328577f08b5653d595f1b0fc /src | |
| parent | bc76afd355c0a6608830e2b43c8c67243aa0fa7b (diff) | |
| download | emacs-a5867ddfbd721568005175bf6c725f7834b21ea4.tar.gz emacs-a5867ddfbd721568005175bf6c725f7834b21ea4.zip | |
Don't leave lock files after 'replace-buffer-contents'
* src/editfns.c (Freplace_buffer_contents): Unlock the buffer's
file if no changes have been made. (Bug#44303)
Diffstat (limited to 'src')
| -rw-r--r-- | src/editfns.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/editfns.c b/src/editfns.c index ca6b8981ebf..aedab476146 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -2117,6 +2117,13 @@ nil. */) | |||
| 2117 | { | 2117 | { |
| 2118 | signal_after_change (BEGV, size_a, ZV - BEGV); | 2118 | signal_after_change (BEGV, size_a, ZV - BEGV); |
| 2119 | update_compositions (BEGV, ZV, CHECK_INSIDE); | 2119 | update_compositions (BEGV, ZV, CHECK_INSIDE); |
| 2120 | /* We've locked the buffer's file above in | ||
| 2121 | prepare_to_modify_buffer; if the buffer is unchanged at this | ||
| 2122 | point, i.e. no insertions or deletions have been made, unlock | ||
| 2123 | the file now. */ | ||
| 2124 | if (SAVE_MODIFF == MODIFF | ||
| 2125 | && STRINGP (BVAR (a, file_truename))) | ||
| 2126 | unlock_file (BVAR (a, file_truename)); | ||
| 2120 | } | 2127 | } |
| 2121 | 2128 | ||
| 2122 | return Qt; | 2129 | return Qt; |