summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2008-09-12 06:13:36 +0000
committerKenichi Handa <handa@m17n.org>2008-09-12 06:13:36 +0000
commita8ccbade04d3bf4efb71d4d7c8ca978eafc04ba2 (patch)
treecaf163bdace40f4d0b7c02bcac43af6e17b3e74f
parent416e8b41e4fe4f91c251e1a852c11c3bee425ff2 (diff)
downloademacs-a8ccbade04d3bf4efb71d4d7c8ca978eafc04ba2.tar.gz
(scan_for_column): Don't handle automatic composition if the current
buffer is not associated with a window.
-rw-r--r--src/indent.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/indent.c b/src/indent.c
index 809f775a221..edb445c296f 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -533,6 +533,8 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
register struct Lisp_Char_Table *dp = buffer_display_table ();
int multibyte = !NILP (current_buffer->enable_multibyte_characters);
struct composition_it cmp_it;
+ Lisp_Object window;
+ struct window *w;
/* Start the scan at the beginning of this line with column number 0. */
register EMACS_INT col = 0, prev_col = 0;
@@ -549,6 +551,9 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
next_boundary = scan;
}
+ window = Fget_buffer_window (Fcurrent_buffer (), Qnil);
+ w = ! NILP (window) ? XWINDOW (window) : NULL;
+
if (tab_width <= 0 || tab_width > 1000) tab_width = 8;
bzero (&cmp_it, sizeof cmp_it);
cmp_it.id = -1;
@@ -597,7 +602,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
if (cmp_it.id >= 0
|| (scan == cmp_it.stop_pos
&& composition_reseat_it (&cmp_it, scan, scan_byte, end,
- XWINDOW (selected_window), NULL, Qnil)))
+ w, NULL, Qnil)))
composition_update_it (&cmp_it, scan, scan_byte, Qnil);
if (cmp_it.id >= 0)
{