aboutsummaryrefslogtreecommitdiffstats
path: root/src/indent.c
diff options
context:
space:
mode:
authorKenichi Handa2008-09-12 06:13:36 +0000
committerKenichi Handa2008-09-12 06:13:36 +0000
commitfc88345bb73f6bc7d7ddf8cf77c6467bd3a319da (patch)
tree908c5eabc6f78cc59e4149cc17f972401bece1e4 /src/indent.c
parent3eda4b1921bfb21049f3c9d584fb40840ea92d04 (diff)
downloademacs-fc88345bb73f6bc7d7ddf8cf77c6467bd3a319da.tar.gz
emacs-fc88345bb73f6bc7d7ddf8cf77c6467bd3a319da.zip
(scan_for_column): Don't handle automatic composition if the current
buffer is not associated with a window.
Diffstat (limited to 'src/indent.c')
-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)
533 register struct Lisp_Char_Table *dp = buffer_display_table (); 533 register struct Lisp_Char_Table *dp = buffer_display_table ();
534 int multibyte = !NILP (current_buffer->enable_multibyte_characters); 534 int multibyte = !NILP (current_buffer->enable_multibyte_characters);
535 struct composition_it cmp_it; 535 struct composition_it cmp_it;
536 Lisp_Object window;
537 struct window *w;
536 538
537 /* Start the scan at the beginning of this line with column number 0. */ 539 /* Start the scan at the beginning of this line with column number 0. */
538 register EMACS_INT col = 0, prev_col = 0; 540 register EMACS_INT col = 0, prev_col = 0;
@@ -549,6 +551,9 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
549 next_boundary = scan; 551 next_boundary = scan;
550 } 552 }
551 553
554 window = Fget_buffer_window (Fcurrent_buffer (), Qnil);
555 w = ! NILP (window) ? XWINDOW (window) : NULL;
556
552 if (tab_width <= 0 || tab_width > 1000) tab_width = 8; 557 if (tab_width <= 0 || tab_width > 1000) tab_width = 8;
553 bzero (&cmp_it, sizeof cmp_it); 558 bzero (&cmp_it, sizeof cmp_it);
554 cmp_it.id = -1; 559 cmp_it.id = -1;
@@ -597,7 +602,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
597 if (cmp_it.id >= 0 602 if (cmp_it.id >= 0
598 || (scan == cmp_it.stop_pos 603 || (scan == cmp_it.stop_pos
599 && composition_reseat_it (&cmp_it, scan, scan_byte, end, 604 && composition_reseat_it (&cmp_it, scan, scan_byte, end,
600 XWINDOW (selected_window), NULL, Qnil))) 605 w, NULL, Qnil)))
601 composition_update_it (&cmp_it, scan, scan_byte, Qnil); 606 composition_update_it (&cmp_it, scan, scan_byte, Qnil);
602 if (cmp_it.id >= 0) 607 if (cmp_it.id >= 0)
603 { 608 {