aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorAndrew Hyatt2022-01-20 14:42:31 +0100
committerLars Ingebrigtsen2022-01-20 14:42:31 +0100
commit27b3948a8a29f263272d10c1ee1c50d87797ff50 (patch)
treea7e2dc038e64fb1b8d0ae9eeb2bf842e7fe52905 /src/buffer.c
parent4450c8bdd93d1b2e7f276e26be2cc37372034c22 (diff)
downloademacs-27b3948a8a29f263272d10c1ee1c50d87797ff50.tar.gz
emacs-27b3948a8a29f263272d10c1ee1c50d87797ff50.zip
Fix indirect font changes incorrectly affecting original buffer
* lisp/face-remap.el (face-attrs--make-indirect-safe): (clone-indirect-buffer-hook): Set up a face remapping alist (bug#53294). * lisp/simple.el (clone-indirect-buffer): Move the point the hook is run. * src/buffer.c (Fmake_indirect_buffer, syms_of_buffer): Move the place where the clone-indirect-buffer-hook variable is defined, so that we can call it from C.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c
index a3091015d9b..f5f7127a638 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -912,6 +912,10 @@ does not run the hooks `kill-buffer-hook',
912 Fset (intern ("buffer-save-without-query"), Qnil); 912 Fset (intern ("buffer-save-without-query"), Qnil);
913 Fset (intern ("buffer-file-number"), Qnil); 913 Fset (intern ("buffer-file-number"), Qnil);
914 Fset (intern ("buffer-stale-function"), Qnil); 914 Fset (intern ("buffer-stale-function"), Qnil);
915 /* Cloned buffers need extra setup, to do things such as deep
916 variable copies for list variables that might be mangled due
917 to destructive operations in the indirect buffer. */
918 run_hook (Qclone_indirect_buffer_hook);
915 set_buffer_internal_1 (old_b); 919 set_buffer_internal_1 (old_b);
916 } 920 }
917 921
@@ -5569,6 +5573,8 @@ syms_of_buffer (void)
5569 Fput (Qprotected_field, Qerror_message, 5573 Fput (Qprotected_field, Qerror_message,
5570 build_pure_c_string ("Attempt to modify a protected field")); 5574 build_pure_c_string ("Attempt to modify a protected field"));
5571 5575
5576 DEFSYM (Qclone_indirect_buffer_hook, "clone-indirect-buffer-hook");
5577
5572 DEFVAR_PER_BUFFER ("tab-line-format", 5578 DEFVAR_PER_BUFFER ("tab-line-format",
5573 &BVAR (current_buffer, tab_line_format), 5579 &BVAR (current_buffer, tab_line_format),
5574 Qnil, 5580 Qnil,
@@ -6392,6 +6398,10 @@ If `delete-auto-save-files' is nil, any autosave deletion is inhibited. */);
6392This is the default. If nil, auto-save file deletion is inhibited. */); 6398This is the default. If nil, auto-save file deletion is inhibited. */);
6393 delete_auto_save_files = 1; 6399 delete_auto_save_files = 1;
6394 6400
6401 DEFVAR_LISP ("clone-indirect-buffer-hook", Vclone_indirect_buffer_hook,
6402 doc: /* Normal hook to run in the new buffer at the end of `clone-indirect-buffer'. */);
6403 Vclone_indirect_buffer_hook = Qnil;
6404
6395 defsubr (&Sbuffer_live_p); 6405 defsubr (&Sbuffer_live_p);
6396 defsubr (&Sbuffer_list); 6406 defsubr (&Sbuffer_list);
6397 defsubr (&Sget_buffer); 6407 defsubr (&Sget_buffer);