Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map;
Lisp_Object Qwindow_scroll_functions;
-Lisp_Object Qwindow_text_change_functions;
-Lisp_Object Qredisplay_end_trigger_functions;
+static Lisp_Object Qwindow_text_change_functions;
+static Lisp_Object Qredisplay_end_trigger_functions;
Lisp_Object Qinhibit_point_motion_hooks;
-Lisp_Object QCeval, QCfile, QCdata, QCpropertize;
-Lisp_Object Qfontified;
-Lisp_Object Qgrow_only;
-Lisp_Object Qinhibit_eval_during_redisplay;
-Lisp_Object Qbuffer_position, Qposition, Qobject;
-Lisp_Object Qright_to_left, Qleft_to_right;
+static Lisp_Object QCeval, QCpropertize;
+Lisp_Object QCfile, QCdata;
+static Lisp_Object Qfontified;
+static Lisp_Object Qgrow_only;
+static Lisp_Object Qinhibit_eval_during_redisplay;
+static Lisp_Object Qbuffer_position, Qposition, Qobject;
+static Lisp_Object Qright_to_left, Qleft_to_right;
/* Cursor shapes */
Lisp_Object Qbar, Qhbar, Qbox, Qhollow;
/* Pointer shapes */
-Lisp_Object Qarrow, Qhand, Qtext;
+static Lisp_Object Qarrow, Qhand;
+Lisp_Object Qtext;
/* Holds the list (error). */
-Lisp_Object list_of_error;
+static Lisp_Object list_of_error;
-Lisp_Object Qfontification_functions;
+static Lisp_Object Qfontification_functions;
-Lisp_Object Qwrap_prefix;
-Lisp_Object Qline_prefix;
+static Lisp_Object Qwrap_prefix;
+static Lisp_Object Qline_prefix;
/* Non-nil means don't actually do any redisplay. */
Lisp_Object Qdisplay;
-Lisp_Object Qspace, QCalign_to, QCrelative_width, QCrelative_height;
-Lisp_Object Qleft_margin, Qright_margin, Qspace_width, Qraise;
-Lisp_Object Qslice;
+Lisp_Object Qspace, QCalign_to;
+static Lisp_Object QCrelative_width, QCrelative_height;
+Lisp_Object Qleft_margin, Qright_margin;
+static Lisp_Object Qspace_width, Qraise;
+static Lisp_Object Qslice;
Lisp_Object Qcenter;
-Lisp_Object Qmargin, Qpointer;
-Lisp_Object Qline_height;
+static Lisp_Object Qmargin, Qpointer;
+static Lisp_Object Qline_height;
#ifdef HAVE_WINDOW_SYSTEM
/* Name of the face used to highlight trailing whitespace. */
-Lisp_Object Qtrailing_whitespace;
+static Lisp_Object Qtrailing_whitespace;
/* Name and number of the face used to highlight escape glyphs. */
-Lisp_Object Qescape_glyph;
+static Lisp_Object Qescape_glyph;
/* Name and number of the face used to highlight non-breaking spaces. */
-Lisp_Object Qnobreak_space;
+static Lisp_Object Qnobreak_space;
/* The symbol `image' which is the car of the lists used to represent
images in Lisp. Also a tool bar style. */
Lisp_Object Qimage;
/* The image map types. */
-Lisp_Object QCmap, QCpointer;
-Lisp_Object Qrect, Qcircle, Qpoly;
+Lisp_Object QCmap;
+static Lisp_Object QCpointer;
+static Lisp_Object Qrect, Qcircle, Qpoly;
/* Tool bar styles */
Lisp_Object Qboth, Qboth_horiz, Qtext_image_horiz;
Voverlay_arrow_position is a marker, last-arrow-position is its
numerical position. */
-Lisp_Object Qlast_arrow_position, Qlast_arrow_string;
+static Lisp_Object Qlast_arrow_position, Qlast_arrow_string;
/* Alternative overlay-arrow-string and overlay-arrow-bitmap
properties on a symbol in overlay-arrow-variable-list. */
-Lisp_Object Qoverlay_arrow_string, Qoverlay_arrow_bitmap;
+static Lisp_Object Qoverlay_arrow_string, Qoverlay_arrow_bitmap;
Lisp_Object Qmenu_bar_update_hook;
message_enable_multibyte on the stack, the function restore_message
pops the stack and displays MESSAGE again. */
-Lisp_Object Vmessage_stack;
+static Lisp_Object Vmessage_stack;
/* Nonzero means multibyte characters were enabled when the echo area
message was specified. */
-int message_enable_multibyte;
+static int message_enable_multibyte;
/* Nonzero if we should redraw the mode lines on the next redisplay. */
/* Nonzero after display_mode_line if %l was used and it displayed a
line number. */
-int line_number_displayed;
+static int line_number_displayed;
/* The name of the *Messages* buffer, a string. */
/* Nonzero if echo area is being used by print; zero if being used by
message. */
-int message_buf_print;
+static int message_buf_print;
/* The symbol `inhibit-menubar-update' and its DEFVAR_BOOL variable. */
-Lisp_Object Qinhibit_menubar_update;
-Lisp_Object Qmessage_truncate_lines;
+static Lisp_Object Qinhibit_menubar_update;
+static Lisp_Object Qmessage_truncate_lines;
/* Set to 1 in clear_message to make redisplay_internal aware
of an emptied echo area. */
glyphs. Also used in direct_output_for_insert. */
#define MAX_SCRATCH_GLYPHS 100
-struct glyph_row scratch_glyph_row;
+static struct glyph_row scratch_glyph_row;
static struct glyph scratch_glyphs[MAX_SCRATCH_GLYPHS];
/* Ascent and height of the last line processed by move_it_to. */
#define TRACE_MOVE(x) (void) 0
#endif
-Lisp_Object Qauto_hscroll_mode;
+static Lisp_Object Qauto_hscroll_mode;
/* Buffer being redisplayed -- for redisplay_window_error. */
-struct buffer *displayed_buffer;
+static struct buffer *displayed_buffer;
/* Value returned from text property handlers (see below). */
int redisplaying_p;
-Lisp_Object Qinhibit_free_realized_faces;
+static Lisp_Object Qinhibit_free_realized_faces;
/* If a string, XTread_socket generates an event to display that string.
(The display is done in read_char.) */
Lisp_Object Qglyphless_char;
/* Symbol for the purpose of Vglyphless_char_display. */
-Lisp_Object Qglyphless_char_display;
+static Lisp_Object Qglyphless_char_display;
/* Method symbols for Vglyphless_char_display. */
static Lisp_Object Qhex_code, Qempty_box, Qthin_space, Qzero_width;
/* Function prototypes. */
static void setup_for_ellipsis (struct it *, int);
+static void set_iterator_to_next (struct it *, int);
static void mark_window_display_accurate_1 (struct window *, int);
static int single_display_spec_string_p (Lisp_Object, Lisp_Object);
static int display_prop_string_p (Lisp_Object, Lisp_Object);
static void handle_line_prefix (struct it *);
static void pint2str (char *, int, EMACS_INT);
-static void pint2hrstr (char *, int, int);
+static void pint2hrstr (char *, int, EMACS_INT);
static struct text_pos run_window_scroll_functions (Lisp_Object,
struct text_pos);
static void reconsider_clip_changes (struct window *, struct buffer *);
EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
static void clear_garbaged_frames (void);
static int current_message_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
+static void pop_message (void);
static int truncate_message_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
+static void set_message (const char *, Lisp_Object, EMACS_INT, int);
static int set_message_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
static int display_echo_area (struct window *);
static int display_echo_area_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
static Lisp_Object redisplay_window_error (Lisp_Object);
static Lisp_Object redisplay_window_0 (Lisp_Object);
static Lisp_Object redisplay_window_1 (Lisp_Object);
+static int set_cursor_from_row (struct window *, struct glyph_row *,
+ struct glyph_matrix *, EMACS_INT, EMACS_INT,
+ int, int);
static int update_menu_bar (struct frame *, int, int);
static int try_window_reusing_current_matrix (struct window *);
static int try_window_id (struct window *);
static int store_mode_line_string (const char *, Lisp_Object, int, int, int, Lisp_Object);
static const char *decode_mode_spec (struct window *, int, int, Lisp_Object *);
static void display_menu_bar (struct window *);
-static int display_count_lines (EMACS_INT, EMACS_INT, int, EMACS_INT *);
+static EMACS_INT display_count_lines (EMACS_INT, EMACS_INT, EMACS_INT,
+ EMACS_INT *);
static int display_string (const char *, Lisp_Object, Lisp_Object,
EMACS_INT, EMACS_INT, struct it *, int, int, int, int);
static void compute_line_metrics (struct it *);
struct display_pos *);
static void reseat_to_string (struct it *, const char *,
Lisp_Object, EMACS_INT, EMACS_INT, int, int);
+static int get_next_display_element (struct it *);
static enum move_it_result
move_it_in_display_line_to (struct it *, EMACS_INT, int,
enum move_operation_enum);
#endif /* HAVE_WINDOW_SYSTEM */
+static void show_mouse_face (Mouse_HLInfo *, enum draw_glyphs_face);
static int coords_in_mouse_face_p (struct window *, int, int);
*BOTTOM_RIGHT_Y the coordinates of the bottom-right corner of the
box. */
-INLINE void
+static INLINE void
window_box_edges (struct window *w, int area, int *top_left_x, int *top_left_y,
int *bottom_right_x, int *bottom_right_y)
{
}
-/* Given HPOS/VPOS in the current matrix of W, return corresponding
- frame-relative pixel positions in *FRAME_X and *FRAME_Y. If we
- can't tell the positions because W's display is not up to date,
- return 0. */
-
-int
-glyph_to_pixel_coords (struct window *w, int hpos, int vpos,
- int *frame_x, int *frame_y)
-{
-#ifdef HAVE_WINDOW_SYSTEM
- if (FRAME_WINDOW_P (XFRAME (WINDOW_FRAME (w))))
- {
- int success_p;
-
- xassert (hpos >= 0 && hpos < w->current_matrix->matrix_w);
- xassert (vpos >= 0 && vpos < w->current_matrix->matrix_h);
-
- if (display_completed)
- {
- struct glyph_row *row = MATRIX_ROW (w->current_matrix, vpos);
- struct glyph *glyph = row->glyphs[TEXT_AREA];
- struct glyph *end = glyph + min (hpos, row->used[TEXT_AREA]);
-
- hpos = row->x;
- vpos = row->y;
- while (glyph < end)
- {
- hpos += glyph->pixel_width;
- ++glyph;
- }
-
- /* If first glyph is partially visible, its first visible position is still 0. */
- if (hpos < 0)
- hpos = 0;
-
- success_p = 1;
- }
- else
- {
- hpos = vpos = 0;
- success_p = 0;
- }
-
- *frame_x = WINDOW_TO_FRAME_PIXEL_X (w, hpos);
- *frame_y = WINDOW_TO_FRAME_PIXEL_Y (w, vpos);
- return success_p;
- }
-#endif
-
- *frame_x = hpos;
- *frame_y = vpos;
- return 1;
-}
-
-
/* Find the glyph under window-relative coordinates X/Y in window W.
Consider only glyphs from buffer text, i.e. no glyphs from overlay
strings. Return in *HPOS and *VPOS the row and column number of
return glyph;
}
-/* EXPORT:
- Convert frame-relative x/y to coordinates relative to window W.
+/* Convert frame-relative x/y to coordinates relative to window W.
Takes pseudo-windows into account. */
-void
+static void
frame_to_window_pixel_xy (struct window *w, int *x, int *y)
{
if (w->pseudo_window_p)
_after_ bidi iteration avoids affecting the visual
order of the displayed text when invisible properties
are added or removed. */
- if (it->bidi_it.first_elt)
+ if (it->bidi_it.first_elt && it->bidi_it.charpos < ZV)
{
/* If we were `reseat'ed to a new paragraph,
determine the paragraph base direction. We need
{
struct Lisp_Vector *v = XVECTOR (DISP_INVIS_VECTOR (it->dp));
it->dpvec = v->contents;
- it->dpend = v->contents + v->size;
+ it->dpend = v->contents + v->header.size;
}
else
{
}
-/* Set up IT from a single `display' specification PROP. OBJECT
+/* Set up IT from a single `display' property specification SPEC. OBJECT
is the object in which the `display' property was found. *POSITION
is the position at which it was found. DISPLAY_REPLACED_P non-zero
means that we previously saw a display specification which already
OVERLAY is the overlay this `display' property came from,
or nil if it was a text property.
- If PROP is a `space' or `image' specification, and in some other
+ If SPEC is a `space' or `image' specification, and in some other
cases too, set *POSITION to the position where the `display'
property ends.
static int
handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
Lisp_Object overlay, struct text_pos *position,
- int display_replaced_before_p)
+ int display_replaced_p)
{
Lisp_Object form;
Lisp_Object location, value;
#endif /* not HAVE_WINDOW_SYSTEM */
|| (CONSP (value) && EQ (XCAR (value), Qspace)));
- if (valid_p && !display_replaced_before_p)
+ if (valid_p && !display_replaced_p)
{
/* Save current settings of IT so that we can restore them
when we are finished with the glyph property value. */
if (CHAR_TABLE_P (Vglyphless_char_display)
&& CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (Vglyphless_char_display)) >= 1)
- glyphless_method = (c >= 0
- ? CHAR_TABLE_REF (Vglyphless_char_display, c)
- : XCHAR_TABLE (Vglyphless_char_display)->extras[0]);
+ {
+ if (c >= 0)
+ {
+ glyphless_method = CHAR_TABLE_REF (Vglyphless_char_display, c);
+ if (CONSP (glyphless_method))
+ glyphless_method = FRAME_WINDOW_P (it->f)
+ ? XCAR (glyphless_method)
+ : XCDR (glyphless_method);
+ }
+ else
+ glyphless_method = XCHAR_TABLE (Vglyphless_char_display)->extras[0];
+ }
+
retry:
if (NILP (glyphless_method))
{
unsigned last_glyphless_glyph_face_id = (1 << FACE_ID_BITS);
int last_glyphless_glyph_merged_face_id = 0;
-int
+static int
get_next_display_element (struct it *it)
{
/* Non-zero means that we found a display element. Zero means that
/* Return the first character from the display table
entry, if not empty. If empty, don't display the
current character. */
- if (v->size)
+ if (v->header.size)
{
it->dpvec_char_len = it->len;
it->dpvec = v->contents;
- it->dpend = v->contents + v->size;
+ it->dpend = v->contents + v->header.size;
it->current.dpvec_index = 0;
it->dpvec_face_id = -1;
it->saved_face_id = it->face_id;
}
}
-#ifdef HAVE_WINDOW_SYSTEM
/* Adjust face id for a multibyte character. There are no multibyte
character in unibyte text. */
if ((it->what == IT_CHARACTER || it->what == IT_COMPOSITION)
it->string);
}
}
-#endif
done:
/* Is this character the last one of a run of characters with
{
if (m)
{
- EMACS_INT len;
+ size_t len;
len = doprnt (FRAME_MESSAGE_BUF (f),
FRAME_MESSAGE_BUF_SIZE (f), m, (char *)0, ap);
}
+#if 0
/* The non-logging version of message. */
void
Vmessage_log_max = old_log_max;
va_end (ap);
}
+#endif
/* Display the current message in the current mini-buffer. This is
/* Pop the top-most entry off Vmessage_stack. */
-void
+static void
pop_message (void)
{
xassert (CONSP (Vmessage_stack));
to t before calling set_message_1 (which calls insert).
*/
-void
+static void
set_message (const char *s, Lisp_Object string,
EMACS_INT nbytes, int multibyte_p)
{
return 0. PREV_BUF and PREV_PT are the last point buffer and
position. BUF and PT are the current point buffer and position. */
-int
+static int
check_point_in_composition (struct buffer *prev_buf, EMACS_INT prev_pt,
struct buffer *buf, EMACS_INT pt)
{
Return 0 if cursor is not on this row, 1 otherwise. */
-int
+static int
set_cursor_from_row (struct window *w, struct glyph_row *row,
struct glyph_matrix *matrix,
EMACS_INT delta, EMACS_INT delta_bytes,
return rc;
}
+#if !defined USE_TOOLKIT_SCROLL_BARS || defined USE_GTK
+static
+#endif
void
set_vertical_scroll_bar (struct window *w)
{
/* If there is a scroll margin at the top of the window, find
its character position. */
- if (margin)
+ if (margin
+ /* Cannot call start_display if startp is not in the
+ accessible region of the buffer. This can happen when we
+ have just switched to a different buffer and/or changed
+ its restriction. In that case, startp is initialized to
+ the character position 1 (BEG) because we did not yet
+ have chance to display the buffer even once. */
+ && BEGV <= CHARPOS (startp) && CHARPOS (startp) <= ZV)
{
struct it it1;
&& EQ (FRAME_SELECTED_WINDOW (f), window))
{
int redisplay_menu_p = 0;
- int redisplay_tool_bar_p = 0;
if (FRAME_WINDOW_P (f))
{
if (FRAME_WINDOW_P (f))
{
#if defined (USE_GTK) || defined (HAVE_NS)
- redisplay_tool_bar_p = FRAME_EXTERNAL_TOOL_BAR (f);
+ if (FRAME_EXTERNAL_TOOL_BAR (f))
+ redisplay_tool_bar (f);
#else
- redisplay_tool_bar_p = WINDOWP (f->tool_bar_window)
- && (FRAME_TOOL_BAR_LINES (f) > 0
- || !NILP (Vauto_resize_tool_bars));
+ if (WINDOWP (f->tool_bar_window)
+ && (FRAME_TOOL_BAR_LINES (f) > 0
+ || !NILP (Vauto_resize_tool_bars))
+ && redisplay_tool_bar (f))
+ ignore_mouse_drag_p = 1;
#endif
-
- if (redisplay_tool_bar_p && redisplay_tool_bar (f))
- {
- ignore_mouse_drag_p = 1;
- }
}
#endif
}
/* Highlight trailing whitespace, if any, in ROW. */
-void
+static void
highlight_trailing_whitespace (struct frame *f, struct glyph_row *row)
{
int used = row->used[TEXT_AREA];
/* Display all items of the menu bar. */
items = FRAME_MENU_BAR_ITEMS (it.f);
- for (i = 0; i < XVECTOR (items)->size; i += 4)
+ for (i = 0; i < ASIZE (items); i += 4)
{
Lisp_Object string;
};
static void
-pint2hrstr (char *buf, int width, int d)
+pint2hrstr (char *buf, int width, EMACS_INT d)
{
/* We aim to represent the nonnegative integer D as
QUOTIENT.TENTHS * 10 ^ (3 * EXPONENT). */
- int quotient = d;
+ EMACS_INT quotient = d;
int remainder = 0;
/* -1 means: do not use TENTHS. */
int tenths = -1;
case 'l':
{
EMACS_INT startpos, startpos_byte, line, linepos, linepos_byte;
- int topline, nlines, height;
+ EMACS_INT topline, nlines, height;
EMACS_INT junk;
/* %c and %l are ignored in `frame-title-format'. */
EMACS_INT limit = BUF_BEGV (b);
EMACS_INT limit_byte = BUF_BEGV_BYTE (b);
EMACS_INT position;
- int distance = (height * 2 + 30) * line_number_display_limit_width;
+ EMACS_INT distance =
+ (height * 2 + 30) * line_number_display_limit_width;
if (startpos - distance > limit)
{
so get us a 2-digit number that is close. */
if (total == 100)
total = 99;
- sprintf (decode_mode_spec_buf, "%2ld%%", (long)total);
+ sprintf (decode_mode_spec_buf, "%2"pI"d%%", total);
return decode_mode_spec_buf;
}
}
if (total == 100)
total = 99;
if (toppos <= BUF_BEGV (b))
- sprintf (decode_mode_spec_buf, "Top%2ld%%", (long)total);
+ sprintf (decode_mode_spec_buf, "Top%2"pI"d%%", total);
else
- sprintf (decode_mode_spec_buf, "%2ld%%", (long)total);
+ sprintf (decode_mode_spec_buf, "%2"pI"d%%", total);
return decode_mode_spec_buf;
}
}
Set *BYTE_POS_PTR to 1 if we found COUNT lines, 0 if we hit LIMIT. */
-static int
+static EMACS_INT
display_count_lines (EMACS_INT start_byte,
- EMACS_INT limit_byte, int count,
+ EMACS_INT limit_byte, EMACS_INT count,
EMACS_INT *byte_pos_ptr)
{
register unsigned char *cursor;
unsigned char *base;
- register int ceiling;
+ register EMACS_INT ceiling;
register unsigned char *ceiling_addr;
- int orig_count = count;
+ EMACS_INT orig_count = count;
/* If we are not in selective display mode,
check only for newlines. */
{
if (! STRINGP (acronym) && CHAR_TABLE_P (Vglyphless_char_display))
acronym = CHAR_TABLE_REF (Vglyphless_char_display, it->c);
+ if (CONSP (acronym))
+ acronym = XCAR (acronym);
str = STRINGP (acronym) ? SSDATA (acronym) : "";
}
else
int lbearing, rbearing;
int i, width, ascent, descent;
int left_padded = 0, right_padded = 0;
- int c;
+ int c IF_LINT (= 0); /* cmp->glyph_len can't be zero; see Bug#8512 */
XChar2b char2b;
struct font_metrics *pcm;
int font_not_found_p;
/* Implementation of draw_row_with_mouse_face for GUI sessions, GPM,
and MSDOS. */
-void
+static void
draw_row_with_mouse_face (struct window *w, int start_x, struct glyph_row *row,
int start_hpos, int end_hpos,
enum draw_glyphs_face draw)
#endif
}
-/* EXPORT:
- Display the active region described by mouse_face_* according to DRAW. */
+/* Display the active region described by mouse_face_* according to DRAW. */
-void
+static void
show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
{
struct window *w = XWINDOW (hlinfo->mouse_face_window);
{
struct Lisp_Vector *v = XVECTOR (XCDR (hot_spot));
Lisp_Object *poly = v->contents;
- int n = v->size;
+ int n = v->header.size;
int i;
int inside = 0;
Lisp_Object lx, ly;
Fput (Qglyphless_char_display, Qchar_table_extra_slots, make_number (1));
DEFVAR_LISP ("glyphless-char-display", Vglyphless_char_display,
- doc: /* Char-table to control displaying of glyphless characters.
-Each element, if non-nil, is an ASCII acronym string (displayed in a box)
-or one of these symbols:
- hex-code: display the hexadecimal code of a character in a box
- empty-box: display as an empty box
- thin-space: display as 1-pixel width space
- zero-width: don't display
-
-It has one extra slot to control the display of a character for which
-no font is found. The value of the slot is `hex-code' or `empty-box'.
-The default is `empty-box'. */);
+ doc: /* Char-table defining glyphless characters.
+Each element, if non-nil, should be one of the following:
+ an ASCII acronym string: display this string in a box
+ `hex-code': display the hexadecimal code of a character in a box
+ `empty-box': display as an empty box
+ `thin-space': display as 1-pixel width space
+ `zero-width': don't display
+An element may also be a cons cell (GRAPHICAL . TEXT), which specifies the
+display method for graphical terminals and text terminals respectively.
+GRAPHICAL and TEXT should each have one of the values listed above.
+
+The char-table has one extra slot to control the display of a character for
+which no font is found. This slot only takes effect on graphical terminals.
+Its value should be an ASCII acronym string, `hex-code', `empty-box', or
+`thin-space'. The default is `empty-box'. */);
Vglyphless_char_display = Fmake_char_table (Qglyphless_char_display, Qnil);
Fset_char_table_extra_slot (Vglyphless_char_display, make_number (0),
Qempty_box);
mini_w = XWINDOW (minibuf_window);
root_window = FRAME_ROOT_WINDOW (XFRAME (WINDOW_FRAME (mini_w)));
+ echo_area_window = minibuf_window;
if (!noninteractive)
{