aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2013-11-08 12:21:35 +0200
committerEli Zaretskii2013-11-08 12:21:35 +0200
commit080db47fc48d9558d11b0b4ac9b55dff625802b6 (patch)
treec443f6b219969326798cb2fd92e65222cf5a067f /src
parent1606c2d38472f1b95776ce0aa3d07d465db0933e (diff)
downloademacs-080db47fc48d9558d11b0b4ac9b55dff625802b6.tar.gz
emacs-080db47fc48d9558d11b0b4ac9b55dff625802b6.zip
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)
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog16
-rw-r--r--src/buffer.c10
-rw-r--r--src/buffer.h8
-rw-r--r--src/xdisp.c1
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 @@
12013-11-08 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (message_dolog): Make sure the *Messages* buffer has its
4 cache-long-scans disabled, since we don't want to call
5 prepare_to_modify_buffer (in insert_1_both) for each message we
6 display.
7
8 * buffer.h (bset_cache_long_scans): New INLINE function, moved
9 from buffer.c. Improve commentary to the buffer field setter
10 functions.
11
12 * buffer.c (bset_cache_long_scans): Static function deleted.
13 Improve commentary to the buffer field setter functions.
14 (init_buffer_once): Default for cache-long-scans changed to t.
15 (Bug#15797)
16
12013-11-08 Paul Eggert <eggert@cs.ucla.edu> 172013-11-08 Paul Eggert <eggert@cs.ucla.edu>
2 18
3 * chartab.c (make_sub_char_table): Fix size typo (Bug#15825). 19 * 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)
154 CHECK_TYPE (OVERLAYP (x), Qoverlayp, x); 154 CHECK_TYPE (OVERLAYP (x), Qoverlayp, x);
155} 155}
156 156
157/* These setters are used only in this file, so they can be private. */ 157/* These setters are used only in this file, so they can be private.
158 The public setters are inline functions defined in buffer.h. */
158static void 159static void
159bset_abbrev_mode (struct buffer *b, Lisp_Object val) 160bset_abbrev_mode (struct buffer *b, Lisp_Object val)
160{ 161{
@@ -201,11 +202,6 @@ bset_buffer_file_coding_system (struct buffer *b, Lisp_Object val)
201 b->INTERNAL_FIELD (buffer_file_coding_system) = val; 202 b->INTERNAL_FIELD (buffer_file_coding_system) = val;
202} 203}
203static void 204static void
204bset_cache_long_scans (struct buffer *b, Lisp_Object val)
205{
206 b->INTERNAL_FIELD (cache_long_scans) = val;
207}
208static void
209bset_case_fold_search (struct buffer *b, Lisp_Object val) 205bset_case_fold_search (struct buffer *b, Lisp_Object val)
210{ 206{
211 b->INTERNAL_FIELD (case_fold_search) = val; 207 b->INTERNAL_FIELD (case_fold_search) = val;
@@ -5185,7 +5181,7 @@ init_buffer_once (void)
5185 bset_buffer_file_coding_system (&buffer_defaults, Qnil); 5181 bset_buffer_file_coding_system (&buffer_defaults, Qnil);
5186 XSETFASTINT (BVAR (&buffer_defaults, fill_column), 70); 5182 XSETFASTINT (BVAR (&buffer_defaults, fill_column), 70);
5187 XSETFASTINT (BVAR (&buffer_defaults, left_margin), 0); 5183 XSETFASTINT (BVAR (&buffer_defaults, left_margin), 0);
5188 bset_cache_long_scans (&buffer_defaults, Qnil); 5184 bset_cache_long_scans (&buffer_defaults, Qt);
5189 bset_file_truename (&buffer_defaults, Qnil); 5185 bset_file_truename (&buffer_defaults, Qnil);
5190 XSETFASTINT (BVAR (&buffer_defaults, display_count), 0); 5186 XSETFASTINT (BVAR (&buffer_defaults, display_count), 0);
5191 XSETFASTINT (BVAR (&buffer_defaults, left_margin_cols), 0); 5187 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
871}; 871};
872 872
873/* Most code should use these functions to set Lisp fields in struct 873/* Most code should use these functions to set Lisp fields in struct
874 buffer. */ 874 buffer. (Some setters that are priviate to a single .c file are
875 defined as static in those files.) */
875INLINE void 876INLINE void
876bset_bidi_paragraph_direction (struct buffer *b, Lisp_Object val) 877bset_bidi_paragraph_direction (struct buffer *b, Lisp_Object val)
877{ 878{
878 b->INTERNAL_FIELD (bidi_paragraph_direction) = val; 879 b->INTERNAL_FIELD (bidi_paragraph_direction) = val;
879} 880}
880INLINE void 881INLINE void
882bset_cache_long_scans (struct buffer *b, Lisp_Object val)
883{
884 b->INTERNAL_FIELD (cache_long_scans) = val;
885}
886INLINE void
881bset_case_canon_table (struct buffer *b, Lisp_Object val) 887bset_case_canon_table (struct buffer *b, Lisp_Object val)
882{ 888{
883 b->INTERNAL_FIELD (case_canon_table) = val; 889 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)
9488 } 9488 }
9489 9489
9490 bset_undo_list (current_buffer, Qt); 9490 bset_undo_list (current_buffer, Qt);
9491 bset_cache_long_scans (current_buffer, Qnil);
9491 9492
9492 oldpoint = message_dolog_marker1; 9493 oldpoint = message_dolog_marker1;
9493 set_marker_restricted_both (oldpoint, Qnil, PT, PT_BYTE); 9494 set_marker_restricted_both (oldpoint, Qnil, PT, PT_BYTE);