From a6cd4553d48aff1d241d54d62dc1b39b3ff541e0 Mon Sep 17 00:00:00 2001 From: Gregory Heytings Date: Thu, 9 Feb 2023 01:09:10 +0000 Subject: Rename two long line optimizations variables * src/buffer.c (syms_of_buffer): Rename two variables. * src/xdisp.c (get_locked_narrowing_begv): (get_locked_narrowing_zv): (handle_fontified_prop): Use the new names. * src/keyboard.c (safe_run_hooks_maybe_narrowed): Use the new names. --- src/buffer.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/buffer.c') diff --git a/src/buffer.c b/src/buffer.c index 38648519ba0..07723a7c6ff 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -5916,8 +5916,8 @@ If nil, these display shortcuts will always remain disabled. There is no reason to change that value except for debugging purposes. */); XSETFASTINT (Vlong_line_threshold, 50000); - DEFVAR_INT ("long-line-locked-narrowing-region-size", - long_line_locked_narrowing_region_size, + DEFVAR_INT ("long-line-optimizations-region-size", + long_line_optimizations_region_size, doc: /* Region size for locked narrowing in buffers with long lines. This variable has effect only in buffers which contain one or more @@ -5932,10 +5932,10 @@ To disable that narrowing, set this variable to 0. See also `long-line-locked-narrowing-bol-search-limit'. There is no reason to change that value except for debugging purposes. */); - long_line_locked_narrowing_region_size = 500000; + long_line_optimizations_region_size = 500000; - DEFVAR_INT ("long-line-locked-narrowing-bol-search-limit", - long_line_locked_narrowing_bol_search_limit, + DEFVAR_INT ("long-line-optimizations-bol-search-limit", + long_line_optimizations_bol_search_limit, doc: /* Limit for beginning of line search in buffers with long lines. This variable has effect only in buffers which contain one or more @@ -5949,7 +5949,7 @@ small integer, specifies the number of characters by which that region can be extended backwards to make it start at the beginning of a line. There is no reason to change that value except for debugging purposes. */); - long_line_locked_narrowing_bol_search_limit = 128; + long_line_optimizations_bol_search_limit = 128; DEFVAR_INT ("large-hscroll-threshold", large_hscroll_threshold, doc: /* Horizontal scroll of truncated lines above which to use redisplay shortcuts. -- cgit v1.2.1 From 79ce185ad1373845781646812638d4872b8aee69 Mon Sep 17 00:00:00 2001 From: Gregory Heytings Date: Thu, 9 Feb 2023 01:09:10 +0000 Subject: Update the documentation about labeled (locked) narrowing * src/xdisp.c (syms_of_xdisp) : Update docstring. * src/keyboard.c (syms_of_keyboard) : (syms_of_keyboard) : Update docstring. * src/editfns.c: (narrowing_locks): Explain why an alist is used instead of a buffer-local variable. (reset_outermost_narrowings): Point to recipes that demonstrate why it is necessary to restore the user narrowing bounds when redisplay starts. (Fwiden): Update docstring. (Fnarrow_to_region): Update docstring. (Finternal__lock_narrowing): Update docstring. (Finternal__unlock_narrowing): Update docstring. (Fsave_restriction): Update docstring. * src/buffer.c (syms_of_buffer) : Update docstring. (syms_of_buffer) : Update docstring. * lisp/subr.el (with-narrowing): Update docstring. (without-narrowing): Update docstring. * etc/NEWS: Mention the 'long-line-optimizations-region-size' and 'long-line-optimizations-bol-search-limit' options. Announce the 'with-narrowing' and 'without-narrowing' forms. * doc/lispref/positions.texi (Narrowing): Update the documentation of 'narrow-to-region', 'widen' and 'save-restriction'. Document the 'with-narrowing' and 'without-narrowing' special forms. * doc/lispref/display.texi (Auto Faces): Update the documentation. * doc/lispref/commands.texi (Command Overview): Document the fact that the buffer is narrowed around 'pre-command-hook' and 'post-command-hook' when the buffer text includes very long lines. --- src/buffer.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'src/buffer.c') diff --git a/src/buffer.c b/src/buffer.c index 07723a7c6ff..755061d0dee 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -5918,18 +5918,18 @@ There is no reason to change that value except for debugging purposes. */); DEFVAR_INT ("long-line-optimizations-region-size", long_line_optimizations_region_size, - doc: /* Region size for locked narrowing in buffers with long lines. + doc: /* Region size for narrowing in buffers with long lines. -This variable has effect only in buffers which contain one or more -lines whose length is above `long-line-threshold', which see. For -performance reasons, in such buffers, low-level hooks such as -`fontification-functions' or `post-command-hook' are executed on a -narrowed buffer, with a narrowing locked with `narrowing-lock'. This -variable specifies the size of the narrowed region around point. +This variable has effect only in buffers in which +`long-line-optimizations-p' is non-nil. For performance reasons, in +such buffers, the `fontification-functions', `pre-command-hook' and +`post-command-hook' hooks are executed on a narrowed buffer around +point, as if they were called in a `with-narrowing' form with a label. +This variable specifies the size of the narrowed region around point. To disable that narrowing, set this variable to 0. -See also `long-line-locked-narrowing-bol-search-limit'. +See also `long-line-optimizations-bol-search-limit'. There is no reason to change that value except for debugging purposes. */); long_line_optimizations_region_size = 500000; @@ -5938,15 +5938,16 @@ There is no reason to change that value except for debugging purposes. */); long_line_optimizations_bol_search_limit, doc: /* Limit for beginning of line search in buffers with long lines. -This variable has effect only in buffers which contain one or more -lines whose length is above `long-line-threshold', which see. For -performance reasons, in such buffers, low-level hooks such as -`fontification-functions' or `post-command-hook' are executed on a -narrowed buffer, with a narrowing locked with `narrowing-lock'. The -variable `long-line-locked-narrowing-region-size' specifies the size -of the narrowed region around point. This variable, which should be a -small integer, specifies the number of characters by which that region -can be extended backwards to make it start at the beginning of a line. +This variable has effect only in buffers in which +`long-line-optimizations-p' is non-nil. For performance reasons, in +such buffers, the `fontification-functions', `pre-command-hook' and +`post-command-hook' hooks are executed on a narrowed buffer around +point, as if they were called in a `with-narrowing' form with a label. +The variable `long-line-optimizations-region-size' specifies the +size of the narrowed region around point. This variable, which should +be a small integer, specifies the number of characters by which that +region can be extended backwards to make it start at the beginning of +a line. There is no reason to change that value except for debugging purposes. */); long_line_optimizations_bol_search_limit = 128; -- cgit v1.2.1