diff options
| author | Miles Bader | 2009-06-23 07:07:45 +0000 |
|---|---|---|
| committer | Miles Bader | 2009-06-23 07:07:45 +0000 |
| commit | 666e158e382bca51630b3822a54bf51c52d41d23 (patch) | |
| tree | 75125ed242a47eeba4403398b3845faea4f097ac | |
| parent | c6da7cd2b63cc9094d690b74875bf8609b5c0107 (diff) | |
| download | emacs-666e158e382bca51630b3822a54bf51c52d41d23.tar.gz emacs-666e158e382bca51630b3822a54bf51c52d41d23.zip | |
Add the `recenter-redisplay' variable, and make `recenter' use it.
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1604
| -rw-r--r-- | doc/emacs/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/emacs/display.texi | 16 | ||||
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/cus-start.el | 6 | ||||
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/window.c | 46 |
6 files changed, 68 insertions, 15 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index d060b4679e0..c990259b76d 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2009-06-23 Miles Bader <miles@gnu.org> | ||
| 2 | |||
| 3 | * display.texi (Scrolling): Document `recenter-redisplay' | ||
| 4 | |||
| 1 | 2009-06-21 Chong Yidong <cyd@stupidchicken.com> | 5 | 2009-06-21 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 6 | ||
| 3 | * Branch for 23.1. | 7 | * Branch for 23.1. |
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index 859ed50194b..5cffc2e3377 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi | |||
| @@ -54,7 +54,7 @@ commands: | |||
| 54 | @table @kbd | 54 | @table @kbd |
| 55 | @item C-l | 55 | @item C-l |
| 56 | Scroll the selected window to center point vertically within it and | 56 | Scroll the selected window to center point vertically within it and |
| 57 | redisplay the screen (@code{recenter-top-bottom}). | 57 | maybe redisplay the screen (@code{recenter-top-bottom}). |
| 58 | @item C-v | 58 | @item C-v |
| 59 | @itemx @key{next} | 59 | @itemx @key{next} |
| 60 | @itemx @key{PageDown} | 60 | @itemx @key{PageDown} |
| @@ -73,9 +73,12 @@ Scroll heuristically to bring useful information onto the screen | |||
| 73 | The most basic scrolling command is @kbd{C-l} | 73 | The most basic scrolling command is @kbd{C-l} |
| 74 | (@code{recenter-top-bottom}). This @dfn{recenters} the selected | 74 | (@code{recenter-top-bottom}). This @dfn{recenters} the selected |
| 75 | window, scrolling it so that the current screen line is exactly in the | 75 | window, scrolling it so that the current screen line is exactly in the |
| 76 | center of the window, or as close to the center as possible. It also | 76 | center of the window, or as close to the center as possible. If the |
| 77 | clears the screen and redisplays all windows; this is useful in case | 77 | variable @var{recenter-redisplay} is non-nil, it also clears the |
| 78 | the screen becomes garbled for any reason (@pxref{Screen Garbled}). | 78 | screen and redisplays all windows; this is useful in case the screen |
| 79 | becomes garbled for any reason (@pxref{Screen Garbled}). If | ||
| 80 | @var{recenter-redisplay} has the special value @code{tty} (the | ||
| 81 | default), then redisplay only happens on tty frames. | ||
| 79 | 82 | ||
| 80 | Typing @kbd{C-l} twice in a row (@kbd{C-l C-l}) scrolls the window | 83 | Typing @kbd{C-l} twice in a row (@kbd{C-l C-l}) scrolls the window |
| 81 | so that point is on the topmost screen line. Typing a third @kbd{C-l} | 84 | so that point is on the topmost screen line. Typing a third @kbd{C-l} |
| @@ -95,6 +98,11 @@ puts point on the bottom line, and @kbd{C-u - 5 C-l} puts it five | |||
| 95 | lines from the bottom. When given an argument, @kbd{C-l} does not | 98 | lines from the bottom. When given an argument, @kbd{C-l} does not |
| 96 | clear the screen or cycle through different screen positions. | 99 | clear the screen or cycle through different screen positions. |
| 97 | 100 | ||
| 101 | @vindex recenter-redisplay | ||
| 102 | When the variable @code{recenter-redisplay} is non-nil, the | ||
| 103 | @code{recenter} and @code{recenter-top-bottom} commands redisplay the | ||
| 104 | selected frame when they are invoked without a prefix argument. | ||
| 105 | |||
| 98 | @kindex C-v | 106 | @kindex C-v |
| 99 | @kindex M-v | 107 | @kindex M-v |
| 100 | @kindex next | 108 | @kindex next |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 75b1048baca..879d8b37655 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2009-06-23 Miles Bader <miles@gnu.org> | ||
| 2 | |||
| 3 | * cus-start.el: Add entry for `recenter-redisplay'. | ||
| 4 | |||
| 1 | 2009-06-22 Dan Nicolaescu <dann@ics.uci.edu> | 5 | 2009-06-22 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 6 | ||
| 3 | * vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision): | 7 | * vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision): |
diff --git a/lisp/cus-start.el b/lisp/cus-start.el index d8d3cc5d3ac..09a0a93b103 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el | |||
| @@ -307,6 +307,12 @@ since it could result in memory overflow and make Emacs crash." | |||
| 307 | (const :tag "Off (nil)" :value nil) | 307 | (const :tag "Off (nil)" :value nil) |
| 308 | (const :tag "Full screen (t)" :value t) | 308 | (const :tag "Full screen (t)" :value t) |
| 309 | (other :tag "Always" 1)) "22.1") | 309 | (other :tag "Always" 1)) "22.1") |
| 310 | (recenter-redisplay windows | ||
| 311 | (choice | ||
| 312 | (const :tag "Never (nil)" :value nil) | ||
| 313 | (const :tag "Only on ttys" :value tty) | ||
| 314 | (other :tag "Always" t)) | ||
| 315 | "23.1") | ||
| 310 | ;; xdisp.c | 316 | ;; xdisp.c |
| 311 | (scroll-step windows integer) | 317 | (scroll-step windows integer) |
| 312 | (scroll-conservatively windows integer) | 318 | (scroll-conservatively windows integer) |
diff --git a/src/ChangeLog b/src/ChangeLog index 9e1830e4d4a..1c7e15979f9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2009-06-23 Miles Bader <miles@gnu.org> | ||
| 2 | |||
| 3 | * window.c (Vrecenter_redisplay): New variable. | ||
| 4 | (syms_of_window): Initialize it. | ||
| 5 | (Qtty): New extern declaration. | ||
| 6 | (Frecenter): Only do redisplay if Vrecenter_redisplay requests it. | ||
| 7 | |||
| 1 | 2009-06-23 Jim Meyering <meyering@redhat.com> | 8 | 2009-06-23 Jim Meyering <meyering@redhat.com> |
| 2 | 9 | ||
| 3 | Don't dereference NULL upon failed malloc and realloc | 10 | Don't dereference NULL upon failed malloc and realloc |
diff --git a/src/window.c b/src/window.c index 4c68de2b905..08fd8c829fa 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -193,6 +193,14 @@ static int inhibit_frame_unsplittable; | |||
| 193 | extern EMACS_INT scroll_margin; | 193 | extern EMACS_INT scroll_margin; |
| 194 | 194 | ||
| 195 | extern Lisp_Object Qwindow_scroll_functions, Vwindow_scroll_functions; | 195 | extern Lisp_Object Qwindow_scroll_functions, Vwindow_scroll_functions; |
| 196 | |||
| 197 | /* If non-nil, then the `recenter' command with a nil argument | ||
| 198 | the entire frame to be redrawn; the special value `tty' causes the | ||
| 199 | frame to be redrawn only if it is a tty frame. */ | ||
| 200 | |||
| 201 | static Lisp_Object Vrecenter_redisplay; | ||
| 202 | extern Lisp_Object Qtty; | ||
| 203 | |||
| 196 | 204 | ||
| 197 | DEFUN ("windowp", Fwindowp, Swindowp, 1, 1, 0, | 205 | DEFUN ("windowp", Fwindowp, Swindowp, 1, 1, 0, |
| 198 | doc: /* Return t if OBJECT is a window. */) | 206 | doc: /* Return t if OBJECT is a window. */) |
| @@ -5602,14 +5610,17 @@ displayed_window_lines (w) | |||
| 5602 | 5610 | ||
| 5603 | 5611 | ||
| 5604 | DEFUN ("recenter", Frecenter, Srecenter, 0, 1, "P", | 5612 | DEFUN ("recenter", Frecenter, Srecenter, 0, 1, "P", |
| 5605 | doc: /* Center point in selected window and redisplay frame. | 5613 | doc: /* Center point in selected window and maybe redisplay frame. |
| 5606 | With prefix argument ARG, recenter putting point on screen line ARG | 5614 | With prefix argument ARG, recenter putting point on screen line ARG |
| 5607 | relative to the selected window. If ARG is negative, it counts up from the | 5615 | relative to the selected window. If ARG is negative, it counts up from the |
| 5608 | bottom of the window. (ARG should be less than the height of the window.) | 5616 | bottom of the window. (ARG should be less than the height of the window.) |
| 5609 | 5617 | ||
| 5610 | If ARG is omitted or nil, erase the entire frame and then redraw with point | 5618 | If ARG is omitted or nil, then recenter with point on the middle line of |
| 5611 | in the center of the selected window. If `auto-resize-tool-bars' is set to | 5619 | the selected window; if the variable `recenter-redisplay' is non-nil, |
| 5612 | `grow-only', this resets the tool-bar's height to the minimum height needed. | 5620 | also erase the entire frame and redraw it (when `auto-resize-tool-bars' |
| 5621 | is set to `grow-only', this resets the tool-bar's height to the minimum | ||
| 5622 | height needed); if `recenter-redisplay' has the special value `tty', | ||
| 5623 | then only tty frame are redrawn. | ||
| 5613 | 5624 | ||
| 5614 | Just C-u as prefix means put point in the center of the window | 5625 | Just C-u as prefix means put point in the center of the window |
| 5615 | and redisplay normally--don't erase and redraw the frame. */) | 5626 | and redisplay normally--don't erase and redraw the frame. */) |
| @@ -5629,16 +5640,22 @@ and redisplay normally--don't erase and redraw the frame. */) | |||
| 5629 | 5640 | ||
| 5630 | if (NILP (arg)) | 5641 | if (NILP (arg)) |
| 5631 | { | 5642 | { |
| 5632 | int i; | 5643 | if (!NILP (Vrecenter_redisplay) |
| 5644 | && (!EQ (Vrecenter_redisplay, Qtty) | ||
| 5645 | || !NILP (Ftty_type (selected_frame)))) | ||
| 5646 | { | ||
| 5647 | int i; | ||
| 5633 | 5648 | ||
| 5634 | /* Invalidate pixel data calculated for all compositions. */ | 5649 | /* Invalidate pixel data calculated for all compositions. */ |
| 5635 | for (i = 0; i < n_compositions; i++) | 5650 | for (i = 0; i < n_compositions; i++) |
| 5636 | composition_table[i]->font = NULL; | 5651 | composition_table[i]->font = NULL; |
| 5637 | 5652 | ||
| 5638 | WINDOW_XFRAME (w)->minimize_tool_bar_window_p = 1; | 5653 | WINDOW_XFRAME (w)->minimize_tool_bar_window_p = 1; |
| 5654 | |||
| 5655 | Fredraw_frame (WINDOW_FRAME (w)); | ||
| 5656 | SET_FRAME_GARBAGED (WINDOW_XFRAME (w)); | ||
| 5657 | } | ||
| 5639 | 5658 | ||
| 5640 | Fredraw_frame (WINDOW_FRAME (w)); | ||
| 5641 | SET_FRAME_GARBAGED (WINDOW_XFRAME (w)); | ||
| 5642 | center_p = 1; | 5659 | center_p = 1; |
| 5643 | } | 5660 | } |
| 5644 | else if (CONSP (arg)) /* Just C-u. */ | 5661 | else if (CONSP (arg)) /* Just C-u. */ |
| @@ -7246,6 +7263,13 @@ selected; while the global part is run only once for the modified frame, | |||
| 7246 | with the relevant frame selected. */); | 7263 | with the relevant frame selected. */); |
| 7247 | Vwindow_configuration_change_hook = Qnil; | 7264 | Vwindow_configuration_change_hook = Qnil; |
| 7248 | 7265 | ||
| 7266 | DEFVAR_LISP ("recenter-redisplay", &Vrecenter_redisplay, | ||
| 7267 | doc: /* If non-nil, then the `recenter' command with a nil argument | ||
| 7268 | the entire frame to be redrawn; the special value `tty' causes the | ||
| 7269 | frame to be redrawn only if it is a tty frame. */); | ||
| 7270 | Vrecenter_redisplay = Qtty; | ||
| 7271 | |||
| 7272 | |||
| 7249 | defsubr (&Sselected_window); | 7273 | defsubr (&Sselected_window); |
| 7250 | defsubr (&Sminibuffer_window); | 7274 | defsubr (&Sminibuffer_window); |
| 7251 | defsubr (&Swindow_minibuffer_p); | 7275 | defsubr (&Swindow_minibuffer_p); |