diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2014-10-15 17:37:10 +0400 |
---|---|---|
committer | Dmitry Antipov <dmantipov@yandex.ru> | 2014-10-15 17:37:10 +0400 |
commit | 0b4d6d30be2822df7d6b086bbab32b8ff419ed5d (patch) | |
tree | bb4d69129f2dc53af8736945bfdaf8bd22dbf966 /src/cmds.c | |
parent | 73d4c39e1519a5fec742686e3c81941113d41448 (diff) | |
download | emacs-0b4d6d30be2822df7d6b086bbab32b8ff419ed5d.tar.gz |
Avoid unwanted point motion in Fline_beginning_position.
* lisp.h (scan_newline_from_point): Add prototype.
* search.c (scan_newline_from_point): New function, refactored from...
* cmds.c (Fforward_line): ...adjusted user.
* editfns.c (Fline_beginning_position): Use scan_newline_from_point
and simplify the former since the latter doesn't move point.
Diffstat (limited to 'src/cmds.c')
-rw-r--r-- | src/cmds.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/cmds.c b/src/cmds.c index 20234638778..9a05218b77b 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -131,12 +131,7 @@ successfully moved (for the return value). */) count = XINT (n); } - if (count <= 0) - pos = find_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, count - 1, - &shortage, &pos_byte, 1); - else - pos = find_newline (PT, PT_BYTE, ZV, ZV_BYTE, count, - &shortage, &pos_byte, 1); + shortage = scan_newline_from_point (count, &pos, &pos_byte); SET_PT_BOTH (pos, pos_byte); |