(2) POS is the last of the current buffer.
(3) A character at POS can't be a following byte of multibyte
character. */
- if (length > 0 && ASCII_BYTE_P (string[length - 1])) /* case (1) */
+ if (length > 0 && ASCII_CHAR_P (string[length - 1])) /* case (1) */
return 0;
if (pos_byte == Z_BYTE) /* case (2) */
return 0;
need to consider the caches of their base buffer. */
if (buf->base_buffer)
buf = buf->base_buffer;
- if (buf->newline_cache)
- invalidate_region_cache (buf,
- buf->newline_cache,
- start - BUF_BEG (buf), BUF_Z (buf) - end);
- if (buf->width_run_cache)
- invalidate_region_cache (buf,
- buf->width_run_cache,
- start - BUF_BEG (buf), BUF_Z (buf) - end);
+ /* The bidi_paragraph_cache must be invalidated first, because doing
+ so might need to use the newline_cache (via find_newline_no_quit,
+ see below). */
if (buf->bidi_paragraph_cache)
{
if (start != end
&start_byte);
set_buffer_internal (old);
}
- if (line_beg > BUF_BEG (buf))
- start = line_beg - 1;
+ start = line_beg - (line_beg > BUF_BEG (buf));
}
invalidate_region_cache (buf,
buf->bidi_paragraph_cache,
start - BUF_BEG (buf), BUF_Z (buf) - end);
}
+ if (buf->newline_cache)
+ invalidate_region_cache (buf,
+ buf->newline_cache,
+ start - BUF_BEG (buf), BUF_Z (buf) - end);
+ if (buf->width_run_cache)
+ invalidate_region_cache (buf,
+ buf->width_run_cache,
+ start - BUF_BEG (buf), BUF_Z (buf) - end);
}
/* These macros work with an argument named `preserve_ptr'
FETCH_START, FETCH_END, Qnil);
}
- if (! NILP (start_marker))
- free_marker (start_marker);
- if (! NILP (end_marker))
- free_marker (end_marker);
RESTORE_VALUE;
UNGCPRO;