diff options
| author | Gerd Moellmann | 2000-04-09 10:47:46 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-04-09 10:47:46 +0000 |
| commit | a8c21b482ffc1ce36f861cb8be0712bb4ffe8314 (patch) | |
| tree | e8d1e3526da3cfb5c50aa22aa983239c53e4ae32 /src/buffer.c | |
| parent | 3f923efebf0612da750734cc1b3f6f60137c6b12 (diff) | |
| download | emacs-a8c21b482ffc1ce36f861cb8be0712bb4ffe8314.tar.gz emacs-a8c21b482ffc1ce36f861cb8be0712bb4ffe8314.zip | |
(Frestore_buffer_modified_p): New function.
(syms_of_buffer): Defsubr it.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c index 848e9990776..37e0894af94 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -845,6 +845,36 @@ A non-nil FLAG means mark the buffer modified.") | |||
| 845 | return flag; | 845 | return flag; |
| 846 | } | 846 | } |
| 847 | 847 | ||
| 848 | DEFUN ("restore-buffer-modified-p", Frestore_buffer_modified_p, | ||
| 849 | Srestore_buffer_modified_p, 1, 1, 0, | ||
| 850 | "Like `set-buffer-modified-p', with a differences concerning redisplay.\n\ | ||
| 851 | It is not ensured that mode lines will be updated to show the modified\n\ | ||
| 852 | state of the current buffer. Use with care.") | ||
| 853 | (flag) | ||
| 854 | Lisp_Object flag; | ||
| 855 | { | ||
| 856 | #ifdef CLASH_DETECTION | ||
| 857 | Lisp_Object fn; | ||
| 858 | |||
| 859 | /* If buffer becoming modified, lock the file. | ||
| 860 | If buffer becoming unmodified, unlock the file. */ | ||
| 861 | |||
| 862 | fn = current_buffer->file_truename; | ||
| 863 | /* Test buffer-file-name so that binding it to nil is effective. */ | ||
| 864 | if (!NILP (fn) && ! NILP (current_buffer->filename)) | ||
| 865 | { | ||
| 866 | int already = SAVE_MODIFF < MODIFF; | ||
| 867 | if (!already && !NILP (flag)) | ||
| 868 | lock_file (fn); | ||
| 869 | else if (already && NILP (flag)) | ||
| 870 | unlock_file (fn); | ||
| 871 | } | ||
| 872 | #endif /* CLASH_DETECTION */ | ||
| 873 | |||
| 874 | SAVE_MODIFF = NILP (flag) ? MODIFF : 0; | ||
| 875 | return flag; | ||
| 876 | } | ||
| 877 | |||
| 848 | DEFUN ("buffer-modified-tick", Fbuffer_modified_tick, Sbuffer_modified_tick, | 878 | DEFUN ("buffer-modified-tick", Fbuffer_modified_tick, Sbuffer_modified_tick, |
| 849 | 0, 1, 0, | 879 | 0, 1, 0, |
| 850 | "Return BUFFER's tick counter, incremented for each change in text.\n\ | 880 | "Return BUFFER's tick counter, incremented for each change in text.\n\ |
| @@ -4773,6 +4803,7 @@ Values are interpreted as follows:\n\ | |||
| 4773 | defsubr (&Soverlay_lists); | 4803 | defsubr (&Soverlay_lists); |
| 4774 | defsubr (&Soverlay_get); | 4804 | defsubr (&Soverlay_get); |
| 4775 | defsubr (&Soverlay_put); | 4805 | defsubr (&Soverlay_put); |
| 4806 | defsubr (&Srestore_buffer_modified_p); | ||
| 4776 | } | 4807 | } |
| 4777 | 4808 | ||
| 4778 | void | 4809 | void |