diff options
| author | Stefan Monnier | 2017-12-28 14:03:07 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2017-12-28 14:03:07 -0500 |
| commit | e879a5444a86e8fc030bbef69fbb8d84e9961fa3 (patch) | |
| tree | 53aa45c1f9945499941715085537337f78f325f4 /src/buffer.c | |
| parent | 81b1028b63b7d56a9483606fc7c656dd5cee28af (diff) | |
| download | emacs-e879a5444a86e8fc030bbef69fbb8d84e9961fa3.tar.gz emacs-e879a5444a86e8fc030bbef69fbb8d84e9961fa3.zip | |
* src/buffer.c (Frestore_buffer_modified_p): Fix bug#29846
Don't mess with the lock file when inhibit_modification_hooks is set,
just like we do in prepare_to_modify_buffer_1.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/buffer.c b/src/buffer.c index bcde2c80989..7ed21f0e327 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -1354,7 +1354,6 @@ It is not ensured that mode lines will be updated to show the modified | |||
| 1354 | state of the current buffer. Use with care. */) | 1354 | state of the current buffer. Use with care. */) |
| 1355 | (Lisp_Object flag) | 1355 | (Lisp_Object flag) |
| 1356 | { | 1356 | { |
| 1357 | Lisp_Object fn; | ||
| 1358 | 1357 | ||
| 1359 | /* If buffer becoming modified, lock the file. | 1358 | /* If buffer becoming modified, lock the file. |
| 1360 | If buffer becoming unmodified, unlock the file. */ | 1359 | If buffer becoming unmodified, unlock the file. */ |
| @@ -1363,15 +1362,18 @@ state of the current buffer. Use with care. */) | |||
| 1363 | ? current_buffer->base_buffer | 1362 | ? current_buffer->base_buffer |
| 1364 | : current_buffer; | 1363 | : current_buffer; |
| 1365 | 1364 | ||
| 1366 | fn = BVAR (b, file_truename); | 1365 | if (!inhibit_modification_hooks) |
| 1367 | /* Test buffer-file-name so that binding it to nil is effective. */ | ||
| 1368 | if (!NILP (fn) && ! NILP (BVAR (b, filename))) | ||
| 1369 | { | 1366 | { |
| 1370 | bool already = SAVE_MODIFF < MODIFF; | 1367 | Lisp_Object fn = BVAR (b, file_truename); |
| 1371 | if (!already && !NILP (flag)) | 1368 | /* Test buffer-file-name so that binding it to nil is effective. */ |
| 1372 | lock_file (fn); | 1369 | if (!NILP (fn) && ! NILP (BVAR (b, filename))) |
| 1373 | else if (already && NILP (flag)) | 1370 | { |
| 1374 | unlock_file (fn); | 1371 | bool already = SAVE_MODIFF < MODIFF; |
| 1372 | if (!already && !NILP (flag)) | ||
| 1373 | lock_file (fn); | ||
| 1374 | else if (already && NILP (flag)) | ||
| 1375 | unlock_file (fn); | ||
| 1376 | } | ||
| 1375 | } | 1377 | } |
| 1376 | 1378 | ||
| 1377 | /* Here we have a problem. SAVE_MODIFF is used here to encode | 1379 | /* Here we have a problem. SAVE_MODIFF is used here to encode |