]> git.eshelyaron.com Git - emacs.git/commitdiff
Add specific symbols for narrowings
authorGregory Heytings <gregory@heytings.org>
Thu, 9 Feb 2023 01:09:10 +0000 (01:09 +0000)
committerGregory Heytings <gregory@heytings.org>
Thu, 9 Feb 2023 01:44:44 +0000 (02:44 +0100)
* src/xdisp.c (syms_of_xdisp): Define symbol.
(handle_fontified_prop): Use it.

* src/keyboard.c (syms_of_keyboard): Define symbol.
(safe_run_hooks_maybe_narrowed): Use it.

src/keyboard.c
src/xdisp.c

index 6f0f075e54e0cc0f108f8939a9bd2acec83668ab..243767aff5399221aa43cffa043356194b7435b7 100644 (file)
@@ -1915,7 +1915,8 @@ safe_run_hooks_maybe_narrowed (Lisp_Object hook, struct window *w)
       ptrdiff_t begv = get_locked_narrowing_begv (PT);
       ptrdiff_t zv = get_locked_narrowing_zv (PT);
       if (begv != BEG || zv != Z)
-       narrow_to_region_locked (make_fixnum (begv), make_fixnum (zv), hook);
+       narrow_to_region_locked (make_fixnum (begv), make_fixnum (zv),
+                                Qlong_line_optimizations_in_command_hooks);
     }
 
   run_hook_with_args (2, ((Lisp_Object []) {hook, hook}),
@@ -12168,6 +12169,8 @@ syms_of_keyboard (void)
   /* Hooks to run before and after each command.  */
   DEFSYM (Qpre_command_hook, "pre-command-hook");
   DEFSYM (Qpost_command_hook, "post-command-hook");
+  DEFSYM (Qlong_line_optimizations_in_command_hooks,
+         "long-line-optimizations-in-command-hooks");
 
   /* Hook run after the region is selected.  */
   DEFSYM (Qpost_select_region_hook, "post-select-region-hook");
index a19c9908616ed7e33a6578d6004954634bb86284..f777d2899b4af3f79be06ce38fe08b3c802f7525 100644 (file)
@@ -4406,7 +4406,7 @@ handle_fontified_prop (struct it *it)
            }
          if (begv != BEG || zv != Z)
            narrow_to_region_locked (make_fixnum (begv), make_fixnum (zv),
-                                    Qfontification_functions);
+                                    Qlong_line_optimizations_in_fontification_functions);
        }
 
       /* Don't allow Lisp that runs from 'fontification-functions'
@@ -36266,6 +36266,8 @@ be let-bound around code that needs to disable messages temporarily. */);
   DEFSYM (QCfile, ":file");
   DEFSYM (Qfontified, "fontified");
   DEFSYM (Qfontification_functions, "fontification-functions");
+  DEFSYM (Qlong_line_optimizations_in_fontification_functions,
+         "long-line-optimizations-in-fontification-functions");
 
   /* Name of the symbol which disables Lisp evaluation in 'display'
      properties.  This is used by enriched.el.  */