GNU Emacs is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Emacs is distributed in the hope that it will be useful,
it->c = *p, it->len = 1;
/* Record what we have and where it came from. */
- it->what = IT_CHARACTER;;
+ it->what = IT_CHARACTER;
it->object = it->w->buffer;
it->position = it->current.pos;
{
struct position pos;
- if (!FRAME_WINDOW_P (it->f))
+ /* The commented-out optimization uses vmotion on terminals. This
+ gives bad results, because elements like it->what, on which
+ callers such as pos_visible_p rely, aren't updated. */
+ /* if (!FRAME_WINDOW_P (it->f))
{
struct text_pos textpos;
- /* We can use vmotion on frames without proportional fonts. */
pos = *vmotion (IT_CHARPOS (*it), dvpos, it->w);
SET_TEXT_POS (textpos, pos.bufpos, pos.bytepos);
reseat (it, textpos, 1);
it->vpos += pos.vpos;
it->current_y += pos.vpos;
}
- else if (dvpos == 0)
+ else */
+
+ if (dvpos == 0)
{
/* DVPOS == 0 means move to the start of the screen line. */
move_it_vertically_backward (it, 0);
int must_finish = 0;
struct text_pos tlbufpos, tlendpos;
int number_of_visible_frames;
- int count;
+ int count, count1;
struct frame *sf;
int polling_stopped_here = 0;
update_mode_lines++;
}
+ /* Avoid invocation of point motion hooks by `current_column' below. */
+ count1 = SPECPDL_INDEX ();
+ specbind (Qinhibit_point_motion_hooks, Qt);
+
/* If %c is in the mode line, update it if needed. */
if (!NILP (w->column_number_displayed)
/* This alternative quickly identifies a common case
!= (int) current_column ())) /* iftc */
w->update_mode_line = Qt;
+ unbind_to (count1, Qnil);
+
FRAME_SCROLL_BOTTOM_VPOS (XFRAME (w->frame)) = -1;
/* The variable buffer_shared is set in redisplay_window and
w->force_start = Qt;
}
+ force_start:
+
/* Handle case where place to start displaying has been specified,
unless the specified location is outside the accessible range. */
if (!NILP (w->force_start)
than a simple mouse-click. */
if (NILP (w->start_at_line_beg)
&& NILP (do_mouse_tracking)
- && CHARPOS (startp) > BEGV)
+ && CHARPOS (startp) > BEGV
+ && CHARPOS (startp) > BEG + save_beg_unchanged
+ && CHARPOS (startp) <= Z - save_end_unchanged)
{
-#if 0
- /* The following code tried to make BEG_UNCHANGED and
- END_UNCHANGED up to date (similar to try_window_id).
- Is it important to do so?
-
- The trouble is that it's a little too strict when it
- comes to overlays: modify_overlay can call
- BUF_COMPUTE_UNCHANGED, which alters BUF_BEG_UNCHANGED and
- BUF_END_UNCHANGED directly without moving the gap.
-
- This can result in spurious recentering when overlays are
- altered in the buffer. So unless it's proven necessary,
- let's leave this commented out for now. -- cyd. */
- if (MODIFF > SAVE_MODIFF
- || BEG_UNCHANGED + END_UNCHANGED > Z_BYTE)
- {
- if (GPT - BEG < BEG_UNCHANGED)
- BEG_UNCHANGED = GPT - BEG;
- if (Z - GPT < END_UNCHANGED)
- END_UNCHANGED = Z - GPT;
- }
-#endif
-
- if (CHARPOS (startp) > BEG + save_beg_unchanged
- && CHARPOS (startp) <= Z - save_end_unchanged)
- {
- /* There doesn't seems to be a simple way to find a new
- window start that is near the old window start, so
- we just recenter. */
- goto recenter;
- }
+ w->force_start = Qt;
+ if (XMARKER (w->start)->buffer == current_buffer)
+ compute_window_start_on_continuation_line (w);
+ SET_TEXT_POS_FROM_MARKER (startp, w->start);
+ goto force_start;
}
#if GLYPH_DEBUG
/* Restore current_buffer and value of point in it. */
TEMP_SET_PT_BOTH (CHARPOS (opoint), BYTEPOS (opoint));
set_buffer_internal_1 (old);
- TEMP_SET_PT_BOTH (CHARPOS (lpoint), BYTEPOS (lpoint));
+ /* Avoid an abort in TEMP_SET_PT_BOTH if the buffer has become
+ shorter. This can be caused by log truncation in *Messages*. */
+ if (CHARPOS (lpoint) <= ZV)
+ TEMP_SET_PT_BOTH (CHARPOS (lpoint), BYTEPOS (lpoint));
unbind_to (count, Qnil);
}
nrows_scrolled);
/* Disable lines that must be updated. */
- for (i = 0; i < it.vpos; ++i)
+ for (i = 0; i < nrows_scrolled; ++i)
(start_row + i)->enabled_p = 0;
/* Re-compute Y positions. */
non_selected = 1;
}
- /* Nonselected window or nonselected frame. */
+ /* Detect a nonselected window or nonselected frame. */
else if (w != XWINDOW (f->selected_window)
#ifdef HAVE_WINDOW_SYSTEM
|| f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame
if (NILP (b->cursor_type))
return NO_CURSOR;
- /* Use cursor-in-non-selected-windows for non-selected window or frame. */
- if (non_selected)
- {
- alt_cursor = b->cursor_in_non_selected_windows;
- return get_specified_cursor_type (alt_cursor, width);
- }
-
/* Get the normal cursor type for this window. */
if (EQ (b->cursor_type, Qt))
{
else
cursor_type = get_specified_cursor_type (b->cursor_type, width);
+ /* Use cursor-in-non-selected-windows instead
+ for non-selected window or frame. */
+ if (non_selected)
+ {
+ alt_cursor = b->cursor_in_non_selected_windows;
+ if (!EQ (Qt, alt_cursor))
+ return get_specified_cursor_type (alt_cursor, width);
+ /* t means modify the normal cursor type. */
+ if (cursor_type == FILLED_BOX_CURSOR)
+ cursor_type = HOLLOW_BOX_CURSOR;
+ else if (cursor_type == BAR_CURSOR && *width > 1)
+ --*width;
+ return cursor_type;
+ }
+
/* Use normal cursor if not blinked off. */
if (!w->cursor_off_p)
{
mouse pointer enters it.
Autoselection selects the minibuffer only if it is active, and never
-unselects the minibuffer if it is active. */);
+unselects the minibuffer if it is active.
+
+When customizing this variable make sure that the actual value of
+`focus-follows-mouse' matches the behavior of your window manager. */);
Vmouse_autoselect_window = Qnil;
DEFVAR_LISP ("auto-resize-tool-bars", &Vauto_resize_tool_bars,
This dynamically changes the tool-bar's height to the minimum height
that is needed to make all tool-bar items visible.
If value is `grow-only', the tool-bar's height is only increased
-automatically; to decreace the tool-bar height, use \\[recenter]. */);
+automatically; to decrease the tool-bar height, use \\[recenter]. */);
Vauto_resize_tool_bars = Qt;
DEFVAR_BOOL ("auto-raise-tool-bar-buttons", &auto_raise_tool_bar_buttons_p,