Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
460e6bae
Commit
460e6bae
authored
May 16, 2001
by
Gerd Moellmann
Browse files
(signal_before_change, signal_after_change): Consider a
local change hook which changes the buffer.
parent
99c78ce8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
8 deletions
+40
-8
src/ChangeLog
src/ChangeLog
+4
-1
src/insdel.c
src/insdel.c
+36
-7
No files found.
src/ChangeLog
View file @
460e6bae
2001-05-14 Dave Love <fx@gnu.org>
2001-05-16 Dave Love <fx@gnu.org>
* insdel.c (signal_before_change, signal_after_change): Consider a
local change hook which changes the buffer.
* process.c (read_process_output): Don't call signal_after_change
and update_compositions after insert_from_string_before_markers.
...
...
src/insdel.c
View file @
460e6bae
/* Buffer insertion/deletion and gap motion for GNU Emacs.
Copyright (C) 1985, 86,93,94,95,97,98, 1999, 2000 Free Software Foundation, Inc.
Copyright (C) 1985, 86,93,94,95,97,98, 1999, 2000, 2001
Free Software Foundation, Inc.
This file is part of GNU Emacs.
...
...
@@ -1901,6 +1902,8 @@ signal_before_change (start_int, end_int, preserve_ptr)
Lisp_Object
before_change_functions
;
Lisp_Object
after_change_functions
;
struct
gcpro
gcpro1
,
gcpro2
;
struct
buffer
*
old
=
current_buffer
;
struct
buffer
*
new
;
PRESERVE_VALUE
;
PRESERVE_START_END
;
...
...
@@ -1920,9 +1923,21 @@ signal_before_change (start_int, end_int, preserve_ptr)
args
[
2
]
=
FETCH_END
;
run_hook_list_with_args
(
before_change_functions
,
3
,
args
);
/* "Unbind" the variables we "bound" to nil. */
Vbefore_change_functions
=
before_change_functions
;
Vafter_change_functions
=
after_change_functions
;
/* "Unbind" the variables we "bound" to nil. Beware a
buffer-local hook which changes the buffer when run (e.g. W3). */
if
(
old
!=
current_buffer
)
{
new
=
current_buffer
;
set_buffer_internal
(
old
);
Vbefore_change_functions
=
before_change_functions
;
Vafter_change_functions
=
after_change_functions
;
set_buffer_internal
(
new
);
}
else
{
Vbefore_change_functions
=
before_change_functions
;
Vafter_change_functions
=
after_change_functions
;
}
UNGCPRO
;
}
...
...
@@ -1988,6 +2003,8 @@ signal_after_change (charpos, lendel, lenins)
Lisp_Object
args
[
4
];
Lisp_Object
before_change_functions
;
Lisp_Object
after_change_functions
;
struct
buffer
*
old
=
current_buffer
;
struct
buffer
*
new
;
struct
gcpro
gcpro1
,
gcpro2
;
/* "Bind" before-change-functions and after-change-functions
...
...
@@ -2007,9 +2024,21 @@ signal_after_change (charpos, lendel, lenins)
run_hook_list_with_args
(
after_change_functions
,
4
,
args
);
/* "Unbind" the variables we "bound" to nil. */
Vbefore_change_functions
=
before_change_functions
;
Vafter_change_functions
=
after_change_functions
;
/* "Unbind" the variables we "bound" to nil. Beware a
buffer-local hook which changes the buffer when run (e.g. W3). */
if
(
old
!=
current_buffer
)
{
new
=
current_buffer
;
set_buffer_internal
(
old
);
Vbefore_change_functions
=
before_change_functions
;
Vafter_change_functions
=
after_change_functions
;
set_buffer_internal
(
new
);
}
else
{
Vbefore_change_functions
=
before_change_functions
;
Vafter_change_functions
=
after_change_functions
;
}
UNGCPRO
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment