aboutsummaryrefslogtreecommitdiffstats
path: root/src/indent.c
diff options
context:
space:
mode:
authorStefan Monnier2008-06-29 13:56:50 +0000
committerStefan Monnier2008-06-29 13:56:50 +0000
commitbaed8445dd2b64d5aaa19fcf110ae05ce591f4d6 (patch)
tree8c2168f76dc3b440818de43f89cd21aef3c02451 /src/indent.c
parentb861de913e16a1bd216e87797cae1a8d1c0d8421 (diff)
downloademacs-baed8445dd2b64d5aaa19fcf110ae05ce591f4d6.tar.gz
emacs-baed8445dd2b64d5aaa19fcf110ae05ce591f4d6.zip
(Fvertical_motion): Properly handle float column arg.
Diffstat (limited to 'src/indent.c')
-rw-r--r--src/indent.c15
1 files changed, 9 insertions, 6 deletions
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. */)
2020 struct window *w; 2020 struct window *w;
2021 Lisp_Object old_buffer; 2021 Lisp_Object old_buffer;
2022 struct gcpro gcpro1; 2022 struct gcpro gcpro1;
2023 int cols = 0; 2023 Lisp_Object lcols = Qnil;
2024 double cols;
2024 2025
2025 /* Allow LINES to be of the form (HPOS . VPOS) aka (COLUMNS . LINES). */ 2026 /* Allow LINES to be of the form (HPOS . VPOS) aka (COLUMNS . LINES). */
2026 if (CONSP (lines) && (NUMBERP (XCAR (lines)))) 2027 if (CONSP (lines) && (NUMBERP (XCAR (lines))))
2027 { 2028 {
2028 cols = XINT (XCAR (lines)); 2029 lcols = XCAR (lines);
2030 cols = INTEGERP (lcols) ? (double) XINT (lcols) : XFLOAT_DATA (lcols);
2029 lines = XCDR (lines); 2031 lines = XCDR (lines);
2030 } 2032 }
2031 2033
@@ -2116,10 +2118,11 @@ whether or not it is currently displayed in some window. */)
2116 if (XINT (lines) >= 0 || IT_CHARPOS (it) > 0) 2118 if (XINT (lines) >= 0 || IT_CHARPOS (it) > 0)
2117 move_it_by_lines (&it, XINT (lines), 0); 2119 move_it_by_lines (&it, XINT (lines), 0);
2118 2120
2119 if (cols) 2121 if (!NILP (lcols))
2120 move_it_in_display_line (&it, ZV, 2122 move_it_in_display_line
2121 cols * FRAME_COLUMN_WIDTH (XFRAME (w->frame)), 2123 (&it, ZV,
2122 MOVE_TO_X); 2124 (int)(cols * FRAME_COLUMN_WIDTH (XFRAME (w->frame)) + 0.5),
2125 MOVE_TO_X);
2123 2126
2124 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); 2127 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
2125 } 2128 }