summaryrefslogtreecommitdiff
path: root/src/indent.h
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2013-03-07 08:42:59 +0400
committerDmitry Antipov <dmantipov@yandex.ru>2013-03-07 08:42:59 +0400
commitc54aa1668ec5c2626b3f9a84513b00d90dcf24c1 (patch)
tree0277b558a7de2dece38c62056884d4bfdec8b2b3 /src/indent.h
parent3de717bdb483f7c6e23cd7701ee4ebd77eccb8b9 (diff)
downloademacs-c54aa1668ec5c2626b3f9a84513b00d90dcf24c1.tar.gz
emacs-c54aa1668ec5c2626b3f9a84513b00d90dcf24c1.tar.bz2
emacs-c54aa1668ec5c2626b3f9a84513b00d90dcf24c1.zip
Avoid character to byte conversions in motion subroutines.
* indent.h (compute_motion, vmotion): Add byte position argument. * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE. Add eassert. (Fcompute_motion): Break long line. Adjust call to compute_motion. Use list5 for return value. (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE. Adjust comments, style and calls to compute_motion. (Fvertical_motion): Adjust call to vmotion. * window.c (Fdelete_other_windows_internal): Record window start byte position and adjust call to vmotion. (window_scroll_line_based): Likewise with call to compute_motion. Use SET_PT_BOTH. (Frecenter): Adjust calls to vmotion.
Diffstat (limited to 'src/indent.h')
-rw-r--r--src/indent.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/indent.h b/src/indent.h
index acfd952754e..4eb3fed6a11 100644
--- a/src/indent.h
+++ b/src/indent.h
@@ -26,14 +26,14 @@ struct position
int contin;
};
-struct position *compute_motion (ptrdiff_t from, EMACS_INT fromvpos,
- EMACS_INT fromhpos, bool did_motion,
- ptrdiff_t to, EMACS_INT tovpos,
- EMACS_INT tohpos,
+struct position *compute_motion (ptrdiff_t from, ptrdiff_t frombyte,
+ EMACS_INT fromvpos, EMACS_INT fromhpos,
+ bool did_motion, ptrdiff_t to,
+ EMACS_INT tovpos, EMACS_INT tohpos,
EMACS_INT width, ptrdiff_t hscroll,
int tab_offset, struct window *);
-struct position *vmotion (ptrdiff_t from, EMACS_INT vtarget,
- struct window *);
+struct position *vmotion (ptrdiff_t from, ptrdiff_t from_byte,
+ EMACS_INT vtarget, struct window *);
ptrdiff_t skip_invisible (ptrdiff_t pos, ptrdiff_t *next_boundary_p,
ptrdiff_t to, Lisp_Object window);