From: Chong Yidong Date: Tue, 24 Jun 2008 17:58:50 +0000 (+0000) Subject: (compute_motion): Obey integer values of truncate-partial-width-windows. X-Git-Tag: emacs-pretest-23.0.90~4542 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=81b6a6652625aab2207d2a3468d2553ae37f0a71;p=emacs.git (compute_motion): Obey integer values of truncate-partial-width-windows. --- diff --git a/src/indent.c b/src/indent.c index fdc042bc9e4..71e993e31a2 100644 --- a/src/indent.c +++ b/src/indent.c @@ -1349,10 +1349,20 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, if (hpos > width) { - if (hscroll - || (truncate_partial_width_windows - && ((width + continuation_glyph_width) - < FRAME_COLS (XFRAME (WINDOW_FRAME (win))))) + int total_width = width + continuation_glyph_width; + int truncate = 0; + + if (!NILP (Vtruncate_partial_width_windows) + && (total_width < FRAME_COLS (XFRAME (WINDOW_FRAME (win))))) + { + if (INTEGERP (Vtruncate_partial_width_windows)) + truncate + = total_width < XFASTINT (Vtruncate_partial_width_windows); + else + truncate = 1; + } + + if (hscroll || truncate || !NILP (current_buffer->truncate_lines)) { /* Truncating: skip to newline, unless we are already past