aboutsummaryrefslogtreecommitdiffstats
path: root/src/indent.c
diff options
context:
space:
mode:
authorDan Nicolaescu2010-07-04 00:50:25 -0700
committerDan Nicolaescu2010-07-04 00:50:25 -0700
commit971de7fb158335fbda39525feb2d7776a26bc030 (patch)
tree605333d85f16e35bb06baffcb66ac49f4ec0dce9 /src/indent.c
parentb8463cbfbe2c5183cf40772df2746e58b787ddeb (diff)
downloademacs-971de7fb158335fbda39525feb2d7776a26bc030.tar.gz
emacs-971de7fb158335fbda39525feb2d7776a26bc030.zip
Convert (most) functions in src to standard C.
* src/alloc.c: Convert function definitions to standard C. * src/atimer.c: * src/bidi.c: * src/bytecode.c: * src/callint.c: * src/callproc.c: * src/casefiddle.c: * src/casetab.c: * src/category.c: * src/ccl.c: * src/character.c: * src/charset.c: * src/chartab.c: * src/cmds.c: * src/coding.c: * src/composite.c: * src/data.c: * src/dbusbind.c: * src/dired.c: * src/dispnew.c: * src/doc.c: * src/doprnt.c: * src/ecrt0.c: * src/editfns.c: * src/fileio.c: * src/filelock.c: * src/filemode.c: * src/fns.c: * src/font.c: * src/fontset.c: * src/frame.c: * src/fringe.c: * src/ftfont.c: * src/ftxfont.c: * src/gtkutil.c: * src/indent.c: * src/insdel.c: * src/intervals.c: * src/keymap.c: * src/lread.c: * src/macros.c: * src/marker.c: * src/md5.c: * src/menu.c: * src/minibuf.c: * src/prefix-args.c: * src/print.c: * src/ralloc.c: * src/regex.c: * src/region-cache.c: * src/scroll.c: * src/search.c: * src/sound.c: * src/strftime.c: * src/syntax.c: * src/sysdep.c: * src/termcap.c: * src/terminal.c: * src/terminfo.c: * src/textprop.c: * src/tparam.c: * src/undo.c: * src/unexelf.c: * src/window.c: * src/xfaces.c: * src/xfns.c: * src/xfont.c: * src/xftfont.c: * src/xgselect.c: * src/xmenu.c: * src/xrdb.c: * src/xselect.c: * src/xsettings.c: * src/xsmfns.c: * src/xterm.c: Likewise.
Diffstat (limited to 'src/indent.c')
-rw-r--r--src/indent.c48
1 files changed, 14 insertions, 34 deletions
diff --git a/src/indent.c b/src/indent.c
index de0026fe103..66f1f4cac49 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -72,7 +72,7 @@ static EMACS_INT current_column_bol_cache;
72/* Get the display table to use for the current buffer. */ 72/* Get the display table to use for the current buffer. */
73 73
74struct Lisp_Char_Table * 74struct Lisp_Char_Table *
75buffer_display_table () 75buffer_display_table (void)
76{ 76{
77 Lisp_Object thisbuf; 77 Lisp_Object thisbuf;
78 78
@@ -89,9 +89,7 @@ buffer_display_table ()
89/* Return the width of character C under display table DP. */ 89/* Return the width of character C under display table DP. */
90 90
91static int 91static int
92character_width (c, dp) 92character_width (int c, struct Lisp_Char_Table *dp)
93 int c;
94 struct Lisp_Char_Table *dp;
95{ 93{
96 Lisp_Object elt; 94 Lisp_Object elt;
97 95
@@ -125,9 +123,7 @@ character_width (c, dp)
125 invalidate the buffer's width_run_cache. */ 123 invalidate the buffer's width_run_cache. */
126 124
127int 125int
128disptab_matches_widthtab (disptab, widthtab) 126disptab_matches_widthtab (struct Lisp_Char_Table *disptab, struct Lisp_Vector *widthtab)
129 struct Lisp_Char_Table *disptab;
130 struct Lisp_Vector *widthtab;
131{ 127{
132 int i; 128 int i;
133 129
@@ -145,9 +141,7 @@ disptab_matches_widthtab (disptab, widthtab)
145/* Recompute BUF's width table, using the display table DISPTAB. */ 141/* Recompute BUF's width table, using the display table DISPTAB. */
146 142
147void 143void
148recompute_width_table (buf, disptab) 144recompute_width_table (struct buffer *buf, struct Lisp_Char_Table *disptab)
149 struct buffer *buf;
150 struct Lisp_Char_Table *disptab;
151{ 145{
152 int i; 146 int i;
153 struct Lisp_Vector *widthtab; 147 struct Lisp_Vector *widthtab;
@@ -166,7 +160,7 @@ recompute_width_table (buf, disptab)
166 state of current_buffer's cache_long_line_scans variable. */ 160 state of current_buffer's cache_long_line_scans variable. */
167 161
168static void 162static void
169width_run_cache_on_off () 163width_run_cache_on_off (void)
170{ 164{
171 if (NILP (current_buffer->cache_long_line_scans) 165 if (NILP (current_buffer->cache_long_line_scans)
172 /* And, for the moment, this feature doesn't work on multibyte 166 /* And, for the moment, this feature doesn't work on multibyte
@@ -217,11 +211,7 @@ width_run_cache_on_off ()
217 will equal the return value. */ 211 will equal the return value. */
218 212
219EMACS_INT 213EMACS_INT
220skip_invisible (pos, next_boundary_p, to, window) 214skip_invisible (EMACS_INT pos, EMACS_INT *next_boundary_p, EMACS_INT to, Lisp_Object window)
221 EMACS_INT pos;
222 EMACS_INT *next_boundary_p;
223 EMACS_INT to;
224 Lisp_Object window;
225{ 215{
226 Lisp_Object prop, position, overlay_limit, proplimit; 216 Lisp_Object prop, position, overlay_limit, proplimit;
227 Lisp_Object buffer, tmp; 217 Lisp_Object buffer, tmp;
@@ -332,13 +322,13 @@ Text that has an invisible property is considered as having width 0, unless
332/* Cancel any recorded value of the horizontal position. */ 322/* Cancel any recorded value of the horizontal position. */
333 323
334void 324void
335invalidate_current_column () 325invalidate_current_column (void)
336{ 326{
337 last_known_column_point = 0; 327 last_known_column_point = 0;
338} 328}
339 329
340double 330double
341current_column () 331current_column (void)
342{ 332{
343 register int col; 333 register int col;
344 register unsigned char *ptr, *stop; 334 register unsigned char *ptr, *stop;
@@ -723,7 +713,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
723 due to text properties or overlays. */ 713 due to text properties or overlays. */
724 714
725static double 715static double
726current_column_1 () 716current_column_1 (void)
727{ 717{
728 EMACS_INT col = MOST_POSITIVE_FIXNUM; 718 EMACS_INT col = MOST_POSITIVE_FIXNUM;
729 EMACS_INT opoint = PT; 719 EMACS_INT opoint = PT;
@@ -887,8 +877,7 @@ following any initial whitespace. */)
887} 877}
888 878
889static double 879static double
890position_indentation (pos_byte) 880position_indentation (register int pos_byte)
891 register int pos_byte;
892{ 881{
893 register EMACS_INT column = 0; 882 register EMACS_INT column = 0;
894 register EMACS_INT tab_width = XINT (current_buffer->tab_width); 883 register EMACS_INT tab_width = XINT (current_buffer->tab_width);
@@ -977,9 +966,7 @@ position_indentation (pos_byte)
977 preceding line. */ 966 preceding line. */
978 967
979int 968int
980indented_beyond_p (pos, pos_byte, column) 969indented_beyond_p (int pos, int pos_byte, double column)
981 int pos, pos_byte;
982 double column;
983{ 970{
984 double val; 971 double val;
985 int opoint = PT, opoint_byte = PT_BYTE; 972 int opoint = PT, opoint_byte = PT_BYTE;
@@ -1137,12 +1124,7 @@ struct position val_compute_motion;
1137 the scroll bars if they are turned on. */ 1124 the scroll bars if they are turned on. */
1138 1125
1139struct position * 1126struct position *
1140compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, hscroll, tab_offset, win) 1127compute_motion (EMACS_INT from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_motion, EMACS_INT to, EMACS_INT tovpos, EMACS_INT tohpos, EMACS_INT width, EMACS_INT hscroll, EMACS_INT tab_offset, struct window *win)
1141 EMACS_INT from, fromvpos, fromhpos, to, tovpos, tohpos;
1142 int did_motion;
1143 EMACS_INT width;
1144 EMACS_INT hscroll, tab_offset;
1145 struct window *win;
1146{ 1128{
1147 register EMACS_INT hpos = fromhpos; 1129 register EMACS_INT hpos = fromhpos;
1148 register EMACS_INT vpos = fromvpos; 1130 register EMACS_INT vpos = fromvpos;
@@ -1856,9 +1838,7 @@ visible section of the buffer, and pass LINE and COL as TOPOS. */)
1856struct position val_vmotion; 1838struct position val_vmotion;
1857 1839
1858struct position * 1840struct position *
1859vmotion (from, vtarget, w) 1841vmotion (register EMACS_INT from, register EMACS_INT vtarget, struct window *w)
1860 register EMACS_INT from, vtarget;
1861 struct window *w;
1862{ 1842{
1863 EMACS_INT hscroll = XINT (w->hscroll); 1843 EMACS_INT hscroll = XINT (w->hscroll);
1864 struct position pos; 1844 struct position pos;
@@ -2183,7 +2163,7 @@ whether or not it is currently displayed in some window. */)
2183/* File's initialization. */ 2163/* File's initialization. */
2184 2164
2185void 2165void
2186syms_of_indent () 2166syms_of_indent (void)
2187{ 2167{
2188 DEFVAR_BOOL ("indent-tabs-mode", &indent_tabs_mode, 2168 DEFVAR_BOOL ("indent-tabs-mode", &indent_tabs_mode,
2189 doc: /* *Indentation can insert tabs if this is non-nil. */); 2169 doc: /* *Indentation can insert tabs if this is non-nil. */);