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,
}
else
{
- int invis_p, newpos, next_stop, start_charpos;
+ int invis_p;
+ EMACS_INT newpos, next_stop, start_charpos;
Lisp_Object pos, prop, overlay;
/* First of all, is there invisible text at this position? */
it->position.bytepos = CHAR_TO_BYTE (it->position.charpos);
}
setup_for_ellipsis (it, 0);
+ /* Let the ellipsis display before
+ considering any properties of the following char.
+ Fixes jasonr@gnu.org 01 Oct 07 bug. */
+ handled = HANDLED_RETURN;
}
}
}
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);
struct frame *f;
int save_match_data;
{
-#ifdef USE_GTK
+#if defined (USE_GTK) || USE_MAC_TOOLBAR
int do_update = FRAME_EXTERNAL_TOOL_BAR (f);
#else
int do_update = WINDOWP (f->tool_bar_window)
struct it it;
struct glyph_row *row;
-#ifdef USE_GTK
+#if defined (USE_GTK) || USE_MAC_TOOLBAR
if (FRAME_EXTERNAL_TOOL_BAR (f))
update_frame_tool_bar (f);
return 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;
+ Lisp_Object old_frame = selected_frame;
/* Non-zero means redisplay has to consider all windows on all
frames. Zero means, only selected_window is considered. */
}
retry:
+ if (!EQ (old_frame, selected_frame)
+ && FRAME_LIVE_P (XFRAME (old_frame)))
+ /* When running redisplay, we play a bit fast-and-loose and allow e.g.
+ selected_frame and selected_window to be temporarily out-of-sync so
+ when we come back here via `goto retry', we need to resync because we
+ may need to run Elisp code (via prepare_menu_bars). */
+ select_frame_for_redisplay (old_frame);
+
pause = 0;
reconsider_clip_changes (w, current_buffer);
last_escape_glyph_frame = NULL;
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
minimum distance from the old window start. */
pos = it.current.pos;
min_distance = INFINITY;
- while ((distance = abs (CHARPOS (start_pos) - IT_CHARPOS (it))),
+ while ((distance = eabs (CHARPOS (start_pos) - IT_CHARPOS (it))),
distance < min_distance)
{
min_distance = distance;
int rc;
int centering_position = -1;
int last_line_misfit = 0;
- int save_beg_unchanged, save_end_unchanged;
+ int beg_unchanged, end_unchanged;
SET_TEXT_POS (lpoint, PT, PT_BYTE);
opoint = lpoint;
set_buffer_internal_1 (XBUFFER (w->buffer));
SET_TEXT_POS (opoint, PT, PT_BYTE);
- save_beg_unchanged = BEG_UNCHANGED;
- save_end_unchanged = END_UNCHANGED;
+ beg_unchanged = BEG_UNCHANGED;
+ end_unchanged = END_UNCHANGED;
current_matrix_up_to_date_p
= (!NILP (w->window_end_valid)
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 + beg_unchanged
+ && CHARPOS (startp) <= Z - 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
debug_method_add (w, "same window start");
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (f))
{
-#ifdef USE_GTK
+#if defined (USE_GTK) || USE_MAC_TOOLBAR
redisplay_tool_bar_p = FRAME_EXTERNAL_TOOL_BAR (f);
#else
redisplay_tool_bar_p = WINDOWP (f->tool_bar_window)
/* 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);
}
CHECK_BUFFER (buffer);
if (NILP (format))
- return build_string ("");
+ return empty_unibyte_string;
if (no_props)
face = Qnil;
{
mode_line_string_list = Fnreverse (mode_line_string_list);
str = Fmapconcat (intern ("identity"), mode_line_string_list,
- make_string ("", 0));
+ empty_unibyte_string);
}
unbind_to (count, Qnil);
#endif
break;
+ case '@':
+ {
+ Lisp_Object val;
+ val = call1 (intern ("file-remote-p"), current_buffer->directory);
+ if (NILP (val))
+ return "-";
+ else
+ return "@";
+ }
+
case 't': /* indicate TEXT or BINARY */
#ifdef MODE_LINE_BINARY_TEXT
return MODE_LINE_BINARY_TEXT (b);
return 0;
}
+DEFUN ("invisible-p", Finvisible_p, Sinvisible_p, 1, 1, 0,
+ doc: /* Non-nil if the property makes the text invisible.
+POS-OR-PROP can be a marker or number, in which case it is taken to be
+a position in the current buffer and the value of the `invisible' property
+is checked; or it can be some other value, which is then presumed to be the
+value of the `invisible' property of the text of interest.
+The non-nil value returned can be t for truly invisible text or something
+else if the text is replaced by an ellipsis. */)
+ (pos_or_prop)
+ Lisp_Object pos_or_prop;
+{
+ Lisp_Object prop
+ = (NATNUMP (pos_or_prop) || MARKERP (pos_or_prop)
+ ? Fget_char_property (pos_or_prop, Qinvisible, Qnil)
+ : pos_or_prop);
+ int invis = TEXT_PROP_MEANS_INVISIBLE (prop);
+ return (invis == 0 ? Qnil
+ : invis == 1 ? Qt
+ : make_number (invis));
+}
+
/* Calculate a width or height in pixels from a specification using
the following elements:
}
if (it->start_of_box_run_p && slice.x == 0)
- it->pixel_width += abs (face->box_line_width);
+ it->pixel_width += eabs (face->box_line_width);
if (it->end_of_box_run_p && slice.x + slice.width == img->width)
- it->pixel_width += abs (face->box_line_width);
+ it->pixel_width += eabs (face->box_line_width);
}
take_vertical_position_into_account (it);
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)
{
goto found;
}
else if (best_glyph == NULL
- || ((abs (g->charpos - pos)
- < abs (best_glyph->charpos - pos))
+ || ((eabs (g->charpos - pos)
+ < eabs (best_glyph->charpos - pos))
&& (right_p
? g->charpos < pos
: g->charpos > pos)))
defsubr (&Slookup_image_map);
#endif
defsubr (&Sformat_mode_line);
+ defsubr (&Sinvisible_p);
staticpro (&Qmenu_bar_update_hook);
Qmenu_bar_update_hook = intern ("menu-bar-update-hook");
= Vframe_title_format
= Fcons (intern ("multiple-frames"),
Fcons (build_string ("%b"),
- Fcons (Fcons (empty_string,
+ Fcons (Fcons (empty_unibyte_string,
Fcons (intern ("invocation-name"),
Fcons (build_string ("@"),
Fcons (intern ("system-name"),
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,