aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorStefan Kangas2025-02-01 04:56:52 +0100
committerStefan Kangas2025-02-01 04:56:52 +0100
commitbf97946d7dc460b7d3c3ce03193041b891b51faf (patch)
treec799f87903ca3dcba8b804bd185b519aacc0a636 /src/buffer.c
parenta4a0957b6b3b1db858524ac6d4dc3d951f65960b (diff)
parentaa07e94439c663f768c32a689d14506d25a7a5bc (diff)
downloademacs-bf97946d7dc460b7d3c3ce03193041b891b51faf.tar.gz
emacs-bf97946d7dc460b7d3c3ce03193041b891b51faf.zip
Merge branch 'scratch/no-purespace' into 'master'
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c57
1 files changed, 8 insertions, 49 deletions
diff --git a/src/buffer.c b/src/buffer.c
index a4dc8b12093..40f7ec83d6b 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -4788,8 +4788,8 @@ init_buffer_once (void)
4788 set_buffer_intervals (&buffer_defaults, NULL); 4788 set_buffer_intervals (&buffer_defaults, NULL);
4789 set_buffer_intervals (&buffer_local_symbols, NULL); 4789 set_buffer_intervals (&buffer_local_symbols, NULL);
4790 /* This is not strictly necessary, but let's make them initialized. */ 4790 /* This is not strictly necessary, but let's make them initialized. */
4791 bset_name (&buffer_defaults, build_pure_c_string (" *buffer-defaults*")); 4791 bset_name (&buffer_defaults, build_string (" *buffer-defaults*"));
4792 bset_name (&buffer_local_symbols, build_pure_c_string (" *buffer-local-symbols*")); 4792 bset_name (&buffer_local_symbols, build_string (" *buffer-local-symbols*"));
4793 BUFFER_PVEC_INIT (&buffer_defaults); 4793 BUFFER_PVEC_INIT (&buffer_defaults);
4794 BUFFER_PVEC_INIT (&buffer_local_symbols); 4794 BUFFER_PVEC_INIT (&buffer_local_symbols);
4795 4795
@@ -4797,7 +4797,7 @@ init_buffer_once (void)
4797 /* Must do these before making the first buffer! */ 4797 /* Must do these before making the first buffer! */
4798 4798
4799 /* real setup is done in bindings.el */ 4799 /* real setup is done in bindings.el */
4800 bset_mode_line_format (&buffer_defaults, build_pure_c_string ("%-")); 4800 bset_mode_line_format (&buffer_defaults, build_string ("%-"));
4801 bset_header_line_format (&buffer_defaults, Qnil); 4801 bset_header_line_format (&buffer_defaults, Qnil);
4802 bset_tab_line_format (&buffer_defaults, Qnil); 4802 bset_tab_line_format (&buffer_defaults, Qnil);
4803 bset_abbrev_mode (&buffer_defaults, Qnil); 4803 bset_abbrev_mode (&buffer_defaults, Qnil);
@@ -4865,7 +4865,7 @@ init_buffer_once (void)
4865 current_buffer = 0; 4865 current_buffer = 0;
4866 pdumper_remember_lv_ptr_raw (&current_buffer, Lisp_Vectorlike); 4866 pdumper_remember_lv_ptr_raw (&current_buffer, Lisp_Vectorlike);
4867 4867
4868 QSFundamental = build_pure_c_string ("Fundamental"); 4868 QSFundamental = build_string ("Fundamental");
4869 4869
4870 DEFSYM (Qfundamental_mode, "fundamental-mode"); 4870 DEFSYM (Qfundamental_mode, "fundamental-mode");
4871 bset_major_mode (&buffer_defaults, Qfundamental_mode); 4871 bset_major_mode (&buffer_defaults, Qfundamental_mode);
@@ -4879,10 +4879,10 @@ init_buffer_once (void)
4879 4879
4880 /* Super-magic invisible buffer. */ 4880 /* Super-magic invisible buffer. */
4881 Vprin1_to_string_buffer = 4881 Vprin1_to_string_buffer =
4882 Fget_buffer_create (build_pure_c_string (" prin1"), Qt); 4882 Fget_buffer_create (build_string (" prin1"), Qt);
4883 Vbuffer_alist = Qnil; 4883 Vbuffer_alist = Qnil;
4884 4884
4885 Fset_buffer (Fget_buffer_create (build_pure_c_string ("*scratch*"), Qnil)); 4885 Fset_buffer (Fget_buffer_create (build_string ("*scratch*"), Qnil));
4886 4886
4887 inhibit_modification_hooks = 0; 4887 inhibit_modification_hooks = 0;
4888} 4888}
@@ -4892,47 +4892,6 @@ init_buffer (void)
4892{ 4892{
4893 Lisp_Object temp; 4893 Lisp_Object temp;
4894 4894
4895#ifdef USE_MMAP_FOR_BUFFERS
4896 if (dumped_with_unexec_p ())
4897 {
4898 Lisp_Object tail, buffer;
4899
4900#ifndef WINDOWSNT
4901 /* These must be reset in the dumped Emacs, to avoid stale
4902 references to mmap'ed memory from before the dump.
4903
4904 WINDOWSNT doesn't need this because it doesn't track mmap'ed
4905 regions by hand (see w32heap.c, which uses system APIs for
4906 that purpose), and thus doesn't use mmap_regions. */
4907 mmap_regions = NULL;
4908 mmap_fd = -1;
4909#endif
4910
4911 /* The dumped buffers reference addresses of buffer text
4912 recorded by temacs, that cannot be used by the dumped Emacs.
4913 We map new memory for their text here.
4914
4915 Implementation notes: the buffers we carry from temacs are:
4916 " prin1", "*scratch*", " *Minibuf-0*", "*Messages*", and
4917 " *code-conversion-work*". They are created by
4918 init_buffer_once and init_window_once (which are not called
4919 in the dumped Emacs), and by the first call to coding.c
4920 routines. Since FOR_EACH_LIVE_BUFFER only walks the buffers
4921 in Vbuffer_alist, any buffer we carry from temacs that is
4922 not in the alist (a.k.a. "magic invisible buffers") should
4923 be handled here explicitly. */
4924 FOR_EACH_LIVE_BUFFER (tail, buffer)
4925 {
4926 struct buffer *b = XBUFFER (buffer);
4927 b->text->beg = NULL;
4928 enlarge_buffer_text (b, 0);
4929 }
4930 /* The " prin1" buffer is not in Vbuffer_alist. */
4931 XBUFFER (Vprin1_to_string_buffer)->text->beg = NULL;
4932 enlarge_buffer_text (XBUFFER (Vprin1_to_string_buffer), 0);
4933 }
4934#endif /* USE_MMAP_FOR_BUFFERS */
4935
4936 AUTO_STRING (scratch, "*scratch*"); 4895 AUTO_STRING (scratch, "*scratch*");
4937 Fset_buffer (Fget_buffer_create (scratch, Qnil)); 4896 Fset_buffer (Fget_buffer_create (scratch, Qnil));
4938 if (NILP (BVAR (&buffer_defaults, enable_multibyte_characters))) 4897 if (NILP (BVAR (&buffer_defaults, enable_multibyte_characters)))
@@ -5106,9 +5065,9 @@ syms_of_buffer (void)
5106 Qoverwrite_mode_binary)); 5065 Qoverwrite_mode_binary));
5107 5066
5108 Fput (Qprotected_field, Qerror_conditions, 5067 Fput (Qprotected_field, Qerror_conditions,
5109 pure_list (Qprotected_field, Qerror)); 5068 list (Qprotected_field, Qerror));
5110 Fput (Qprotected_field, Qerror_message, 5069 Fput (Qprotected_field, Qerror_message,
5111 build_pure_c_string ("Attempt to modify a protected field")); 5070 build_string ("Attempt to modify a protected field"));
5112 5071
5113 DEFSYM (Qclone_indirect_buffer_hook, "clone-indirect-buffer-hook"); 5072 DEFSYM (Qclone_indirect_buffer_hook, "clone-indirect-buffer-hook");
5114 5073