diff options
| author | Gregory Heytings | 2022-11-26 14:09:41 +0000 |
|---|---|---|
| committer | Gregory Heytings | 2022-11-26 15:10:17 +0100 |
| commit | 558084c7f736bebcb3cffc2bf4f617158d92357f (patch) | |
| tree | 5e05c5a457fe09073321b6b6543f1bbc00e766ed /src/editfns.c | |
| parent | 16b8b0d1e07d394e01f76d9eed6006219b4d745b (diff) | |
| download | emacs-558084c7f736bebcb3cffc2bf4f617158d92357f.tar.gz emacs-558084c7f736bebcb3cffc2bf4f617158d92357f.zip | |
Improve locked narrowing around low-level hooks.
* src/buffer.c (syms_of_buffer): Two new variables,
'long-line-locked-narrowing-region-size' and
'long-line-locked-narrowing-bol-search-limit', to make the locked
narrowing around low-level hooks configurable.
Increase the default value of 'long-line-threshold'. After
carefully considering the (few) bug reports about long line
optimizations, I concluded that the previous default value was too
low.
* src/xdisp.c (get_locked_narrowing_begv)
(get_locked_narrowing_zv): Two new functions.
(handle_fontified_prop, reseat): Use them.
* src/keyboard.c (safe_run_hooks_maybe_narrowed): Use them.
* src/dispextern.h (struct it): Add two new fields to store the
values returned by these functions.
Make them externally visible.
* src/editfns.c: (Fsave_restriction): Update docstring.
Diffstat (limited to 'src/editfns.c')
| -rw-r--r-- | src/editfns.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/editfns.c b/src/editfns.c index f73331fb53c..e6b66209b8b 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -2659,7 +2659,7 @@ DEFUN ("delete-and-extract-region", Fdelete_and_extract_region, | |||
| 2659 | the (uninterned) Qoutermost_narrowing tag and records the narrowing | 2659 | the (uninterned) Qoutermost_narrowing tag and records the narrowing |
| 2660 | bounds that were set by the user and that are visible on display. | 2660 | bounds that were set by the user and that are visible on display. |
| 2661 | This alist is used internally by narrow-to-region, widen, | 2661 | This alist is used internally by narrow-to-region, widen, |
| 2662 | narrowing-lock and narrowing-unlock. */ | 2662 | narrowing-lock, narrowing-unlock and save-restriction. */ |
| 2663 | static Lisp_Object narrowing_locks; | 2663 | static Lisp_Object narrowing_locks; |
| 2664 | 2664 | ||
| 2665 | /* Retrieve one of the BEGV/ZV bounds of a narrowing in BUF from the | 2665 | /* Retrieve one of the BEGV/ZV bounds of a narrowing in BUF from the |
| @@ -3061,11 +3061,12 @@ DEFUN ("save-restriction", Fsave_restriction, Ssave_restriction, 0, UNEVALLED, 0 | |||
| 3061 | doc: /* Execute BODY, saving and restoring current buffer's restrictions. | 3061 | doc: /* Execute BODY, saving and restoring current buffer's restrictions. |
| 3062 | The buffer's restrictions make parts of the beginning and end invisible. | 3062 | The buffer's restrictions make parts of the beginning and end invisible. |
| 3063 | \(They are set up with `narrow-to-region' and eliminated with `widen'.) | 3063 | \(They are set up with `narrow-to-region' and eliminated with `widen'.) |
| 3064 | This special form, `save-restriction', saves the current buffer's restrictions | 3064 | This special form, `save-restriction', saves the current buffer's |
| 3065 | when it is entered, and restores them when it is exited. | 3065 | restrictions, as well as their locks if they have been locked with |
| 3066 | `narrowing-lock', when it is entered, and restores them when it is exited. | ||
| 3066 | So any `narrow-to-region' within BODY lasts only until the end of the form. | 3067 | So any `narrow-to-region' within BODY lasts only until the end of the form. |
| 3067 | The old restrictions settings are restored | 3068 | The old restrictions settings are restored even in case of abnormal exit |
| 3068 | even in case of abnormal exit (throw or error). | 3069 | \(throw or error). |
| 3069 | 3070 | ||
| 3070 | The value returned is the value of the last form in BODY. | 3071 | The value returned is the value of the last form in BODY. |
| 3071 | 3072 | ||