aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiles Bader2009-06-23 07:07:45 +0000
committerMiles Bader2009-06-23 07:07:45 +0000
commit666e158e382bca51630b3822a54bf51c52d41d23 (patch)
tree75125ed242a47eeba4403398b3845faea4f097ac /src
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
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/window.c46
2 files changed, 42 insertions, 11 deletions
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);