Now that we have `center-to-window-line', recenter needn't be in C
anymore -- its definition becomes a trivial combination of
center-to-window-line and redraw-frame.
C ChangeLog:
1998-04-30 Hrvoje Niksic <hniksic(a)srce.hr>
* dired.c (make_directory_hash_table): Constify.
* scrollbar.c (Fscrollbar_page_up): Use Fcenter_to_window_line
instead of Frecenter.
(Fscrollbar_page_down): Ditto.
(Fscrollbar_to_top): Ditto.
(Fscrollbar_to_bottom): Ditto.
* window.c (Frecenter): Removed.
Lisp ChangeLog:
1998-04-30 Hrvoje Niksic <hniksic(a)srce.hr>
* window-xemacs.el (recenter): Define.
--- src/lisp.h.orig Thu Apr 30 21:04:29 1998
+++ src/lisp.h Thu Apr 30 21:04:29 1998
@@ -2008,7 +2008,7 @@
unsigned int lisp_to_word (Lisp_Object);
/* Defined in dired.c */
-Lisp_Object make_directory_hash_table (char *);
+Lisp_Object make_directory_hash_table (CONST char *);
Lisp_Object wasteful_word_to_lisp (unsigned int);
/* Defined in doc.c */
--- src/window.c.orig Thu Apr 30 16:45:19 1998
+++ src/window.c Thu Apr 30 16:53:20 1998
@@ -4185,7 +4185,7 @@
return Fset_window_hscroll (window, make_int (w->hscroll - XINT (arg)));
}
-
+
DEFUN ("center-to-window-line", Fcenter_to_window_line, 0, 2, "_P", /*
Center point in WINDOW. With N, put point on line N.
The desired position of point is always relative to the window.
@@ -4215,29 +4215,6 @@
return Qnil;
}
-DEFUN ("recenter", Frecenter, 0, 2, "_P", /*
-Center point in WINDOW and redisplay frame. With N, put point on line N.
-The desired position of point is always relative to the window.
-Just C-u as prefix means put point in the center of the window.
-No N (i.e., it is nil) erases the entire frame and then
-redraws with point in the center of the window.
-If WINDOW is nil, the selected window is used.
-*/
- (n, window))
-{
- if (NILP (n))
- {
- struct frame *f = XFRAME (decode_window (window)->frame);
- MARK_FRAME_CHANGED (f);
- SET_FRAME_CLEAR (f);
- }
- else if (CONSP (n))
- n = Qnil;
- Fcenter_to_window_line (n, window);
- return Qnil;
-}
-
-
DEFUN ("move-to-window-line", Fmove_to_window_line, 1, 2, "_P", /*
Position point relative to WINDOW.
With no argument, position text at center of window.
@@ -5569,7 +5546,6 @@
DEFSUBR (Fother_window_for_scrolling);
DEFSUBR (Fscroll_other_window);
DEFSUBR (Fcenter_to_window_line);
- DEFSUBR (Frecenter);
DEFSUBR (Fmove_to_window_line);
#ifdef MEMORY_USAGE_STATS
DEFSUBR (Fwindow_memory_usage);
--- src/dired.c.orig Thu Apr 30 05:16:33 1998
+++ src/dired.c Thu Apr 30 05:17:14 1998
@@ -529,18 +529,18 @@
Lisp_Object
-make_directory_hash_table (char *path)
+make_directory_hash_table (CONST char *path)
{
DIR *d;
- DIRENTRY *dp;
- Bytecount len;
Lisp_Object hash = make_lisp_hashtable (100, HASHTABLE_NONWEAK,
HASHTABLE_EQUAL);
if ((d = opendir (path)))
{
+ DIRENTRY *dp;
+
while ((dp = readdir (d)))
{
- len = NAMLEN (dp);
+ Bytecount len = NAMLEN (dp);
if (DIRENTRY_NONEMPTY (dp))
Fputhash (make_ext_string ((Bufbyte *) dp->d_name, len,
FORMAT_FILENAME), Qt, hash);
--- src/scrollbar.c.orig Thu Apr 30 21:06:12 1998
+++ src/scrollbar.c Thu Apr 30 21:08:59 1998
@@ -65,6 +65,8 @@
Lisp_Object Vscrollbar_pointer_glyph;
+EXFUN (Fcenter_to_window_line, 2);
+
static void update_scrollbar_instance (struct window *w, int vertical,
struct scrollbar_instance *instance);
@@ -741,7 +743,7 @@
bufpos = vmotion (XWINDOW (window), XINT (Fwindow_point (window)),
XINT (value), 0);
Fset_window_point (window, make_int (bufpos));
- Frecenter (Qzero, window);
+ Fcenter_to_window_line (Qzero, window);
}
#endif /* Athena */
zmacs_region_stays = 1;
@@ -773,7 +775,7 @@
Lisp_Object value = Fcdr (object);
CHECK_INT (value);
Fmove_to_window_line (value, window);
- Frecenter (Qzero, window);
+ Fcenter_to_window_line (Qzero, window);
}
#endif /* Athena */
zmacs_region_stays = 1;
@@ -791,7 +793,7 @@
{
Lisp_Object orig_pt = Fwindow_point (window);
Fset_window_point (window, Fpoint_min (Fwindow_buffer (window)));
- Frecenter (Qzero, window);
+ Fcenter_to_window_line (Qzero, window);
scrollbar_reset_cursor (window, orig_pt);
zmacs_region_stays = 1;
return Qnil;
@@ -808,7 +810,7 @@
{
Lisp_Object orig_pt = Fwindow_point (window);
Fset_window_point (window, Fpoint_max (Fwindow_buffer (window)));
- Frecenter (make_int (-3), window);
+ Fcenter_to_window_line (make_int (-3), window);
scrollbar_reset_cursor (window, orig_pt);
zmacs_region_stays = 1;
return Qnil;
--- lisp/window-xemacs.el.orig Thu Apr 30 16:50:57 1998
+++ lisp/window-xemacs.el Thu Apr 30 16:52:53 1998
@@ -39,6 +39,18 @@
"Windows within a frame."
:group 'environment)
+(defun recenter (n &optional window)
+ "Center point in WINDOW and redisplay frame. With N, put point on line N.
+The desired position of point is always relative to the window.
+Just C-u as prefix means put point in the center of the window.
+No N (i.e., it is nil) erases the entire frame and then
+redraws with point in the center of the window.
+If WINDOW is nil, the selected window is used."
+ (interactive "_P")
+ (center-to-window-line (if (consp n) nil n) window)
+ (when (null n)
+ (redraw-frame (window-frame window) t)))
+
(defun backward-other-window (arg &optional all-frames device)
"Select the ARG'th different window on this frame, going backwards.
This is just like calling `other-window' with the arg negated."
--
Hrvoje Niksic <hniksic(a)srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
Ask not for whom the <CONTROL-G> tolls.