aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2020-04-16 09:22:42 -0700
committerPaul Eggert2020-04-16 09:24:48 -0700
commit0127118c2592ee5103cc36be5aaed0c9443ae82f (patch)
tree0afe3fcd341af46dbe5cfd67c70f8dbdb1daa730 /src
parentcead6f0ad18206401b5180fd44f848a76fed8e43 (diff)
downloademacs-0127118c2592ee5103cc36be5aaed0c9443ae82f.tar.gz
emacs-0127118c2592ee5103cc36be5aaed0c9443ae82f.zip
Fix type-checking bug in vertical-motion
* src/indent.c (Fvertical_motion): Fix bug where the type of lcols was checked too late.
Diffstat (limited to 'src')
-rw-r--r--src/indent.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/indent.c b/src/indent.c
index dd81b983d48..06f11a251e6 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2091,19 +2091,17 @@ whether or not it is currently displayed in some window. */)
2091 struct it it; 2091 struct it it;
2092 struct text_pos pt; 2092 struct text_pos pt;
2093 struct window *w; 2093 struct window *w;
2094 Lisp_Object lcols; 2094 Lisp_Object lcols = Qnil;
2095 void *itdata = NULL; 2095 void *itdata = NULL;
2096 ptrdiff_t count = SPECPDL_INDEX (); 2096 ptrdiff_t count = SPECPDL_INDEX ();
2097 2097
2098 /* Allow LINES to be of the form (HPOS . VPOS) aka (COLUMNS . LINES). */ 2098 /* Allow LINES to be of the form (HPOS . VPOS) aka (COLUMNS . LINES). */
2099 bool lcols_given = CONSP (lines); 2099 if (CONSP (lines))
2100 if (lcols_given)
2101 { 2100 {
2102 lcols = XCAR (lines); 2101 lcols = XCAR (lines);
2102 CHECK_NUMBER (lcols);
2103 lines = XCDR (lines); 2103 lines = XCDR (lines);
2104 } 2104 }
2105 else
2106 lcols = make_fixnum (0); /* shut up stupid GCC warning */
2107 2105
2108 CHECK_FIXNUM (lines); 2106 CHECK_FIXNUM (lines);
2109 w = decode_live_window (window); 2107 w = decode_live_window (window);
@@ -2281,9 +2279,9 @@ whether or not it is currently displayed in some window. */)
2281 2279
2282 overshoot_handled = 1; 2280 overshoot_handled = 1;
2283 } 2281 }
2284 if (lcols_given) 2282 if (!NILP (lcols))
2285 to_x = 2283 to_x =
2286 window_column_x (w, window, extract_float (lcols), lcols) 2284 window_column_x (w, window, XFLOATINT (lcols), lcols)
2287 + lnum_pixel_width; 2285 + lnum_pixel_width;
2288 if (nlines <= 0) 2286 if (nlines <= 0)
2289 { 2287 {
@@ -2334,7 +2332,7 @@ whether or not it is currently displayed in some window. */)
2334 /* Move to the goal column, if one was specified. If the window 2332 /* Move to the goal column, if one was specified. If the window
2335 was originally hscrolled, the goal column is interpreted as 2333 was originally hscrolled, the goal column is interpreted as
2336 an addition to the hscroll amount. */ 2334 an addition to the hscroll amount. */
2337 if (lcols_given) 2335 if (!NILP (lcols))
2338 { 2336 {
2339 move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X); 2337 move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X);
2340 /* If we find ourselves in the middle of an overlay string 2338 /* If we find ourselves in the middle of an overlay string