X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/362b9d483c714a8fd87966ddbd8686850f870e34..c530e1c2a3a036d71942c354ba11b30a06341fd7:/src/insdel.c diff --git a/src/insdel.c b/src/insdel.c index 70f51646b0..db76f770da 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -1,6 +1,5 @@ /* Buffer insertion/deletion and gap motion for GNU Emacs. - Copyright (C) 1985, 1986, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 + Copyright (C) 1985-1986, 1993-1995, 1997-2011 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -53,10 +52,6 @@ static void adjust_point (EMACS_INT nchars, EMACS_INT nbytes); Lisp_Object Fcombine_after_change_execute (void); -/* Non-nil means don't call the after-change-functions right away, - just record an element in combine_after_change_list. */ -Lisp_Object Vcombine_after_change_calls; - /* List of elements of the form (BEG-UNCHANGED END-UNCHANGED CHANGE-AMOUNT) describing changes which happened while combine_after_change_calls was nonzero. We use this to decide how to call them @@ -74,10 +69,6 @@ Lisp_Object combine_after_change_buffer; Lisp_Object Qinhibit_modification_hooks; -/* Check all markers in the current buffer, looking for something invalid. */ - -static int check_markers_debug_flag; - #define CHECK_MARKERS() \ if (check_markers_debug_flag) \ check_markers (); \ @@ -677,11 +668,11 @@ count_size_as_multibyte (const unsigned char *ptr, EMACS_INT nbytes) prepare_to_modify_buffer could relocate the text. */ void -insert (const unsigned char *string, EMACS_INT nbytes) +insert (const char *string, EMACS_INT nbytes) { if (nbytes > 0) { - EMACS_INT len = chars_in_text (string, nbytes), opoint; + EMACS_INT len = chars_in_text ((unsigned char *) string, nbytes), opoint; insert_1_both (string, len, nbytes, 0, 1, 0); opoint = PT - len; signal_after_change (opoint, 0, len); @@ -692,11 +683,11 @@ insert (const unsigned char *string, EMACS_INT nbytes) /* Likewise, but inherit text properties from neighboring characters. */ void -insert_and_inherit (const unsigned char *string, EMACS_INT nbytes) +insert_and_inherit (const char *string, EMACS_INT nbytes) { if (nbytes > 0) { - EMACS_INT len = chars_in_text (string, nbytes), opoint; + EMACS_INT len = chars_in_text ((unsigned char *) string, nbytes), opoint; insert_1_both (string, len, nbytes, 1, 1, 0); opoint = PT - len; signal_after_change (opoint, 0, len); @@ -720,7 +711,7 @@ insert_char (int c) str[0] = c; } - insert (str, len); + insert ((char *) str, len); } /* Insert the null-terminated string S before point. */ @@ -737,11 +728,11 @@ insert_string (const char *s) since gc could happen and relocate it. */ void -insert_before_markers (const unsigned char *string, EMACS_INT nbytes) +insert_before_markers (const char *string, EMACS_INT nbytes) { if (nbytes > 0) { - EMACS_INT len = chars_in_text (string, nbytes), opoint; + EMACS_INT len = chars_in_text ((unsigned char *) string, nbytes), opoint; insert_1_both (string, len, nbytes, 0, 1, 1); opoint = PT - len; signal_after_change (opoint, 0, len); @@ -752,12 +743,12 @@ insert_before_markers (const unsigned char *string, EMACS_INT nbytes) /* Likewise, but inherit text properties from neighboring characters. */ void -insert_before_markers_and_inherit (const unsigned char *string, +insert_before_markers_and_inherit (const char *string, EMACS_INT nbytes) { if (nbytes > 0) { - EMACS_INT len = chars_in_text (string, nbytes), opoint; + EMACS_INT len = chars_in_text ((unsigned char *) string, nbytes), opoint; insert_1_both (string, len, nbytes, 1, 1, 1); opoint = PT - len; signal_after_change (opoint, 0, len); @@ -768,11 +759,11 @@ insert_before_markers_and_inherit (const unsigned char *string, /* Subroutine used by the insert functions above. */ void -insert_1 (const unsigned char *string, EMACS_INT nbytes, +insert_1 (const char *string, EMACS_INT nbytes, int inherit, int prepare, int before_markers) { - insert_1_both (string, chars_in_text (string, nbytes), nbytes, - inherit, prepare, before_markers); + insert_1_both (string, chars_in_text ((unsigned char *) string, nbytes), + nbytes, inherit, prepare, before_markers); } @@ -893,7 +884,7 @@ count_combining_after (const unsigned char *string, are the same as in insert_1. */ void -insert_1_both (const unsigned char *string, +insert_1_both (const char *string, EMACS_INT nchars, EMACS_INT nbytes, int inherit, int prepare, int before_markers) { @@ -2374,14 +2365,14 @@ syms_of_insdel (void) combine_after_change_list = Qnil; combine_after_change_buffer = Qnil; - DEFVAR_BOOL ("check-markers-debug-flag", &check_markers_debug_flag, + DEFVAR_BOOL ("check-markers-debug-flag", check_markers_debug_flag, doc: /* Non-nil means enable debugging checks for invalid marker positions. */); check_markers_debug_flag = 0; - DEFVAR_LISP ("combine-after-change-calls", &Vcombine_after_change_calls, + DEFVAR_LISP ("combine-after-change-calls", Vcombine_after_change_calls, doc: /* Used internally by the `combine-after-change-calls' macro. */); Vcombine_after_change_calls = Qnil; - DEFVAR_BOOL ("inhibit-modification-hooks", &inhibit_modification_hooks, + DEFVAR_BOOL ("inhibit-modification-hooks", inhibit_modification_hooks, doc: /* Non-nil means don't run any of the hooks that respond to buffer changes. This affects `before-change-functions' and `after-change-functions', as well as hooks attached to text properties and overlays. */); @@ -2391,4 +2382,3 @@ as well as hooks attached to text properties and overlays. */); defsubr (&Scombine_after_change_execute); } -