diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2019-01-27 15:49:53 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-01-27 15:52:06 -0800 |
commit | cc1c46e4122a08657a7c75495115d1c60efb1b31 (patch) | |
tree | 263f419e5f70ab9dceaa15093339623bf3513e64 /src/editfns.c | |
parent | 6c2ee11d8f27cc39f852b69a49056ba76ac6bee9 (diff) | |
download | emacs-cc1c46e4122a08657a7c75495115d1c60efb1b31.tar.gz emacs-cc1c46e4122a08657a7c75495115d1c60efb1b31.tar.bz2 emacs-cc1c46e4122a08657a7c75495115d1c60efb1b31.zip |
forward-line now works with bignums
* src/cmds.c (Fforward_line): Support bignum arg.
(scan_newline): Return void since no caller was using the
return value.
* src/search.c (find_newline, scan_newline_from_point)
(find_newline1): Return the number of newlines counted, not
the count shortage, so that the return value always fits in
ptrdiff_t even if the original count was a bignum. All
callers changed.
* test/src/cmds-tests.el (forward-line-with-bignum): New test.
Diffstat (limited to 'src/editfns.c')
-rw-r--r-- | src/editfns.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/editfns.c b/src/editfns.c index 01376b06373..3edfd1dc201 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -668,7 +668,7 @@ Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */) /* It is possible that NEW_POS is not within the same field as OLD_POS; try to move NEW_POS so that it is. */ { - ptrdiff_t shortage; + ptrdiff_t counted; Lisp_Object field_bound; if (fwd) @@ -691,8 +691,8 @@ Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */) there's an intervening newline or not. */ || (find_newline (XFIXNAT (new_pos), -1, XFIXNAT (field_bound), -1, - fwd ? -1 : 1, &shortage, NULL, 1), - shortage != 0))) + fwd ? -1 : 1, &counted, NULL, 1), + counted == 0))) /* Constrain NEW_POS to FIELD_BOUND. */ new_pos = field_bound; |