diff options
Diffstat (limited to 'src')
| -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 |