/* Window creation, deletion and examination for GNU Emacs.
Does not include redisplay.
Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of GNU Emacs.
Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_configuration_p;
Lisp_Object Qdisplay_buffer;
-Lisp_Object Qscroll_up, Qscroll_down;
+Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command;
Lisp_Object Qwindow_size_fixed;
extern Lisp_Object Qleft_margin, Qright_margin;
struct window *root;
xassert (MINI_WINDOW_P (w));
- xassert (delta >= 0);
+ /* Commenting out the following assertion goes against the stated interface
+ of the function, but it currently does not seem to do anything useful.
+ See discussion of this issue in the thread for bug#4534.
+ xassert (delta >= 0); */
/* Compute how much we can enlarge the mini-window without deleting
other windows. */
root = XWINDOW (FRAME_ROOT_WINDOW (f));
- if (delta)
+ if (delta > 0)
{
int min_height = window_min_size (root, 0, 0, 0, 0);
if (XFASTINT (root->total_lines) - delta < min_height)
if (!NILP (Vscroll_preserve_screen_position))
{
/* We preserve the goal pixel coordinate across consecutive
- calls to scroll-up or scroll-down. This avoids the
+ calls to scroll-up, scroll-down and other commands that
+ have the `scroll-command' property. This avoids the
possibility of point becoming "stuck" on a tall line when
scrolling by one line. */
if (window_scroll_pixel_based_preserve_y < 0
- || (!EQ (current_kboard->Vlast_command, Qscroll_up)
- && !EQ (current_kboard->Vlast_command, Qscroll_down)))
+ || !SYMBOLP (current_kboard->Vlast_command)
+ || NILP (Fget (current_kboard->Vlast_command, Qscroll_command)))
{
start_display (&it, w, start);
move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS);
if (!NILP (Vscroll_preserve_screen_position))
{
if (window_scroll_preserve_vpos <= 0
- || (!EQ (current_kboard->Vlast_command, Qscroll_up)
- && !EQ (current_kboard->Vlast_command, Qscroll_down)))
+ || !SYMBOLP (current_kboard->Vlast_command)
+ || NILP (Fget (current_kboard->Vlast_command, Qscroll_command)))
{
struct position posit
= *compute_motion (startpos, 0, 0, 0,
void
syms_of_window ()
{
- Qscroll_up = intern ("scroll-up");
+ Qscroll_up = intern_c_string ("scroll-up");
staticpro (&Qscroll_up);
- Qscroll_down = intern ("scroll-down");
+ Qscroll_down = intern_c_string ("scroll-down");
staticpro (&Qscroll_down);
- Qwindow_size_fixed = intern ("window-size-fixed");
+ Qscroll_command = intern_c_string ("scroll-command");
+ staticpro (&Qscroll_command);
+
+ Fput (Qscroll_up, Qscroll_command, Qt);
+ Fput (Qscroll_down, Qscroll_command, Qt);
+
+ Qwindow_size_fixed = intern_c_string ("window-size-fixed");
staticpro (&Qwindow_size_fixed);
Fset (Qwindow_size_fixed, Qnil);
staticpro (&Qwindow_configuration_change_hook);
Qwindow_configuration_change_hook
- = intern ("window-configuration-change-hook");
+ = intern_c_string ("window-configuration-change-hook");
- Qwindowp = intern ("windowp");
+ Qwindowp = intern_c_string ("windowp");
staticpro (&Qwindowp);
- Qwindow_configuration_p = intern ("window-configuration-p");
+ Qwindow_configuration_p = intern_c_string ("window-configuration-p");
staticpro (&Qwindow_configuration_p);
- Qwindow_live_p = intern ("window-live-p");
+ Qwindow_live_p = intern_c_string ("window-live-p");
staticpro (&Qwindow_live_p);
- Qdisplay_buffer = intern ("display-buffer");
+ Qdisplay_buffer = intern_c_string ("display-buffer");
staticpro (&Qdisplay_buffer);
- Qtemp_buffer_show_hook = intern ("temp-buffer-show-hook");
+ Qtemp_buffer_show_hook = intern_c_string ("temp-buffer-show-hook");
staticpro (&Qtemp_buffer_show_hook);
staticpro (&Vwindow_list);
A value of t means point keeps its screen position if the scroll
command moved it vertically out of the window, e.g. when scrolling
by full screens.
-Any other value means point always keeps its screen position. */);
+Any other value means point always keeps its screen position.
+Scroll commands should have the `scroll-command' property
+on their symbols to be controlled by this variable. */);
Vscroll_preserve_screen_position = Qnil;
DEFVAR_LISP ("window-point-insertion-type", &Vwindow_point_insertion_type,
initial_define_key (control_x_map, '<', "scroll-left");
initial_define_key (control_x_map, '>', "scroll-right");
- initial_define_key (global_map, Ctl ('V'), "scroll-up");
+ initial_define_key (global_map, Ctl ('V'), "scroll-up-command");
initial_define_key (meta_map, Ctl ('V'), "scroll-other-window");
- initial_define_key (meta_map, 'v', "scroll-down");
-
- initial_define_key (global_map, Ctl('L'), "recenter");
- initial_define_key (meta_map, 'r', "move-to-window-line");
+ initial_define_key (meta_map, 'v', "scroll-down-command");
}
/* arch-tag: 90a9c576-0590-48f1-a5f1-6c96a0452d9f