diff options
| author | Dmitry Antipov | 2014-10-15 17:37:10 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2014-10-15 17:37:10 +0400 |
| commit | 0b4d6d30be2822df7d6b086bbab32b8ff419ed5d (patch) | |
| tree | bb4d69129f2dc53af8736945bfdaf8bd22dbf966 /src/cmds.c | |
| parent | 73d4c39e1519a5fec742686e3c81941113d41448 (diff) | |
| download | emacs-0b4d6d30be2822df7d6b086bbab32b8ff419ed5d.tar.gz emacs-0b4d6d30be2822df7d6b086bbab32b8ff419ed5d.zip | |
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). */) | |||
| 131 | count = XINT (n); | 131 | count = XINT (n); |
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | if (count <= 0) | 134 | shortage = scan_newline_from_point (count, &pos, &pos_byte); |
| 135 | pos = find_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, count - 1, | ||
| 136 | &shortage, &pos_byte, 1); | ||
| 137 | else | ||
| 138 | pos = find_newline (PT, PT_BYTE, ZV, ZV_BYTE, count, | ||
| 139 | &shortage, &pos_byte, 1); | ||
| 140 | 135 | ||
| 141 | SET_PT_BOTH (pos, pos_byte); | 136 | SET_PT_BOTH (pos, pos_byte); |
| 142 | 137 | ||