diff options
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c index 6a11569c85a..f2f15a54743 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -387,6 +387,7 @@ The value is never nil. */) | |||
| 387 | BUF_ZV_BYTE (b) = BEG_BYTE; | 387 | BUF_ZV_BYTE (b) = BEG_BYTE; |
| 388 | BUF_Z_BYTE (b) = BEG_BYTE; | 388 | BUF_Z_BYTE (b) = BEG_BYTE; |
| 389 | BUF_MODIFF (b) = 1; | 389 | BUF_MODIFF (b) = 1; |
| 390 | BUF_CHARS_MODIFF (b) = 1; | ||
| 390 | BUF_OVERLAY_MODIFF (b) = 1; | 391 | BUF_OVERLAY_MODIFF (b) = 1; |
| 391 | BUF_SAVE_MODIFF (b) = 1; | 392 | BUF_SAVE_MODIFF (b) = 1; |
| 392 | BUF_INTERVALS (b) = 0; | 393 | BUF_INTERVALS (b) = 0; |
| @@ -1161,6 +1162,31 @@ No argument or nil as argument means use current buffer as BUFFER. */) | |||
| 1161 | 1162 | ||
| 1162 | return make_number (BUF_MODIFF (buf)); | 1163 | return make_number (BUF_MODIFF (buf)); |
| 1163 | } | 1164 | } |
| 1165 | |||
| 1166 | DEFUN ("buffer-chars-modified-tick", Fbuffer_chars_modified_tick, | ||
| 1167 | Sbuffer_chars_modified_tick, 0, 1, 0, | ||
| 1168 | doc: /* Return BUFFER's character-change tick counter. | ||
| 1169 | Each buffer has a character-change tick counter, which is set to the | ||
| 1170 | value of the buffer's tick counter \(see `buffer-modified-tick'), each | ||
| 1171 | time text in that buffer is inserted or deleted. By comparing the | ||
| 1172 | values returned by two individual calls of `buffer-chars-modified-tick', | ||
| 1173 | you can tell whether a character change occurred in that buffer in | ||
| 1174 | between these calls. No argument or nil as argument means use current | ||
| 1175 | buffer as BUFFER. */) | ||
| 1176 | (buffer) | ||
| 1177 | register Lisp_Object buffer; | ||
| 1178 | { | ||
| 1179 | register struct buffer *buf; | ||
| 1180 | if (NILP (buffer)) | ||
| 1181 | buf = current_buffer; | ||
| 1182 | else | ||
| 1183 | { | ||
| 1184 | CHECK_BUFFER (buffer); | ||
| 1185 | buf = XBUFFER (buffer); | ||
| 1186 | } | ||
| 1187 | |||
| 1188 | return make_number (BUF_CHARS_MODIFF (buf)); | ||
| 1189 | } | ||
| 1164 | 1190 | ||
| 1165 | DEFUN ("rename-buffer", Frename_buffer, Srename_buffer, 1, 2, | 1191 | DEFUN ("rename-buffer", Frename_buffer, Srename_buffer, 1, 2, |
| 1166 | "sRename buffer (to new name): \nP", | 1192 | "sRename buffer (to new name): \nP", |
| @@ -5495,7 +5521,7 @@ A string is printed verbatim in the mode line except for %-constructs: | |||
| 5495 | or print Bottom or All. | 5521 | or print Bottom or All. |
| 5496 | %n -- print Narrow if appropriate. | 5522 | %n -- print Narrow if appropriate. |
| 5497 | %t -- visited file is text or binary (if OS supports this distinction). | 5523 | %t -- visited file is text or binary (if OS supports this distinction). |
| 5498 | %z -- print mnemonics of buffer, terminal, and keyboard coding systems. | 5524 | %z -- print mnemonics of keyboard, terminal, and buffer coding systems. |
| 5499 | %Z -- like %z, but including the end-of-line format. | 5525 | %Z -- like %z, but including the end-of-line format. |
| 5500 | %e -- print error message about full memory. | 5526 | %e -- print error message about full memory. |
| 5501 | %[ -- print one [ for each recursive editing level. %] similar. | 5527 | %[ -- print one [ for each recursive editing level. %] similar. |
| @@ -6074,6 +6100,7 @@ The function `kill-all-local-variables' runs this before doing anything else. * | |||
| 6074 | defsubr (&Sbuffer_modified_p); | 6100 | defsubr (&Sbuffer_modified_p); |
| 6075 | defsubr (&Sset_buffer_modified_p); | 6101 | defsubr (&Sset_buffer_modified_p); |
| 6076 | defsubr (&Sbuffer_modified_tick); | 6102 | defsubr (&Sbuffer_modified_tick); |
| 6103 | defsubr (&Sbuffer_chars_modified_tick); | ||
| 6077 | defsubr (&Srename_buffer); | 6104 | defsubr (&Srename_buffer); |
| 6078 | defsubr (&Sother_buffer); | 6105 | defsubr (&Sother_buffer); |
| 6079 | defsubr (&Sbuffer_enable_undo); | 6106 | defsubr (&Sbuffer_enable_undo); |