Add 2012 to FSF copyright years for Emacs files
[bpt/emacs.git] / src / indent.h
CommitLineData
d427b66a 1/* Definitions for interface to indent.c
acaf905b 2 Copyright (C) 1985-1986, 2001-2012 Free Software Foundation, Inc.
d427b66a
JB
3
4This file is part of GNU Emacs.
5
b9b1cc14 6GNU Emacs is free software: you can redistribute it and/or modify
d427b66a 7it under the terms of the GNU General Public License as published by
b9b1cc14
GM
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
d427b66a
JB
10
11GNU Emacs is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
b9b1cc14 17along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
d427b66a 18
fafd594b
KH
19/* We introduce new member `tab_offset'. We need it because of the
20 existence of wide-column characters. There is a case that the
21 line-break occurs at a wide-column character and the number of
da6062e6 22 columns of the line gets less than width.
fafd594b
KH
23
24 Example (where W_ stands for a wide-column character):
25 ----------
26 abcdefgh\\
177c0ea7 27 W_
fafd594b
KH
28 ----------
29
177c0ea7 30 To handle this case, we should not calculate the tab offset by
fafd594b
KH
31 tab_offset += width;
32
177c0ea7 33 Instead, we must remember tab_offset of the line.
fafd594b
KH
34
35 */
d427b66a
JB
36
37struct position
38 {
83155776
SM
39 EMACS_INT bufpos;
40 EMACS_INT bytepos;
41 EMACS_INT hpos;
42 EMACS_INT vpos;
43 EMACS_INT prevhpos;
44 EMACS_INT contin;
cf5db374
RS
45 /* Number of characters we have already handled
46 from the before and after strings at this position. */
83155776
SM
47 EMACS_INT ovstring_chars_done;
48 EMACS_INT tab_offset;
d427b66a
JB
49 };
50
383e0970
J
51struct position *compute_motion (EMACS_INT from, EMACS_INT fromvpos,
52 EMACS_INT fromhpos, int did_motion,
53 EMACS_INT to, EMACS_INT tovpos,
54 EMACS_INT tohpos,
55 EMACS_INT width, EMACS_INT hscroll,
56 EMACS_INT tab_offset, struct window *);
57struct position *vmotion (EMACS_INT from, EMACS_INT vtarget,
58 struct window *);
59EMACS_INT skip_invisible (EMACS_INT pos, EMACS_INT *next_boundary_p,
60 EMACS_INT to, Lisp_Object window);
d427b66a
JB
61
62/* Value of point when current_column was called */
83155776 63extern EMACS_INT last_known_column_point;
63dec5bd
JB
64
65/* Functions for dealing with the column cache. */
66
e0f24100 67/* Return true if the display table DISPTAB specifies the same widths
63dec5bd
JB
68 for characters as WIDTHTAB. We use this to decide when to
69 invalidate the buffer's column_cache. */
383e0970
J
70int disptab_matches_widthtab (struct Lisp_Char_Table *disptab,
71 struct Lisp_Vector *widthtab);
63dec5bd
JB
72
73/* Recompute BUF's width table, using the display table DISPTAB. */
383e0970
J
74void recompute_width_table (struct buffer *buf,
75 struct Lisp_Char_Table *disptab);