summaryrefslogtreecommitdiff
path: root/src/indent.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2020-04-16 09:22:42 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2020-04-16 09:24:48 -0700
commit0127118c2592ee5103cc36be5aaed0c9443ae82f (patch)
tree0afe3fcd341af46dbe5cfd67c70f8dbdb1daa730 /src/indent.c
parentcead6f0ad18206401b5180fd44f848a76fed8e43 (diff)
downloademacs-0127118c2592ee5103cc36be5aaed0c9443ae82f.tar.gz
emacs-0127118c2592ee5103cc36be5aaed0c9443ae82f.tar.bz2
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/indent.c')
-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. */)
struct it it;
struct text_pos pt;
struct window *w;
- Lisp_Object lcols;
+ Lisp_Object lcols = Qnil;
void *itdata = NULL;
ptrdiff_t count = SPECPDL_INDEX ();
/* Allow LINES to be of the form (HPOS . VPOS) aka (COLUMNS . LINES). */
- bool lcols_given = CONSP (lines);
- if (lcols_given)
+ if (CONSP (lines))
{
lcols = XCAR (lines);
+ CHECK_NUMBER (lcols);
lines = XCDR (lines);
}
- else
- lcols = make_fixnum (0); /* shut up stupid GCC warning */
CHECK_FIXNUM (lines);
w = decode_live_window (window);
@@ -2281,9 +2279,9 @@ whether or not it is currently displayed in some window. */)
overshoot_handled = 1;
}
- if (lcols_given)
+ if (!NILP (lcols))
to_x =
- window_column_x (w, window, extract_float (lcols), lcols)
+ window_column_x (w, window, XFLOATINT (lcols), lcols)
+ lnum_pixel_width;
if (nlines <= 0)
{
@@ -2334,7 +2332,7 @@ whether or not it is currently displayed in some window. */)
/* Move to the goal column, if one was specified. If the window
was originally hscrolled, the goal column is interpreted as
an addition to the hscroll amount. */
- if (lcols_given)
+ if (!NILP (lcols))
{
move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X);
/* If we find ourselves in the middle of an overlay string