diff options
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/src/buffer.c b/src/buffer.c index 38593b486c1..c9623cd4347 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -109,6 +109,8 @@ Lisp_Object Vbuffer_alist; | |||
| 109 | /* Functions to call before and after each text change. */ | 109 | /* Functions to call before and after each text change. */ |
| 110 | Lisp_Object Vbefore_change_function; | 110 | Lisp_Object Vbefore_change_function; |
| 111 | Lisp_Object Vafter_change_function; | 111 | Lisp_Object Vafter_change_function; |
| 112 | Lisp_Object Vbefore_change_functions; | ||
| 113 | Lisp_Object Vafter_change_functions; | ||
| 112 | 114 | ||
| 113 | Lisp_Object Vtransient_mark_mode; | 115 | Lisp_Object Vtransient_mark_mode; |
| 114 | 116 | ||
| @@ -2586,8 +2588,8 @@ the beginning and end of the range of old text to be changed.\n\ | |||
| 2586 | No information is given about the length of the text after the change.\n\ | 2588 | No information is given about the length of the text after the change.\n\ |
| 2587 | position of the change\n\ | 2589 | position of the change\n\ |
| 2588 | \n\ | 2590 | \n\ |
| 2589 | While executing the `before-change-function', changes to buffers do not\n\ | 2591 | Buffer changes made while executing the `before-change-function'\n\ |
| 2590 | cause calls to any `before-change-function' or `after-change-function'."); | 2592 | don't call any before-change or after-change functions."); |
| 2591 | Vbefore_change_function = Qnil; | 2593 | Vbefore_change_function = Qnil; |
| 2592 | 2594 | ||
| 2593 | DEFVAR_LISP ("after-change-function", &Vafter_change_function, | 2595 | DEFVAR_LISP ("after-change-function", &Vafter_change_function, |
| @@ -2599,10 +2601,35 @@ and the length of the pre-change text replaced by that range.\n\ | |||
| 2599 | for a deletion, that length is the number of characters deleted,\n\ | 2601 | for a deletion, that length is the number of characters deleted,\n\ |
| 2600 | and the post-change beginning and end are at the same place.)\n\ | 2602 | and the post-change beginning and end are at the same place.)\n\ |
| 2601 | \n\ | 2603 | \n\ |
| 2602 | While executing the `after-change-function', changes to buffers do not\n\ | 2604 | Buffer changes made while executing the `after-change-function'\n\ |
| 2603 | cause calls to any `before-change-function' or `after-change-function'."); | 2605 | don't call any before-change or after-change functions."); |
| 2604 | Vafter_change_function = Qnil; | 2606 | Vafter_change_function = Qnil; |
| 2605 | 2607 | ||
| 2608 | DEFVAR_LISP ("before-change-functions", &Vbefore_change_functions, | ||
| 2609 | "List of functions to call before each text change.\n\ | ||
| 2610 | Two arguments are passed to each function: the positions of\n\ | ||
| 2611 | the beginning and end of the range of old text to be changed.\n\ | ||
| 2612 | \(For an insertion, the beginning and end are at the same place.)\n\ | ||
| 2613 | No information is given about the length of the text after the change.\n\ | ||
| 2614 | position of the change\n\ | ||
| 2615 | \n\ | ||
| 2616 | Buffer changes made while executing the `before-change-functions'\n\ | ||
| 2617 | don't call any before-change or after-change functions."); | ||
| 2618 | Vbefore_change_functions = Qnil; | ||
| 2619 | |||
| 2620 | DEFVAR_LISP ("after-change-functions", &Vafter_change_functions, | ||
| 2621 | "List of function to call after each text change.\n\ | ||
| 2622 | Three arguments are passed to each function: the positions of\n\ | ||
| 2623 | the beginning and end of the range of changed text,\n\ | ||
| 2624 | and the length of the pre-change text replaced by that range.\n\ | ||
| 2625 | \(For an insertion, the pre-change length is zero;\n\ | ||
| 2626 | for a deletion, that length is the number of characters deleted,\n\ | ||
| 2627 | and the post-change beginning and end are at the same place.)\n\ | ||
| 2628 | \n\ | ||
| 2629 | Buffer changes made while executing the `after-change-functions'\n\ | ||
| 2630 | don't call any before-change or after-change functions."); | ||
| 2631 | Vafter_change_functions = Qnil; | ||
| 2632 | |||
| 2606 | DEFVAR_LISP ("first-change-hook", &Vfirst_change_hook, | 2633 | DEFVAR_LISP ("first-change-hook", &Vfirst_change_hook, |
| 2607 | "A list of functions to call before changing a buffer which is unmodified.\n\ | 2634 | "A list of functions to call before changing a buffer which is unmodified.\n\ |
| 2608 | The functions are run using the `run-hooks' function."); | 2635 | The functions are run using the `run-hooks' function."); |