From baed8445dd2b64d5aaa19fcf110ae05ce591f4d6 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 29 Jun 2008 13:56:50 +0000 Subject: [PATCH] (Fvertical_motion): Properly handle float column arg. --- src/ChangeLog | 62 +++++++++++++++++++++++++++------------------------ src/indent.c | 15 ++++++++----- 2 files changed, 42 insertions(+), 35 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index df8c4b524be..5e26e44b61d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,39 +1,43 @@ +2008-06-29 Stefan Monnier + + * indent.c (Fvertical_motion): Properly handle float column arg. + 2008-06-28 Jason Rumney - * w32term.c (pfnGetFontUnicodeRanges): Remove unused function pointer. - (pfnSetLayeredWindowAttributes): New function pointer. - (w32_initialize): Initialize it when supported. - (x_set_frame_alpha): New function. + * w32term.c (pfnGetFontUnicodeRanges): Remove unused function pointer. + (pfnSetLayeredWindowAttributes): New function pointer. + (w32_initialize): Initialize it when supported. + (x_set_frame_alpha): New function. - * w32fns.c (Fx_create_frame): Initialize frame parameter `alpha'. - (w32_frame_parm_handlers): Set alpha handler. + * w32fns.c (Fx_create_frame): Initialize frame parameter `alpha'. + (w32_frame_parm_handlers): Set alpha handler. - * frame.c (x_set_alpha) [HAVE_NTGUI]: Call x_set_frame_alpha. + * frame.c (x_set_alpha) [HAVE_NTGUI]: Call x_set_frame_alpha. 2008-06-27 Jason Rumney - * w32fns.c (x_to_w32_font, w32_to_x_font, x_to_w32_weight) - (w32_to_x_weight, w32_to_all_x_charsets): Remove obsolete functions. - (w32_to_x_charset, x_to_w32_charset) - (Qw32_charset_ansi, Qw32_charset_symbol, Qw32_charset_default) - (Qw32_charset_shiftjis, Qw32_charset_hangeul, Qw32_charset_johab) - (Qw32_charset_chinesebig5, Qw32_charset_gb2312, Qw32_charset_oem) - (Qw32_charset_easteurope, Qw32_charset_turkish, Qw32_charset_baltic) - (Qw32_charset_russian, Qw32_charset_arabic, Qw32_charset_greek) - (Qw32_charset_hebrew, Qw32_charset_vietnamese, Qw32_charset_thai) - (Qw32_charset_mac, Vw32_charset_info_alist): Move to w32font.c. - (Qw32_charset_unicode): Remove. - (syms_of_w32fns): Update for above changes. - - * w32font.c (w32_to_x_charset, x_to_w32_charset) - (Qw32_charset_ansi, Qw32_charset_symbol, Qw32_charset_default) - (Qw32_charset_shiftjis, Qw32_charset_hangeul, Qw32_charset_johab) - (Qw32_charset_chinesebig5, Qw32_charset_gb2312, Qw32_charset_oem) - (Qw32_charset_easteurope, Qw32_charset_turkish, Qw32_charset_baltic) - (Qw32_charset_russian, Qw32_charset_arabic, Qw32_charset_greek) - (Qw32_charset_hebrew, Qw32_charset_vietnamese, Qw32_charset_thai) - (Qw32_charset_mac, Vw32_charset_info_alist): Move from w32fns.c. - (syms_of_w32font): Update for above changes. + * w32fns.c (x_to_w32_font, w32_to_x_font, x_to_w32_weight) + (w32_to_x_weight, w32_to_all_x_charsets): Remove obsolete functions. + (w32_to_x_charset, x_to_w32_charset) + (Qw32_charset_ansi, Qw32_charset_symbol, Qw32_charset_default) + (Qw32_charset_shiftjis, Qw32_charset_hangeul, Qw32_charset_johab) + (Qw32_charset_chinesebig5, Qw32_charset_gb2312, Qw32_charset_oem) + (Qw32_charset_easteurope, Qw32_charset_turkish, Qw32_charset_baltic) + (Qw32_charset_russian, Qw32_charset_arabic, Qw32_charset_greek) + (Qw32_charset_hebrew, Qw32_charset_vietnamese, Qw32_charset_thai) + (Qw32_charset_mac, Vw32_charset_info_alist): Move to w32font.c. + (Qw32_charset_unicode): Remove. + (syms_of_w32fns): Update for above changes. + + * w32font.c (w32_to_x_charset, x_to_w32_charset) + (Qw32_charset_ansi, Qw32_charset_symbol, Qw32_charset_default) + (Qw32_charset_shiftjis, Qw32_charset_hangeul, Qw32_charset_johab) + (Qw32_charset_chinesebig5, Qw32_charset_gb2312, Qw32_charset_oem) + (Qw32_charset_easteurope, Qw32_charset_turkish, Qw32_charset_baltic) + (Qw32_charset_russian, Qw32_charset_arabic, Qw32_charset_greek) + (Qw32_charset_hebrew, Qw32_charset_vietnamese, Qw32_charset_thai) + (Qw32_charset_mac, Vw32_charset_info_alist): Move from w32fns.c. + (syms_of_w32font): Update for above changes. 2008-06-27 Dan Nicolaescu diff --git a/src/indent.c b/src/indent.c index 71e993e31a2..be5dc5f667f 100644 --- a/src/indent.c +++ b/src/indent.c @@ -2020,12 +2020,14 @@ whether or not it is currently displayed in some window. */) struct window *w; Lisp_Object old_buffer; struct gcpro gcpro1; - int cols = 0; + Lisp_Object lcols = Qnil; + double cols; /* Allow LINES to be of the form (HPOS . VPOS) aka (COLUMNS . LINES). */ if (CONSP (lines) && (NUMBERP (XCAR (lines)))) { - cols = XINT (XCAR (lines)); + lcols = XCAR (lines); + cols = INTEGERP (lcols) ? (double) XINT (lcols) : XFLOAT_DATA (lcols); lines = XCDR (lines); } @@ -2116,10 +2118,11 @@ whether or not it is currently displayed in some window. */) if (XINT (lines) >= 0 || IT_CHARPOS (it) > 0) move_it_by_lines (&it, XINT (lines), 0); - if (cols) - move_it_in_display_line (&it, ZV, - cols * FRAME_COLUMN_WIDTH (XFRAME (w->frame)), - MOVE_TO_X); + if (!NILP (lcols)) + move_it_in_display_line + (&it, ZV, + (int)(cols * FRAME_COLUMN_WIDTH (XFRAME (w->frame)) + 0.5), + MOVE_TO_X); SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); } -- 2.39.2