summaryrefslogtreecommitdiff
path: root/src/buffer.h
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2019-03-30 12:01:58 +0300
committerEli Zaretskii <eliz@gnu.org>2019-03-30 12:01:58 +0300
commit9c0fa1172fd987a8f23b115145270383a11c12fc (patch)
tree251e79c78ada59224c8a9743e4b13dd9c86df6e5 /src/buffer.h
parent273d7b3ee0f4841c7f3f112aeb2e29db51a642e7 (diff)
downloademacs-9c0fa1172fd987a8f23b115145270383a11c12fc.tar.gz
Don't run buffer-related hooks in " *code conversion work*" buffers
Note: portions of this change were mistakenly pushed as part of an unrelated commit a35a1f6a9. * src/buffer.c (Fget_buffer_create): Set inhibit_buffer_hooks non-zero for temporary buffers created by coding.c. Don't run buffer-list-update-hook for such buffers. (Frename_buffer, Fkill_buffer, record_buffer) (Fbury_buffer_internal): Don't run hooks for buffers whose inhibit_buffer_hooks flag is set. * src/buffer.h (struct buffer): New member inhibit_buffer_hooks. * src/pdumper.c (dump_buffer): Dump the new field. Update the hash value in HASH_buffer_XXX. * src/coding.c (make_conversion_work_buffer): Function deleted; code moved to code_conversion_save. (code_conversion_save): Insert code from make_conversion_work_buffer, but arrange for unwind-protecting the current buffer before switching to the work buffer. This avoids leaving reused_workbuf_in_use set if user presses C-g during encoding/decoding. (Vcode_conversion_workbuf_name): Now external variable. * src/coding.h (Vcode_conversion_reused_workbuf): Declare.
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/buffer.h b/src/buffer.h
index d3528ac50e9..63b162161c6 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -855,6 +855,13 @@ struct buffer
/* Non-zero whenever the narrowing is changed in this buffer. */
bool_bf clip_changed : 1;
+ /* Non-zero for internally used temporary buffers that don't need to
+ run hooks kill-buffer-hook, buffer-list-update-hook, and
+ kill-buffer-query-functions. This is used in coding.c to avoid
+ slowing down en/decoding when there are a lot of these hooks
+ defined. */
+ bool_bf inhibit_buffer_hooks : 1;
+
/* List of overlays that end at or before the current center,
in order of end-position. */
struct Lisp_Overlay *overlays_before;