emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs src/window.c src/ChangeLog lisp/cus-start...


From: Miles Bader
Subject: [Emacs-diffs] emacs src/window.c src/ChangeLog lisp/cus-start...
Date: Tue, 23 Jun 2009 07:07:53 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Miles Bader <miles>     09/06/23 07:07:52

Modified files:
        src            : window.c ChangeLog 
        lisp           : cus-start.el ChangeLog 
        doc/emacs      : ChangeLog display.texi 

Log message:
        Add the `recenter-redisplay' variable, and make `recenter' use it.
        
        Revision: address@hidden/emacs--devo--0--patch-1604

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/window.c?cvsroot=emacs&r1=1.638&r2=1.639
http://cvs.savannah.gnu.org/viewcvs/emacs/src/ChangeLog?cvsroot=emacs&r1=1.7594&r2=1.7595
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/cus-start.el?cvsroot=emacs&r1=1.136&r2=1.137
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.15718&r2=1.15719
http://cvs.savannah.gnu.org/viewcvs/emacs/doc/emacs/ChangeLog?cvsroot=emacs&r1=1.333&r2=1.334
http://cvs.savannah.gnu.org/viewcvs/emacs/doc/emacs/display.texi?cvsroot=emacs&r1=1.17&r2=1.18

Patches:
Index: src/window.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/window.c,v
retrieving revision 1.638
retrieving revision 1.639
diff -u -b -r1.638 -r1.639
--- src/window.c        8 Jan 2009 03:16:08 -0000       1.638
+++ src/window.c        23 Jun 2009 07:07:45 -0000      1.639
@@ -194,6 +194,14 @@
 
 extern Lisp_Object Qwindow_scroll_functions, Vwindow_scroll_functions;
 
+/* If non-nil, then the `recenter' command with a nil argument
+   the entire frame to be redrawn; the special value `tty' causes the
+   frame to be redrawn only if it is a tty frame.  */
+
+static Lisp_Object Vrecenter_redisplay;
+extern Lisp_Object Qtty;
+
+
 DEFUN ("windowp", Fwindowp, Swindowp, 1, 1, 0,
        doc: /* Return t if OBJECT is a window.  */)
      (object)
@@ -5602,14 +5610,17 @@
 
 
 DEFUN ("recenter", Frecenter, Srecenter, 0, 1, "P",
-       doc: /* Center point in selected window and redisplay frame.
+       doc: /* Center point in selected window and maybe redisplay frame.
 With prefix argument ARG, recenter putting point on screen line ARG
 relative to the selected window.  If ARG is negative, it counts up from the
 bottom of the window.  (ARG should be less than the height of the window.)
 
-If ARG is omitted or nil, erase the entire frame and then redraw with point
-in the center of the selected window.  If `auto-resize-tool-bars' is set to
-`grow-only', this resets the tool-bar's height to the minimum height needed.
+If ARG is omitted or nil, then recenter with point on the middle line of
+the selected window; if the variable `recenter-redisplay' is non-nil,
+also erase the entire frame and redraw it (when `auto-resize-tool-bars'
+is set to `grow-only', this resets the tool-bar's height to the minimum
+height needed); if `recenter-redisplay' has the special value `tty',
+then only tty frame are redrawn.
 
 Just C-u as prefix means put point in the center of the window
 and redisplay normally--don't erase and redraw the frame.  */)
@@ -5629,6 +5640,10 @@
 
   if (NILP (arg))
     {
+      if (!NILP (Vrecenter_redisplay)
+         && (!EQ (Vrecenter_redisplay, Qtty)
+             || !NILP (Ftty_type (selected_frame))))
+       {
       int i;
 
       /* Invalidate pixel data calculated for all compositions.  */
@@ -5639,6 +5654,8 @@
 
       Fredraw_frame (WINDOW_FRAME (w));
       SET_FRAME_GARBAGED (WINDOW_XFRAME (w));
+       }
+
       center_p = 1;
     }
   else if (CONSP (arg)) /* Just C-u. */
@@ -7246,6 +7263,13 @@
 with the relevant frame selected.  */);
   Vwindow_configuration_change_hook = Qnil;
 
+  DEFVAR_LISP ("recenter-redisplay", &Vrecenter_redisplay,
+              doc: /* If non-nil, then the `recenter' command with a nil 
argument
+the entire frame to be redrawn; the special value `tty' causes the
+frame to be redrawn only if it is a tty frame.  */);
+  Vrecenter_redisplay = Qtty;
+
+
   defsubr (&Sselected_window);
   defsubr (&Sminibuffer_window);
   defsubr (&Swindow_minibuffer_p);

Index: src/ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/src/ChangeLog,v
retrieving revision 1.7594
retrieving revision 1.7595
diff -u -b -r1.7594 -r1.7595
--- src/ChangeLog       23 Jun 2009 06:49:20 -0000      1.7594
+++ src/ChangeLog       23 Jun 2009 07:07:45 -0000      1.7595
@@ -1,3 +1,10 @@
+2009-06-23  Miles Bader  <address@hidden>
+
+       * window.c (Vrecenter_redisplay): New variable.
+       (syms_of_window): Initialize it.
+       (Qtty): New extern declaration.
+       (Frecenter): Only do redisplay if Vrecenter_redisplay requests it.
+
 2009-06-23  Jim Meyering  <address@hidden>
 
        Don't dereference NULL upon failed malloc and realloc

Index: lisp/cus-start.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/cus-start.el,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -b -r1.136 -r1.137
--- lisp/cus-start.el   27 Mar 2009 16:50:25 -0000      1.136
+++ lisp/cus-start.el   23 Jun 2009 07:07:47 -0000      1.137
@@ -307,6 +307,12 @@
                       (const :tag "Off (nil)" :value nil)
                       (const :tag "Full screen (t)" :value t)
                       (other :tag "Always" 1)) "22.1")
+            (recenter-redisplay windows
+                                (choice
+                                 (const :tag "Never (nil)" :value nil)
+                                 (const :tag "Only on ttys" :value tty)
+                                 (other :tag "Always" t))
+                                "23.1")
             ;; xdisp.c
             (scroll-step windows integer)
             (scroll-conservatively windows integer)

Index: lisp/ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.15718
retrieving revision 1.15719
diff -u -b -r1.15718 -r1.15719
--- lisp/ChangeLog      23 Jun 2009 06:35:40 -0000      1.15718
+++ lisp/ChangeLog      23 Jun 2009 07:07:47 -0000      1.15719
@@ -1,3 +1,7 @@
+2009-06-23  Miles Bader  <address@hidden>
+
+       * cus-start.el: Add entry for `recenter-redisplay'.
+
 2009-06-22  Dan Nicolaescu  <address@hidden>
 
        * vc-hooks.el (vc-stay-local-p, vc-state, vc-working-revision):

Index: doc/emacs/ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/doc/emacs/ChangeLog,v
retrieving revision 1.333
retrieving revision 1.334
diff -u -b -r1.333 -r1.334
--- doc/emacs/ChangeLog 21 Jun 2009 14:35:26 -0000      1.333
+++ doc/emacs/ChangeLog 23 Jun 2009 07:07:51 -0000      1.334
@@ -1,3 +1,7 @@
+2009-06-23  Miles Bader  <address@hidden>
+
+       * display.texi (Scrolling): Document `recenter-redisplay'
+
 2009-06-21  Chong Yidong  <address@hidden>
 
        * Branch for 23.1.

Index: doc/emacs/display.texi
===================================================================
RCS file: /cvsroot/emacs/emacs/doc/emacs/display.texi,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- doc/emacs/display.texi      10 Jun 2009 15:16:55 -0000      1.17
+++ doc/emacs/display.texi      23 Jun 2009 07:07:52 -0000      1.18
@@ -54,7 +54,7 @@
 @table @kbd
 @item C-l
 Scroll the selected window to center point vertically within it and
-redisplay the screen (@code{recenter-top-bottom}).
+maybe redisplay the screen (@code{recenter-top-bottom}).
 @item C-v
 @itemx @key{next}
 @itemx @key{PageDown}
@@ -73,9 +73,12 @@
   The most basic scrolling command is @kbd{C-l}
 (@code{recenter-top-bottom}).  This @dfn{recenters} the selected
 window, scrolling it so that the current screen line is exactly in the
-center of the window, or as close to the center as possible.  It also
-clears the screen and redisplays all windows; this is useful in case
-the screen becomes garbled for any reason (@pxref{Screen Garbled}).
+center of the window, or as close to the center as possible.  If the
+variable @var{recenter-redisplay} is non-nil, it also clears the
+screen and redisplays all windows; this is useful in case the screen
+becomes garbled for any reason (@pxref{Screen Garbled}).  If
address@hidden has the special value @code{tty} (the
+default), then redisplay only happens on tty frames.
 
   Typing @kbd{C-l} twice in a row (@kbd{C-l C-l}) scrolls the window
 so that point is on the topmost screen line.  Typing a third @kbd{C-l}
@@ -95,6 +98,11 @@
 lines from the bottom.  When given an argument, @kbd{C-l} does not
 clear the screen or cycle through different screen positions.
 
address@hidden recenter-redisplay
+  When the variable @code{recenter-redisplay} is non-nil, the
address@hidden and @code{recenter-top-bottom} commands redisplay the
+selected frame when they are invoked without a prefix argument.
+
 @kindex C-v
 @kindex M-v
 @kindex next




reply via email to

[Prev in Thread] Current Thread [Next in Thread]