From 080db47fc48d9558d11b0b4ac9b55dff625802b6 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 8 Nov 2013 12:21:35 +0200 Subject: [PATCH] Switch cache-long-scans to t by default. src/xdisp.c (message_dolog): Make sure the *Messages* buffer has its cache-long-scans disabled, since we don't want to call prepare_to_modify_buffer (in insert_1_both) for each message we display. src/buffer.h (bset_cache_long_scans): New INLINE function, moved from buffer.c. Improve commentary to the buffer field setter functions. src/buffer.c (bset_cache_long_scans): Static function deleted. Improve commentary to the buffer field setter functions. (init_buffer_once): Default for cache-long-scans changed to t. (Bug#15797) --- src/ChangeLog | 16 ++++++++++++++++ src/buffer.c | 10 +++------- src/buffer.h | 8 +++++++- src/xdisp.c | 1 + 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 9bf71b9ce21..fdb4b24233f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,19 @@ +2013-11-08 Eli Zaretskii + + * xdisp.c (message_dolog): Make sure the *Messages* buffer has its + cache-long-scans disabled, since we don't want to call + prepare_to_modify_buffer (in insert_1_both) for each message we + display. + + * buffer.h (bset_cache_long_scans): New INLINE function, moved + from buffer.c. Improve commentary to the buffer field setter + functions. + + * buffer.c (bset_cache_long_scans): Static function deleted. + Improve commentary to the buffer field setter functions. + (init_buffer_once): Default for cache-long-scans changed to t. + (Bug#15797) + 2013-11-08 Paul Eggert * chartab.c (make_sub_char_table): Fix size typo (Bug#15825). diff --git a/src/buffer.c b/src/buffer.c index d3288ad0429..7a424ffd901 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -154,7 +154,8 @@ CHECK_OVERLAY (Lisp_Object x) CHECK_TYPE (OVERLAYP (x), Qoverlayp, x); } -/* These setters are used only in this file, so they can be private. */ +/* These setters are used only in this file, so they can be private. + The public setters are inline functions defined in buffer.h. */ static void bset_abbrev_mode (struct buffer *b, Lisp_Object val) { @@ -201,11 +202,6 @@ bset_buffer_file_coding_system (struct buffer *b, Lisp_Object val) b->INTERNAL_FIELD (buffer_file_coding_system) = val; } static void -bset_cache_long_scans (struct buffer *b, Lisp_Object val) -{ - b->INTERNAL_FIELD (cache_long_scans) = val; -} -static void bset_case_fold_search (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (case_fold_search) = val; @@ -5185,7 +5181,7 @@ init_buffer_once (void) bset_buffer_file_coding_system (&buffer_defaults, Qnil); XSETFASTINT (BVAR (&buffer_defaults, fill_column), 70); XSETFASTINT (BVAR (&buffer_defaults, left_margin), 0); - bset_cache_long_scans (&buffer_defaults, Qnil); + bset_cache_long_scans (&buffer_defaults, Qt); bset_file_truename (&buffer_defaults, Qnil); XSETFASTINT (BVAR (&buffer_defaults, display_count), 0); XSETFASTINT (BVAR (&buffer_defaults, left_margin_cols), 0); diff --git a/src/buffer.h b/src/buffer.h index a36c0d13c9e..f39e3d33185 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -871,13 +871,19 @@ struct buffer }; /* Most code should use these functions to set Lisp fields in struct - buffer. */ + buffer. (Some setters that are priviate to a single .c file are + defined as static in those files.) */ INLINE void bset_bidi_paragraph_direction (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (bidi_paragraph_direction) = val; } INLINE void +bset_cache_long_scans (struct buffer *b, Lisp_Object val) +{ + b->INTERNAL_FIELD (cache_long_scans) = val; +} +INLINE void bset_case_canon_table (struct buffer *b, Lisp_Object val) { b->INTERNAL_FIELD (case_canon_table) = val; diff --git a/src/xdisp.c b/src/xdisp.c index 021147ecba8..d6269f24413 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -9488,6 +9488,7 @@ message_dolog (const char *m, ptrdiff_t nbytes, bool nlflag, bool multibyte) } bset_undo_list (current_buffer, Qt); + bset_cache_long_scans (current_buffer, Qnil); oldpoint = message_dolog_marker1; set_marker_restricted_both (oldpoint, Qnil, PT, PT_BYTE); -- 2.39.2