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 | |
| 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.
| -rw-r--r-- | doc/emacs/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/emacs/display.texi | 13 | ||||
| -rw-r--r-- | etc/ChangeLog | 4 | ||||
| -rw-r--r-- | etc/NEWS | 6 | ||||
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/cus-start.el | 1 | ||||
| -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 |
10 files changed, 68 insertions, 1 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index cd46d9fc474..d2f7a345566 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-12-14 Alan Mackenzie <acm@muc.de> | ||
| 2 | |||
| 3 | * display.texi (Scrolling): fast-but-imprecise-scrolling. | ||
| 4 | Describe new variable. | ||
| 5 | |||
| 1 | 2014-12-14 Cameron Desautels <camdez@gmail.com> | 6 | 2014-12-14 Cameron Desautels <camdez@gmail.com> |
| 2 | 7 | ||
| 3 | * custom.texi (Saving Customizations): Mention | 8 | * custom.texi (Saving Customizations): Mention |
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index a5555d58054..12a8e1b3eee 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi | |||
| @@ -127,6 +127,19 @@ the mouse wheel (@pxref{Mouse Commands}); in general, it affects any | |||
| 127 | command that has a non-@code{nil} @code{scroll-command} property. | 127 | command that has a non-@code{nil} @code{scroll-command} property. |
| 128 | @xref{Property Lists,,, elisp, The Emacs Lisp Reference Manual}. | 128 | @xref{Property Lists,,, elisp, The Emacs Lisp Reference Manual}. |
| 129 | 129 | ||
| 130 | @vindex fast-but-imprecise-scrolling | ||
| 131 | Sometimes, particularly when you hold down keys such as @kbd{C-v} | ||
| 132 | and @kbd{M-v}, activating keyboard auto-repeat, Emacs fails to keep up | ||
| 133 | with the rapid rate of scrolling requested; the display doesn't update | ||
| 134 | and Emacs can become unresponsive to input for quite a long time. You | ||
| 135 | can counter this sluggishness by setting the variable | ||
| 136 | @code{fast-but-imprecise-scrolling} to a non-@code{nil} value. This | ||
| 137 | instructs the scrolling commands not to fontify (@pxref{Font Lock}) | ||
| 138 | any unfontified text they scroll over, instead to assume it has the | ||
| 139 | default face. This can cause Emacs to scroll to somewhat wrong buffer | ||
| 140 | positions when the faces in use are not all the same size, even with | ||
| 141 | single (i.e. without auto-repeat) scrolling operations. | ||
| 142 | |||
| 130 | @vindex scroll-up | 143 | @vindex scroll-up |
| 131 | @vindex scroll-down | 144 | @vindex scroll-down |
| 132 | @findex scroll-up-line | 145 | @findex scroll-up-line |
diff --git a/etc/ChangeLog b/etc/ChangeLog index f344e2437b0..0a06cbd5c70 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2014-12-14 Alan Mackenzie <acm@muc.de> | ||
| 2 | |||
| 3 | * NEWS: Add entry for fast-but-imprecise-scrolling. | ||
| 4 | |||
| 1 | 2014-12-14 Cameron Desautels <camdez@gmail.com> | 5 | 2014-12-14 Cameron Desautels <camdez@gmail.com> |
| 2 | 6 | ||
| 3 | * NEWS: Mention `custom-prompt-customize-unsaved-options'. | 7 | * NEWS: Mention `custom-prompt-customize-unsaved-options'. |
| @@ -153,6 +153,12 @@ name (as returned from, for instance, `file-name-all-completions' is | |||
| 153 | a directory file name. It returns non-nil if the last character in | 153 | a directory file name. It returns non-nil if the last character in |
| 154 | the name is a forward slash. | 154 | the name is a forward slash. |
| 155 | 155 | ||
| 156 | +++ | ||
| 157 | ** New variable `fast-but-imprecise-scrolling' inhibits | ||
| 158 | fontification during full screen scrolling operations, giving less | ||
| 159 | hesitant operation during auto-repeat of C-v, M-v at the cost of | ||
| 160 | possible inaccuracies in the end position. | ||
| 161 | |||
| 156 | 162 | ||
| 157 | * Editing Changes in Emacs 25.1 | 163 | * Editing Changes in Emacs 25.1 |
| 158 | 164 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 288589d9e04..8a0d5181bae 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2014-12-14 Alan Mackenzie <acm@muc.de> | ||
| 2 | |||
| 3 | * lisp/cus-start.el (all): Add fast-but-imprecise-scrolling. | ||
| 4 | |||
| 1 | 2014-12-14 Artur Malabarba <bruce.connor.am@gmail.com> | 5 | 2014-12-14 Artur Malabarba <bruce.connor.am@gmail.com> |
| 2 | 6 | ||
| 3 | * let-alist.el: Add lexical binding. | 7 | * let-alist.el: Add lexical binding. |
diff --git a/lisp/cus-start.el b/lisp/cus-start.el index 3b8885a8717..4049974841e 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el | |||
| @@ -460,6 +460,7 @@ since it could result in memory overflow and make Emacs crash." | |||
| 460 | :value display-buffer) | 460 | :value display-buffer) |
| 461 | (other :tag "Always (t)" :value t)) | 461 | (other :tag "Always (t)" :value t)) |
| 462 | "24.3") | 462 | "24.3") |
| 463 | (fast-but-imprecise-scrolling scrolling boolean "25.1") | ||
| 463 | (window-resize-pixelwise windows boolean "24.4") | 464 | (window-resize-pixelwise windows boolean "24.4") |
| 464 | ;; xdisp.c | 465 | ;; xdisp.c |
| 465 | ;; The whitespace group is for whitespace.el. | 466 | ;; The whitespace group is for whitespace.el. |
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; |