static struct text_pos string_pos_nchars_ahead (struct text_pos,
Lisp_Object, ptrdiff_t);
static struct text_pos string_pos (ptrdiff_t, Lisp_Object);
-static struct text_pos c_string_pos (ptrdiff_t, const char *, int);
-static ptrdiff_t number_of_chars (const char *, int);
+static struct text_pos c_string_pos (ptrdiff_t, const char *, bool);
+static ptrdiff_t number_of_chars (const char *, bool);
static void compute_stop_pos (struct it *);
static void compute_string_pos (struct text_pos *, struct text_pos,
Lisp_Object);
means recognize multibyte characters. */
static struct text_pos
-c_string_pos (ptrdiff_t charpos, const char *s, int multibyte_p)
+c_string_pos (ptrdiff_t charpos, const char *s, bool multibyte_p)
{
struct text_pos pos;
non-zero means recognize multibyte characters. */
static ptrdiff_t
-number_of_chars (const char *s, int multibyte_p)
+number_of_chars (const char *s, bool multibyte_p)
{
ptrdiff_t nchars;
static void
back_to_previous_line_start (struct it *it)
{
- IT_CHARPOS (*it) = find_next_newline_no_quit (IT_CHARPOS (*it) - 1, -1);
- IT_BYTEPOS (*it) = CHAR_TO_BYTE (IT_CHARPOS (*it));
+ IT_CHARPOS (*it)
+ = find_next_newline_no_quit (IT_CHARPOS (*it) - 1,
+ -1, &IT_BYTEPOS (*it));
}
short-cut. */
if (!newline_found_p)
{
- ptrdiff_t start = IT_CHARPOS (*it);
- ptrdiff_t limit = find_next_newline_no_quit (start, 1);
+ ptrdiff_t bytepos, start = IT_CHARPOS (*it);
+ ptrdiff_t limit = find_next_newline_no_quit (start, 1, &bytepos);
Lisp_Object pos;
eassert (!STRINGP (it->string));
if (!it->bidi_p)
{
IT_CHARPOS (*it) = limit;
- IT_BYTEPOS (*it) = CHAR_TO_BYTE (limit);
+ IT_BYTEPOS (*it) = bytepos;
}
else
{
if (string_p)
it->bidi_it.charpos = it->bidi_it.bytepos = 0;
else
- {
- it->bidi_it.charpos = find_next_newline_no_quit (IT_CHARPOS (*it),
- -1);
- it->bidi_it.bytepos = CHAR_TO_BYTE (it->bidi_it.charpos);
- }
+ it->bidi_it.charpos
+ = find_next_newline_no_quit (IT_CHARPOS (*it), -1,
+ &it->bidi_it.bytepos);
bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 1);
do
{
&& FETCH_BYTE (IT_BYTEPOS (*it) - 1) != '\n')
{
ptrdiff_t nl_pos =
- find_next_newline_no_quit (IT_CHARPOS (*it) - 1, -1);
+ find_next_newline_no_quit (IT_CHARPOS (*it) - 1, -1, NULL);
move_it_to (it, nl_pos, -1, -1, -1, MOVE_TO_POS);
}
/* Add a string M of length NBYTES to the message log, optionally
- terminated with a newline when NLFLAG is non-zero. MULTIBYTE, if
- nonzero, means interpret the contents of M as multibyte. This
+ terminated with a newline when NLFLAG is true. MULTIBYTE, if
+ true, means interpret the contents of M as multibyte. This
function calls low-level routines in order to bypass text property
hooks, etc. which might not be safe to run.
so the buffer M must NOT point to a Lisp string. */
void
-message_dolog (const char *m, ptrdiff_t nbytes, int nlflag, int multibyte)
+message_dolog (const char *m, ptrdiff_t nbytes, bool nlflag, bool multibyte)
{
const unsigned char *msg = (const unsigned char *) m;
if (STRINGP (m))
{
ptrdiff_t nbytes = SBYTES (m);
- int multibyte = STRING_MULTIBYTE (m);
+ bool multibyte = STRING_MULTIBYTE (m);
USE_SAFE_ALLOCA;
char *buffer = SAFE_ALLOCA (nbytes);
memcpy (buffer, SDATA (m), nbytes);
const unsigned char *arrow_end = arrow_string + arrow_len;
const unsigned char *p;
struct it it;
- int multibyte_p;
+ bool multibyte_p;
int n_glyphs_before;
set_buffer_temp (buffer);
risky);
else if (c != 0)
{
- int multibyte;
+ bool multibyte;
ptrdiff_t bytepos, charpos;
const char *spec;
Lisp_Object string;
decode_mode_spec_coding (Lisp_Object coding_system, register char *buf, int eol_flag)
{
Lisp_Object val;
- int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters));
+ bool multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters));
const unsigned char *eol_str;
int eol_str_len;
/* The EOL conversion we are using. */
if (FRAME_HAS_VERTICAL_SCROLL_BARS (XFRAME (w->frame)))
return;
+ /* Note: It is necessary to redraw both the left and the right
+ borders, for when only this single window W is being
+ redisplayed. */
if (!WINDOW_RIGHTMOST_P (w)
&& !WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
{
FRAME_RIF (f)->draw_vertical_window_border (w, x1, y0, y1);
}
- else if (!WINDOW_LEFTMOST_P (w)
- && !WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
+ if (!WINDOW_LEFTMOST_P (w)
+ && !WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
{
int x0, x1, y0, y1;