diff options
| author | Alan Mackenzie | 2014-12-14 18:26:44 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2014-12-14 18:26:44 +0000 |
| commit | 3713931778c9bc8674c391dbb9149ac6288922f2 (patch) | |
| tree | 1b7d1716ec52f11833c1de113f83a306fd77641a /src | |
| parent | 33c5143fa63a05a983657d019b8a11a25bcfffb3 (diff) | |
| download | emacs-3713931778c9bc8674c391dbb9149ac6288922f2.tar.gz emacs-3713931778c9bc8674c391dbb9149ac6288922f2.zip | |
New feature optionally to accelerate auto-repeated scrolling.
src/xdisp.c: Remove "static" from declaration of
Qfontification_functions.
src/window.c (window_scroll): bind fontification-functions to nil when
scrolling by whole screens and fast-but-imprecise-scrolling is non-nil.
(syms_of_window): New DEFVAR_BOOL fast-but-imprecise-scrolling.
src/lisp.h (bool): Declare Qfontification_functions extern.
lisp/cus-start.el (all): Add fast-but-imprecise-scrolling.
doc/emacs/display.texi (Scrolling): fast-but-imprecise-scrolling.
Describe new variable.
etc/NEWS: Add entry for fast-but-imprecise-scrolling.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 15 | ||||
| -rw-r--r-- | src/lisp.h | 1 | ||||
| -rw-r--r-- | src/window.c | 18 | ||||
| -rw-r--r-- | src/xdisp.c | 2 |
4 files changed, 35 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index fd56186105b..46bf2801849 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,18 @@ | |||
| 1 | 2014-12-14 Alan Mackenzie <acm@muc.de> | ||
| 2 | |||
| 3 | New feature optionally to accelerate auto-repeated scrolling. | ||
| 4 | |||
| 5 | * xdisp.c: Remove "static" from declaration of | ||
| 6 | Qfontification_functions. | ||
| 7 | |||
| 8 | * window.c (window_scroll): bind fontification-functions to nil | ||
| 9 | when scrolling by whole screens and | ||
| 10 | fast-but-imprecise-scrolling is non-nil. | ||
| 11 | (syms_of_window): New DEFVAR_BOOL | ||
| 12 | fast-but-imprecise-scrolling. | ||
| 13 | |||
| 14 | * lisp.h (bool): Declare Qfontification_functions extern. | ||
| 15 | |||
| 1 | 2014-12-14 Eli Zaretskii <eliz@gnu.org> | 16 | 2014-12-14 Eli Zaretskii <eliz@gnu.org> |
| 2 | 17 | ||
| 3 | Load system's default trusted Certificate Authorities if available. | 18 | Load system's default trusted Certificate Authorities if available. |
diff --git a/src/lisp.h b/src/lisp.h index a56c4a73bf8..37172c6b049 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -830,6 +830,7 @@ extern Lisp_Object Qwindowp; | |||
| 830 | 830 | ||
| 831 | /* Defined in xdisp.c. */ | 831 | /* Defined in xdisp.c. */ |
| 832 | extern Lisp_Object Qimage; | 832 | extern Lisp_Object Qimage; |
| 833 | extern Lisp_Object Qfontification_functions; | ||
| 833 | 834 | ||
| 834 | 835 | ||
| 835 | /* Extract a value or address from a Lisp_Object. */ | 836 | /* Extract a value or address from a Lisp_Object. */ |
diff --git a/src/window.c b/src/window.c index 7c2b3ca29d2..0b766649b17 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -4869,11 +4869,16 @@ window_internal_height (struct window *w) | |||
| 4869 | static void | 4869 | static void |
| 4870 | window_scroll (Lisp_Object window, EMACS_INT n, bool whole, int noerror) | 4870 | window_scroll (Lisp_Object window, EMACS_INT n, bool whole, int noerror) |
| 4871 | { | 4871 | { |
| 4872 | ptrdiff_t count = SPECPDL_INDEX (); | ||
| 4873 | |||
| 4872 | immediate_quit = 1; | 4874 | immediate_quit = 1; |
| 4873 | n = clip_to_bounds (INT_MIN, n, INT_MAX); | 4875 | n = clip_to_bounds (INT_MIN, n, INT_MAX); |
| 4874 | 4876 | ||
| 4875 | wset_redisplay (XWINDOW (window)); | 4877 | wset_redisplay (XWINDOW (window)); |
| 4876 | 4878 | ||
| 4879 | if (whole && Vfast_but_imprecise_scrolling) | ||
| 4880 | specbind (Qfontification_functions, Qnil); | ||
| 4881 | |||
| 4877 | /* If we must, use the pixel-based version which is much slower than | 4882 | /* If we must, use the pixel-based version which is much slower than |
| 4878 | the line-based one but can handle varying line heights. */ | 4883 | the line-based one but can handle varying line heights. */ |
| 4879 | if (FRAME_WINDOW_P (XFRAME (XWINDOW (window)->frame))) | 4884 | if (FRAME_WINDOW_P (XFRAME (XWINDOW (window)->frame))) |
| @@ -4881,6 +4886,8 @@ window_scroll (Lisp_Object window, EMACS_INT n, bool whole, int noerror) | |||
| 4881 | else | 4886 | else |
| 4882 | window_scroll_line_based (window, n, whole, noerror); | 4887 | window_scroll_line_based (window, n, whole, noerror); |
| 4883 | 4888 | ||
| 4889 | unbind_to (count, Qnil); | ||
| 4890 | |||
| 4884 | /* Bug#15957. */ | 4891 | /* Bug#15957. */ |
| 4885 | XWINDOW (window)->window_end_valid = 0; | 4892 | XWINDOW (window)->window_end_valid = 0; |
| 4886 | immediate_quit = 0; | 4893 | immediate_quit = 0; |
| @@ -7478,6 +7485,17 @@ frame's character size, at least one window may get resized | |||
| 7478 | pixelwise even if this option is nil. */); | 7485 | pixelwise even if this option is nil. */); |
| 7479 | window_resize_pixelwise = 0; | 7486 | window_resize_pixelwise = 0; |
| 7480 | 7487 | ||
| 7488 | DEFVAR_BOOL ("fast-but-imprecise-scrolling", | ||
| 7489 | Vfast_but_imprecise_scrolling, | ||
| 7490 | doc: /* When non-nil, accelerate scrolling operations. | ||
| 7491 | This comes into play when scrolling rapidly over previously | ||
| 7492 | unfontified buffer regions. Only those portions of the buffer which | ||
| 7493 | are actually going to be displayed get fontified. | ||
| 7494 | |||
| 7495 | Note that this optimization can cause the portion of the buffer | ||
| 7496 | displayed after a scrolling operation to be somewhat inaccurate. */); | ||
| 7497 | Vfast_but_imprecise_scrolling = 0; | ||
| 7498 | |||
| 7481 | defsubr (&Sselected_window); | 7499 | defsubr (&Sselected_window); |
| 7482 | defsubr (&Sminibuffer_window); | 7500 | defsubr (&Sminibuffer_window); |
| 7483 | defsubr (&Swindow_minibuffer_p); | 7501 | defsubr (&Swindow_minibuffer_p); |
diff --git a/src/xdisp.c b/src/xdisp.c index f022790023b..48a2979dcde 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -347,7 +347,7 @@ Lisp_Object Qtext; | |||
| 347 | /* Holds the list (error). */ | 347 | /* Holds the list (error). */ |
| 348 | static Lisp_Object list_of_error; | 348 | static Lisp_Object list_of_error; |
| 349 | 349 | ||
| 350 | static Lisp_Object Qfontification_functions; | 350 | Lisp_Object Qfontification_functions; |
| 351 | 351 | ||
| 352 | static Lisp_Object Qwrap_prefix; | 352 | static Lisp_Object Qwrap_prefix; |
| 353 | static Lisp_Object Qline_prefix; | 353 | static Lisp_Object Qline_prefix; |