aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2009-06-23 07:07:45 +0000
committerMiles Bader2009-06-23 07:07:45 +0000
commit666e158e382bca51630b3822a54bf51c52d41d23 (patch)
tree75125ed242a47eeba4403398b3845faea4f097ac
parentc6da7cd2b63cc9094d690b74875bf8609b5c0107 (diff)
downloademacs-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/ChangeLog4
-rw-r--r--doc/emacs/display.texi16
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/cus-start.el6
-rw-r--r--src/ChangeLog7
-rw-r--r--src/window.c46
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 @@
12009-06-23 Miles Bader <miles@gnu.org>
2
3 * display.texi (Scrolling): Document `recenter-redisplay'
4
12009-06-21 Chong Yidong <cyd@stupidchicken.com> 52009-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
56Scroll the selected window to center point vertically within it and 56Scroll the selected window to center point vertically within it and
57redisplay the screen (@code{recenter-top-bottom}). 57maybe 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
75window, scrolling it so that the current screen line is exactly in the 75window, scrolling it so that the current screen line is exactly in the
76center of the window, or as close to the center as possible. It also 76center of the window, or as close to the center as possible. If the
77clears the screen and redisplays all windows; this is useful in case 77variable @var{recenter-redisplay} is non-nil, it also clears the
78the screen becomes garbled for any reason (@pxref{Screen Garbled}). 78screen and redisplays all windows; this is useful in case the screen
79becomes garbled for any reason (@pxref{Screen Garbled}). If
80@var{recenter-redisplay} has the special value @code{tty} (the
81default), 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
81so that point is on the topmost screen line. Typing a third @kbd{C-l} 84so 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
95lines from the bottom. When given an argument, @kbd{C-l} does not 98lines from the bottom. When given an argument, @kbd{C-l} does not
96clear the screen or cycle through different screen positions. 99clear 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
104selected 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 @@
12009-06-23 Miles Bader <miles@gnu.org>
2
3 * cus-start.el: Add entry for `recenter-redisplay'.
4
12009-06-22 Dan Nicolaescu <dann@ics.uci.edu> 52009-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 @@
12009-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
12009-06-23 Jim Meyering <meyering@redhat.com> 82009-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;
193extern EMACS_INT scroll_margin; 193extern EMACS_INT scroll_margin;
194 194
195extern Lisp_Object Qwindow_scroll_functions, Vwindow_scroll_functions; 195extern 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
201static Lisp_Object Vrecenter_redisplay;
202extern Lisp_Object Qtty;
203
196 204
197DEFUN ("windowp", Fwindowp, Swindowp, 1, 1, 0, 205DEFUN ("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
5604DEFUN ("recenter", Frecenter, Srecenter, 0, 1, "P", 5612DEFUN ("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.
5606With prefix argument ARG, recenter putting point on screen line ARG 5614With prefix argument ARG, recenter putting point on screen line ARG
5607relative to the selected window. If ARG is negative, it counts up from the 5615relative to the selected window. If ARG is negative, it counts up from the
5608bottom of the window. (ARG should be less than the height of the window.) 5616bottom of the window. (ARG should be less than the height of the window.)
5609 5617
5610If ARG is omitted or nil, erase the entire frame and then redraw with point 5618If ARG is omitted or nil, then recenter with point on the middle line of
5611in the center of the selected window. If `auto-resize-tool-bars' is set to 5619the 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. 5620also erase the entire frame and redraw it (when `auto-resize-tool-bars'
5621is set to `grow-only', this resets the tool-bar's height to the minimum
5622height needed); if `recenter-redisplay' has the special value `tty',
5623then only tty frame are redrawn.
5613 5624
5614Just C-u as prefix means put point in the center of the window 5625Just C-u as prefix means put point in the center of the window
5615and redisplay normally--don't erase and redraw the frame. */) 5626and 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,
7246with the relevant frame selected. */); 7263with 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
7268the entire frame to be redrawn; the special value `tty' causes the
7269frame 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);