emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/remove-locked-narrowing e89361844f3 3/4: Remove functions and va


From: Gregory Heytings
Subject: scratch/remove-locked-narrowing e89361844f3 3/4: Remove functions and variables for locked narrowings
Date: Fri, 10 Feb 2023 17:54:14 -0500 (EST)

branch: scratch/remove-locked-narrowing
commit e89361844f3648de2e5efaa496ceb04a78cf8439
Author: Gregory Heytings <gregory@heytings.org>
Commit: Gregory Heytings <gregory@heytings.org>

    Remove functions and variables for locked narrowings
    
    * src/dispextern.h (struct it): Remove two fields.
    Remove external declarations for two removed functions.
    
    * src/xdisp.c (get_locked_narrowing_begv)
    (get_locked_narrowing_zv): Remove.
    (reseat): Do not set the two removed fields anymore.
    
    * src/buffer.c (syms_of_buffer): Remove two variables.
---
 src/buffer.c     | 35 -----------------------------------
 src/dispextern.h | 10 ----------
 src/xdisp.c      | 35 -----------------------------------
 3 files changed, 80 deletions(-)

diff --git a/src/buffer.c b/src/buffer.c
index 38648519ba0..b60553435f9 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5916,41 +5916,6 @@ 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,
-             doc: /* Region size for locked 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.
-
-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;
-
-  DEFVAR_INT ("long-line-locked-narrowing-bol-search-limit",
-             long_line_locked_narrowing_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.
-
-There is no reason to change that value except for debugging purposes.  */);
-  long_line_locked_narrowing_bol_search_limit = 128;
-
   DEFVAR_INT ("large-hscroll-threshold", large_hscroll_threshold,
     doc: /* Horizontal scroll of truncated lines above which to use redisplay 
shortcuts.
 
diff --git a/src/dispextern.h b/src/dispextern.h
index 4dcab113ea2..a18bb781258 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -2342,14 +2342,6 @@ struct it
      optimize display.  */
   ptrdiff_t narrowed_zv;
 
-  /* Begin position of the buffer for the locked narrowing around
-     low-level hooks.  */
-  ptrdiff_t locked_narrowing_begv;
-
-  /* End position of the buffer for the locked narrowing around
-     low-level hooks.  */
-  ptrdiff_t locked_narrowing_zv;
-
   /* C string to iterate over.  Non-null means get characters from
      this string, otherwise characters are read from current_buffer
      or it->string.  */
@@ -3413,8 +3405,6 @@ void init_iterator (struct it *, struct window *, 
ptrdiff_t,
 ptrdiff_t get_narrowed_begv (struct window *, ptrdiff_t);
 ptrdiff_t get_narrowed_zv (struct window *, ptrdiff_t);
 ptrdiff_t get_closer_narrowed_begv (struct window *, ptrdiff_t);
-ptrdiff_t get_locked_narrowing_begv (ptrdiff_t);
-ptrdiff_t get_locked_narrowing_zv (ptrdiff_t);
 void init_iterator_to_row_start (struct it *, struct window *,
                                  struct glyph_row *);
 void start_display (struct it *, struct window *, struct text_pos);
diff --git a/src/xdisp.c b/src/xdisp.c
index c3df8cd98f3..eaf5cfc88ed 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -3533,33 +3533,6 @@ get_closer_narrowed_begv (struct window *w, ptrdiff_t 
pos)
   return max ((pos / len - 1) * len, BEGV);
 }
 
-ptrdiff_t
-get_locked_narrowing_begv (ptrdiff_t pos)
-{
-  if (long_line_locked_narrowing_region_size <= 0)
-    return BEGV;
-  int len = long_line_locked_narrowing_region_size / 2;
-  int begv = max (pos - len, BEGV);
-  int limit = long_line_locked_narrowing_bol_search_limit;
-  while (limit > 0)
-    {
-      if (begv == BEGV || FETCH_BYTE (CHAR_TO_BYTE (begv) - 1) == '\n')
-       return begv;
-      begv--;
-      limit--;
-    }
-  return begv;
-}
-
-ptrdiff_t
-get_locked_narrowing_zv (ptrdiff_t pos)
-{
-  if (long_line_locked_narrowing_region_size <= 0)
-    return ZV;
-  int len = long_line_locked_narrowing_region_size / 2;
-  return min (pos + len, ZV);
-}
-
 static void
 unwind_narrowed_begv (Lisp_Object point_min)
 {
@@ -7451,20 +7424,12 @@ reseat (struct it *it, struct text_pos pos, bool 
force_p)
        {
          it->narrowed_begv = get_narrowed_begv (it->w, window_point (it->w));
          it->narrowed_zv = get_narrowed_zv (it->w, window_point (it->w));
-         it->locked_narrowing_begv
-           = get_locked_narrowing_begv (window_point (it->w));
-         it->locked_narrowing_zv
-           = get_locked_narrowing_zv (window_point (it->w));
        }
       else if ((pos.charpos < it->narrowed_begv || pos.charpos > 
it->narrowed_zv)
                && (!redisplaying_p || it->line_wrap == TRUNCATE))
        {
          it->narrowed_begv = get_narrowed_begv (it->w, pos.charpos);
          it->narrowed_zv = get_narrowed_zv (it->w, pos.charpos);
-         it->locked_narrowing_begv
-           = get_locked_narrowing_begv (window_point (it->w));
-         it->locked_narrowing_zv
-           = get_locked_narrowing_zv (window_point (it->w));
        }
     }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]