#include <config.h>
#include "lisp.h"
-#include <limits.h>
#include "buffer.h"
#include "commands.h"
#include "file-coding.h"
#endif
+#include "sysfile.h"
+
#ifdef HAVE_TTY
#include "console-tty.h"
-#ifdef HAVE_UNISTD_H
-#include <unistd.h> /* for isatty() */
-#endif
#endif /* HAVE_TTY */
/* Note: We have to be careful throughout this code to properly handle
Lisp_Object Qtop_bottom;
-#define WINDOW_SCROLLED(w) \
-(w->hscroll > 0 || w->left_xoffset)
+#define WINDOW_SCROLLED(w) ((w)->hscroll > 0 || (w)->left_xoffset)
\f
/***************************************************************************/
if (data->ch == '\n')
{
- char_glyph.charset = Vcharset_ascii;
- char_glyph.code_point = '\n';
+ char_glyph = ASCII_TO_CHARC ('\n');
data->font_is_bogus = 0;
/* Cheesy end-of-line pseudo-character. */
width = data->blank_width;
}
else
{
- char_glyph.code_point = ENCODE_CHAR (data->ch, char_glyph.charset);
- if (!EQ (char_glyph.charset, data->last_charset) ||
+ Lisp_Object charset;
+
+ char_glyph = CHAR_TO_CHARC (data->ch);
+ charset = CHARC_CHARSET (char_glyph);
+ if (!EQ (charset, data->last_charset) ||
data->findex != data->last_findex)
{
/* OK, we need to do things the hard way. */
struct face_cachel *cachel = WINDOW_FACE_CACHEL (w, data->findex);
Lisp_Object font_instance =
ensure_face_cachel_contains_charset (cachel, data->window,
- char_glyph.charset);
+ charset);
Lisp_Font_Instance *fi;
if (EQ (font_instance, Vthe_null_font_instance))
data->last_char_width = -1;
data->new_ascent = max (data->new_ascent, (int) fi->ascent);
data->new_descent = max (data->new_descent, (int) fi->descent);
- data->last_charset = char_glyph.charset;
+ data->last_charset = charset;
data->last_findex = data->findex;
}
/* Text but not in buffer */
crb->bufpos = 0;
crb->type = RUNE_CHAR;
- if (data->font_is_bogus)
- {
- char_glyph.charset = Vcharset_ascii;
- char_glyph.code_point = '~';
- crb->object.cglyph = char_glyph;
- }
- else
- crb->object.cglyph = char_glyph;
+ crb->object.cglyph = data->font_is_bogus
+ ? ASCII_TO_CHARC ('~')
+ : char_glyph;
crb->endpos = 0;
if (data->cursor_type == CURSOR_ON)
else
findex = get_builtin_face_cache_index (w, face);
- instance = glyph_image_instance (gb->glyph, data->window,
+ instance = glyph_image_instance (gb->glyph, data->window,
ERROR_ME_NOT, 1);
if (TEXT_IMAGE_INSTANCEP (instance))
{
{
struct rune *rb = Dynarr_atp (db->runes, elt);
- if ((rb->type == RUNE_CHAR
- && EQ (rb->object.cglyph.charset, Vcharset_ascii)
- && rb->object.cglyph.code_point == ' ')
+ if ((rb->type == RUNE_CHAR && CHARC_ASCII_EQ (rb->object.cglyph, ' '))
|| rb->type == RUNE_BLANK)
{
dl->bounds.left_white += rb->width;
{
struct rune *rb = Dynarr_atp (db->runes, elt);
- if (!(rb->type == RUNE_CHAR
- && (EQ (rb->object.cglyph.charset, Vcharset_ascii)
- || EQ (rb->object.cglyph.charset, Vcharset_control_1)
- || EQ (rb->object.cglyph.charset, Vcharset_latin_iso8859_1))
- && isspace (rb->object.cglyph.code_point))
+ if (!(rb->type == RUNE_CHAR && CHARC_IS_SPACE (rb->object.cglyph))
&& !rb->type == RUNE_BLANK)
{
dl->bounds.right_white = rb->xpos + rb->width;
/* result_str is nil when we're building a frame or icon title. Otherwise,
we're building a modeline, so the offset starts at the modeline
- horizontal scrolling ammount */
+ horizontal scrolling amount */
if (! NILP (result_str))
offset = w->modeline_hscroll;
generate_fstring_runes (w, &data, 0, 0, -1, format_str, 0,
{
if (Dynarr_atp (db->runes, elt)->type == RUNE_CHAR)
{
- Charc ec = Dynarr_atp (db->runes, elt)->object.cglyph;
-
- len += (set_charptr_emchar (strdata + len,
- DECODE_CHAR (ec.charset,
- ec.code_point)));
+ len += (set_charptr_emchar
+ (strdata + len,
+ CHARC_TO_CHAR (Dynarr_atp (db->runes,
+ elt)->object.cglyph)));
}
}
int truncate_win = b ? window_truncation_on (w) : 0;
int end_glyph_width = 0;
- /* we're going to ditch selective display for static text, its an
- FSF thing and invisble extents are the way to go
- here. Implementing it also relies on a number of buffer-specific
+ /* We're going to ditch selective display for static text, it's an
+ FSF thing and invisible extents are the way to go here.
+ Implementing it also relies on a number of buffer-specific
functions that we don't have the luxury of being able to use
here. */
{
struct rune *rb = Dynarr_atp (db->runes, elt);
- if ((rb->type == RUNE_CHAR
- && EQ (rb->object.cglyph.charset, Vcharset_ascii)
- && rb->object.cglyph.code_point == ' ')
+ if ((rb->type == RUNE_CHAR && CHARC_ASCII_EQ (rb->object.cglyph, ' '))
|| rb->type == RUNE_BLANK)
{
dl->bounds.left_white += rb->width;
{
struct rune *rb = Dynarr_atp (db->runes, elt);
- if (!(rb->type == RUNE_CHAR
- && (EQ (rb->object.cglyph.charset, Vcharset_ascii)
- || EQ (rb->object.cglyph.charset, Vcharset_control_1)
- || EQ (rb->object.cglyph.charset, Vcharset_latin_iso8859_1))
- && isspace (rb->object.cglyph.code_point))
+ if (!(rb->type == RUNE_CHAR && CHARC_IS_SPACE (rb->object.cglyph))
&& !rb->type == RUNE_BLANK)
{
dl->bounds.right_white = rb->xpos + rb->width;
&& !(MINI_WINDOW_P (w) && f->buffers_changed)
&& !f->frame_changed
&& !truncation_changed
- /* check whether start is really at the begining of a line GE */
+ /* check whether start is really at the beginning of a line GE */
&& (!w->start_at_line_beg || beginning_of_line_p (b, startp))
)
{
if (f->clear)
f->frame_changed = 1;
- /* Invalidate the subwindow cache. We use subwindows_changed here to
- cause subwindows to get instantiated. This is because
+ /* Invalidate the subwindow caches. We use subwindows_changed here
+ to cause subwindows to get instantiated. This is because
subwindows_state_changed is less strict - dealing with things
like the clicked state of button. We have to do this before
redisplaying the gutters as subwindows get unmapped in the
process.*/
+ if (f->frame_changed)
+ reset_frame_subwindow_instance_cache (f);
+
if (f->frame_changed || f->subwindows_changed)
{
/* we have to do this so the gutter gets regenerated. */
displayed. The end of the last line is also know as the window end
position.
- WARNING: It is possible that rediplay failed to layout any lines for the
+ WARNING: It is possible that redisplay failed to layout any lines for the
windows. Under normal circumstances this is rare. However it seems that it
does occur in the following situation: A mouse event has come in and we
need to compute its location in a window. That code (in
}
else if (past_end
|| (rb->type == RUNE_CHAR
- && EQ (rb->object.cglyph.charset,
- Vcharset_ascii)
- && rb->object.cglyph.code_point == '\n'))
+ && CHARC_ASCII_EQ (rb->object.cglyph, '\n')))
{
(*row)--;
/* At this point we may have glyphs in the right
redisplay_frame (f, 1);
- /* If we don't reset the global redisplay flafs here, subsequent
+ /* If we don't reset the global redisplay flags here, subsequent
changes to the display will not get registered by redisplay
because it thinks it already has registered changes. If you
really knew what you were doing you could confuse redisplay by
DEFVAR_LISP_MAGIC ("overlay-arrow-string", &Voverlay_arrow_string /*
String or glyph to display as an arrow. See also `overlay-arrow-position'.
-(Note that despite the name of this variable, it can be set to a glyph as
+\(Note that despite the name of this variable, it can be set to a glyph as
well as a string.)
*/ ,
redisplay_variable_changed);
offsetof (struct window, left_margin_width),
some_window_value_changed,
offsetof (struct frame, left_margin_width),
- margin_width_changed_in_frame);
+ margin_width_changed_in_frame, 0);
DEFVAR_SPECIFIER ("right-margin-width", &Vright_margin_width /*
*Width of right margin.
offsetof (struct window, right_margin_width),
some_window_value_changed,
offsetof (struct frame, right_margin_width),
- margin_width_changed_in_frame);
+ margin_width_changed_in_frame, 0);
DEFVAR_SPECIFIER ("minimum-line-ascent", &Vminimum_line_ascent /*
*Minimum ascent height of lines.
set_specifier_caching (Vminimum_line_ascent,
offsetof (struct window, minimum_line_ascent),
some_window_value_changed,
- 0, 0);
+ 0, 0, 0);
DEFVAR_SPECIFIER ("minimum-line-descent", &Vminimum_line_descent /*
*Minimum descent height of lines.
set_specifier_caching (Vminimum_line_descent,
offsetof (struct window, minimum_line_descent),
some_window_value_changed,
- 0, 0);
+ 0, 0, 0);
DEFVAR_SPECIFIER ("use-left-overflow", &Vuse_left_overflow /*
*Non-nil means use the left outside margin as extra whitespace when
set_specifier_caching (Vuse_left_overflow,
offsetof (struct window, use_left_overflow),
some_window_value_changed,
- 0, 0);
+ 0, 0, 0);
DEFVAR_SPECIFIER ("use-right-overflow", &Vuse_right_overflow /*
*Non-nil means use the right outside margin as extra whitespace when
set_specifier_caching (Vuse_right_overflow,
offsetof (struct window, use_right_overflow),
some_window_value_changed,
- 0, 0);
+ 0, 0, 0);
DEFVAR_SPECIFIER ("text-cursor-visible-p", &Vtext_cursor_visible_p /*
*Non-nil means the text cursor is visible (this is usually the case).
set_specifier_caching (Vtext_cursor_visible_p,
offsetof (struct window, text_cursor_visible_p),
text_cursor_visible_p_changed,
- 0, 0);
+ 0, 0, 0);
}