-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmcedit-vim-modeline-4.patch
566 lines (524 loc) · 19.4 KB
/
mcedit-vim-modeline-4.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
diff --git a/.gitignore b/.gitignore
index 310c62f..9e8b9e7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,3 +46,12 @@ make.log
make.clang
make.gcc
make.tcc
+misc/ext.d/doc.sh
+misc/ext.d/misc.sh
+misc/ext.d/text.sh
+misc/ext.d/web.sh
+misc/syntax/Syntax
+src/man2hlp/man2hlp
+src/vfs/extfs/helpers/uc1541
+src/vfs/extfs/helpers/ulib
+tests/src/editor/test-data.txt
diff --git a/src/editor/edit-impl.h b/src/editor/edit-impl.h
index e840d30..5eb417e 100644
--- a/src/editor/edit-impl.h
+++ b/src/editor/edit-impl.h
@@ -59,10 +59,6 @@
#define MARK_CURS 1000000000
#define KEY_PRESS 1500000000
-/* Tabs spaces: (sofar only HALF_TAB_SIZE is used: */
-#define TAB_SIZE option_tab_spacing
-#define HALF_TAB_SIZE ((int) option_tab_spacing / 2)
-
/* max count stack files */
#define MAX_HISTORY_MOVETO 50
#define LINE_STATE_WIDTH 8
@@ -286,6 +282,8 @@ void format_paragraph (WEdit * edit, gboolean force);
/* either command or char_for_insertion must be passed as -1 */
void edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion);
+int edit_tab_spacing(const WEdit *edit, gboolean half);
+
/*** inline functions ****************************************************************************/
/**
diff --git a/src/editor/edit.c b/src/editor/edit.c
index 1c80466..f48bac1 100644
--- a/src/editor/edit.c
+++ b/src/editor/edit.c
@@ -142,6 +142,34 @@ static const off_t option_filesize_default_threshold = 64 * 1024 * 1024;
/* --------------------------------------------------------------------------------------------- */
/*** file scope functions ************************************************************************/
/* --------------------------------------------------------------------------------------------- */
+
+static gboolean
+edit_fake_half_tabs(WEdit *edit)
+{
+ if (edit->force_halftabs == -1)
+ return option_fake_half_tabs;
+ return edit->force_halftabs;
+}
+
+static gboolean
+edit_fill_tabs_with_spaces(WEdit *edit)
+{
+ if (edit->force_fill_tabs_with_spaces == -1)
+ return option_fill_tabs_with_spaces;
+ return edit->force_fill_tabs_with_spaces;
+}
+
+int
+edit_tab_spacing(const WEdit *edit, gboolean half)
+{
+ int spacing = option_tab_spacing;
+ if (edit->force_tab_spacing > 0)
+ spacing = edit->force_tab_spacing;
+ if (half)
+ spacing /= 2;
+ return spacing;
+}
+
/**
* Load file OR text into buffers. Set cursor to the beginning of file.
*
@@ -1302,8 +1330,8 @@ is_aligned_on_a_tab (WEdit * edit)
long curs_col;
edit_update_curs_col (edit);
- curs_col = edit->curs_col % (TAB_SIZE * space_width);
- return (curs_col == 0 || curs_col == (HALF_TAB_SIZE * space_width));
+ curs_col = edit->curs_col % (edit_tab_spacing(edit, FALSE) * space_width);
+ return (curs_col == 0 || curs_col == (edit_tab_spacing(edit, TRUE) * space_width));
}
/* --------------------------------------------------------------------------------------------- */
@@ -1313,7 +1341,7 @@ right_of_four_spaces (WEdit * edit)
{
int i, ch = 0;
- for (i = 1; i <= HALF_TAB_SIZE; i++)
+ for (i = 1; i <= edit_tab_spacing(edit, TRUE); i++)
ch |= edit_buffer_get_byte (&edit->buffer, edit->buffer.curs1 - i);
return (ch == ' ' && is_aligned_on_a_tab (edit));
@@ -1326,7 +1354,7 @@ left_of_four_spaces (WEdit * edit)
{
int i, ch = 0;
- for (i = 0; i < HALF_TAB_SIZE; i++)
+ for (i = 0; i < edit_tab_spacing(edit, TRUE); i++)
ch |= edit_buffer_get_byte (&edit->buffer, edit->buffer.curs1 + i);
return (ch == ' ' && is_aligned_on_a_tab (edit));
@@ -1374,9 +1402,7 @@ insert_spaces_tab (WEdit * edit, gboolean half)
long i;
edit_update_curs_col (edit);
- i = option_tab_spacing * space_width;
- if (half)
- i /= 2;
+ i = edit_tab_spacing(edit, half) * space_width;
if (i != 0)
{
i = ((edit->curs_col / i) + 1) * i - edit->curs_col;
@@ -1393,23 +1419,23 @@ insert_spaces_tab (WEdit * edit, gboolean half)
static inline void
edit_tab_cmd (WEdit * edit)
{
- if (option_fake_half_tabs && is_in_indent (&edit->buffer))
+ if (edit_fake_half_tabs(edit) && is_in_indent (&edit->buffer))
{
/* insert a half tab (usually four spaces) unless there is a
half tab already behind, then delete it and insert a
full tab. */
- if (option_fill_tabs_with_spaces || !right_of_four_spaces (edit))
+ if (edit_fill_tabs_with_spaces(edit) || !right_of_four_spaces (edit))
insert_spaces_tab (edit, TRUE);
else
{
int i;
- for (i = 1; i <= HALF_TAB_SIZE; i++)
+ for (i = 1; i <= edit_tab_spacing(edit, TRUE); i++)
edit_backspace (edit, TRUE);
edit_insert (edit, '\t');
}
}
- else if (option_fill_tabs_with_spaces)
+ else if (edit_fill_tabs_with_spaces(edit))
insert_spaces_tab (edit, FALSE);
else
edit_insert (edit, '\t');
@@ -1545,8 +1571,8 @@ edit_move_block_to_right (WEdit * edit)
edit_cursor_move (edit, cur_bol - edit->buffer.curs1);
if (!edit_line_is_blank (edit, edit->buffer.curs_line))
{
- if (option_fill_tabs_with_spaces)
- insert_spaces_tab (edit, option_fake_half_tabs);
+ if (edit_fill_tabs_with_spaces(edit))
+ insert_spaces_tab (edit, edit_fake_half_tabs(edit));
else
edit_insert (edit, '\t');
edit_cursor_move (edit,
@@ -1585,10 +1611,7 @@ edit_move_block_to_left (WEdit * edit)
edit_cursor_move (edit, cur_bol - edit->buffer.curs1);
- if (option_fake_half_tabs)
- del_tab_width = HALF_TAB_SIZE;
- else
- del_tab_width = option_tab_spacing;
+ del_tab_width = edit_tab_spacing(edit, edit_fake_half_tabs(edit));
next_char = edit_buffer_get_current_byte (&edit->buffer);
if (next_char == '\t')
@@ -2017,6 +2040,126 @@ edit_insert_file (WEdit * edit, const vfs_path_t * filename_vpath)
* cursor on that line and show it in the middle of the screen.
*/
+static off_t
+mc_findinfile(int handle, const gchar **searchstrs)
+{
+ off_t offset_bak, offset_cur, filesize;
+ char buff[10240];
+ ssize_t got;
+ const char *found;
+ size_t i, smallest_searchstr_len, searchstrs_count;
+
+ searchstrs_count = 0;
+ smallest_searchstr_len = strlen(searchstrs[0]);
+ while (searchstrs[searchstrs_count] != NULL) {
+ size_t len = strlen(searchstrs[searchstrs_count]);
+ if (smallest_searchstr_len > len)
+ smallest_searchstr_len = len;
+ searchstrs_count++;
+ }
+
+ offset_bak = mc_lseek(handle, 0, SEEK_CUR);
+ if (offset_bak < 0)
+ return -1;
+
+ filesize = mc_lseek(handle, 0, SEEK_END);
+ offset_cur = mc_lseek(handle, offset_bak, SEEK_SET);
+
+ do {
+ got = mc_read(handle, buff, sizeof(buff) - 1);
+ if (got <= 0)
+ return -1;
+ buff[got] = '\0';
+
+ for (i = 0; i < searchstrs_count; i++) {
+ /* this could be done in O(n), not O(n*m) */
+ found = strstr(buff, searchstrs[i]);
+ if (found) {
+ return mc_lseek(handle, offset_cur + (found - buff), SEEK_SET) +
+ strlen(searchstrs[i]);
+ }
+ }
+
+ offset_cur = mc_lseek(handle,
+ offset_cur + (sizeof(buff) - 1) - smallest_searchstr_len, SEEK_SET);
+ } while (offset_cur + smallest_searchstr_len < filesize);
+
+ return -1;
+}
+
+static void
+scan_modeline(WEdit *edit, const vfs_path_t *filename)
+{
+ int fd;
+ int conf_tabstop = -1;
+ int conf_softtabstop = -1;
+ int conf_expandtab = -1;
+ int dst_halftabs = -1;
+ int dst_fill_tabs_with_spaces = -1;
+ int dst_force_tab_spacing = -1;
+ const gchar *searchstrs[] = {
+ "\n/*", "\n//", "\n#", "\ndnl", NULL
+ };
+
+ fd = mc_open(filename, O_RDONLY | O_BINARY);
+ while (1) {
+ off_t foundat;
+ char buff[200];
+ const char *s;
+ ssize_t got;
+ const char *foundstr;
+
+ foundat = mc_findinfile(fd, searchstrs);
+ if (foundat < 0)
+ return;
+
+ mc_lseek(fd, foundat, SEEK_SET);
+
+ got = mc_read(fd, buff, sizeof(buff) - 1);
+ if (got <= 0)
+ return;
+ buff[got] = '\0';
+
+ s = buff;
+ while (*s == ' ' || *s == '\t' || *s == '\n' || *s == '\r')
+ s++;
+ if (strncmp(s, "vim:", 4) != 0)
+ continue;
+ s += 4;
+
+ foundstr = strstr(s, "tabstop=");
+ if (foundstr)
+ conf_tabstop=atoi(foundstr + 8);
+ foundstr = strstr(s, "softtabstop=");
+ if (foundstr)
+ conf_softtabstop=atoi(foundstr + 12);
+ foundstr = strstr(s, "expandtab");
+ if (foundstr)
+ conf_expandtab = 1;
+ foundstr = strstr(s, "noexpandtab");
+ if (foundstr)
+ conf_expandtab = 0;
+
+ break;
+ }
+
+ if (conf_softtabstop > 0 && conf_tabstop > 0 &&
+ conf_softtabstop * 2 == conf_tabstop)
+ {
+ dst_halftabs = 1;
+ }
+
+ dst_fill_tabs_with_spaces = conf_expandtab;
+
+ dst_force_tab_spacing = conf_tabstop;
+
+ edit->force_halftabs = dst_halftabs;
+ edit->force_fill_tabs_with_spaces = dst_fill_tabs_with_spaces;
+ edit->force_tab_spacing = dst_force_tab_spacing;
+
+ mc_close(fd);
+}
+
WEdit *
edit_init (WEdit * edit, int y, int x, int lines, int cols, const vfs_path_t * filename_vpath,
long line)
@@ -2054,6 +2197,12 @@ edit_init (WEdit * edit, int y, int x, int lines, int cols, const vfs_path_t * f
edit_save_size (edit);
}
+ edit->force_halftabs = -1;
+ edit->force_fill_tabs_with_spaces = -1;
+ edit->force_tab_spacing = -1;
+
+ scan_modeline(edit, filename_vpath);
+
edit->drag_state = MCEDIT_DRAG_NORMAL;
edit->stat1.st_mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
@@ -2755,8 +2904,10 @@ edit_move_forward3 (const WEdit * edit, off_t current, long cols, off_t upto)
if (c == '\n')
return (upto != 0 ? (off_t) col : p);
- if (c == '\t')
- col += TAB_SIZE - col % TAB_SIZE;
+ if (c == '\t') {
+ int tab_size = edit_tab_spacing(edit, FALSE);
+ col += tab_size - col % tab_size;
+ }
else if ((c < 32 || c == 127) && (orig_c == c
#ifdef HAVE_CHARSET
|| (!mc_global.utf8_display && !edit->utf8)
@@ -2909,13 +3060,13 @@ edit_move_to_prev_col (WEdit * edit, off_t p)
else
{
edit->over_col = 0;
- if (option_fake_half_tabs && is_in_indent (&edit->buffer))
+ if (edit_fake_half_tabs(edit) && is_in_indent (&edit->buffer))
{
long fake_half_tabs;
edit_update_curs_col (edit);
- fake_half_tabs = HALF_TAB_SIZE * space_width;
+ fake_half_tabs = edit_tab_spacing(edit, TRUE) * space_width;
if (fake_half_tabs != 0 && edit->curs_col % fake_half_tabs != 0)
{
int q;
@@ -3402,14 +3553,24 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion)
while (edit_buffer_get_previous_byte (&edit->buffer) != '\n' && edit->buffer.curs1 > 0)
edit_backspace (edit, TRUE);
}
- else if (option_fake_half_tabs && is_in_indent (&edit->buffer)
+ else if (edit_fake_half_tabs(edit) && is_in_indent (&edit->buffer)
&& right_of_four_spaces (edit))
{
int i;
- for (i = 0; i < HALF_TAB_SIZE; i++)
+ for (i = 0; i < edit_tab_spacing(edit, TRUE); i++)
edit_backspace (edit, TRUE);
}
+ else if (edit_fake_half_tabs(edit) && is_in_indent (&edit->buffer)
+ && edit_buffer_get_byte(&edit->buffer, edit->buffer.curs1 - 1) == '\t') {
+ int i;
+
+ edit_backspace (edit, TRUE);
+ for (i = 0; i < edit_tab_spacing(edit, TRUE); i++)
+ edit_insert (edit, ' ');
+ /* TODO: if (right_of_four_spaces(edit) && left_of_four_spaces(edit)
+ * - replace spaces with a tab */
+ }
else
edit_backspace (edit, FALSE);
break;
@@ -3422,11 +3583,11 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion)
if (option_cursor_beyond_eol && edit->over_col > 0)
edit_insert_over (edit);
- if (option_fake_half_tabs && is_in_indent (&edit->buffer) && left_of_four_spaces (edit))
+ if (edit_fake_half_tabs(edit) && is_in_indent (&edit->buffer) && left_of_four_spaces (edit))
{
int i;
- for (i = 1; i <= HALF_TAB_SIZE; i++)
+ for (i = 1; i <= edit_tab_spacing(edit, TRUE); i++)
edit_delete (edit, TRUE);
}
else
@@ -3488,12 +3649,12 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion)
edit->column_highlight = 1;
case CK_Left:
case CK_MarkLeft:
- if (option_fake_half_tabs && is_in_indent (&edit->buffer) && right_of_four_spaces (edit))
+ if (edit_fake_half_tabs(edit) && is_in_indent (&edit->buffer) && right_of_four_spaces (edit))
{
if (option_cursor_beyond_eol && edit->over_col > 0)
edit->over_col--;
else
- edit_cursor_move (edit, -HALF_TAB_SIZE);
+ edit_cursor_move (edit, -edit_tab_spacing(edit, TRUE));
edit->force &= (0xFFF - REDRAW_CHAR_ONLY);
}
else
@@ -3503,9 +3664,9 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion)
edit->column_highlight = 1;
case CK_Right:
case CK_MarkRight:
- if (option_fake_half_tabs && is_in_indent (&edit->buffer) && left_of_four_spaces (edit))
+ if (edit_fake_half_tabs(edit) && is_in_indent (&edit->buffer) && left_of_four_spaces (edit))
{
- edit_cursor_move (edit, HALF_TAB_SIZE);
+ edit_cursor_move (edit, edit_tab_spacing(edit, TRUE));
edit->force &= (0xFFF - REDRAW_CHAR_ONLY);
}
else
@@ -3964,3 +4125,5 @@ edit_move_down (WEdit * edit, long i, gboolean do_scroll)
}
/* --------------------------------------------------------------------------------------------- */
+
+/* vim: set tabstop=8 softtabstop=4 shiftwidth=4 expandtab: */
diff --git a/src/editor/editcmd.c b/src/editor/editcmd.c
index 4347fd7..a51839c 100644
--- a/src/editor/editcmd.c
+++ b/src/editor/editcmd.c
@@ -67,7 +67,7 @@
#endif
#include "src/history.h"
-#include "src/setup.h" /* option_tab_spacing */
+#include "src/setup.h"
#ifdef HAVE_CHARSET
#include "src/selcodepage.h"
#endif
diff --git a/src/editor/editdraw.c b/src/editor/editdraw.c
index cd084de..c66b675 100644
--- a/src/editor/editdraw.c
+++ b/src/editor/editdraw.c
@@ -584,6 +584,7 @@ edit_draw_this_line (WEdit * edit, off_t b, long row, long start_col, long end_c
int tab_over = 0;
gboolean wide_width_char = FALSE;
gboolean control_char = FALSE;
+ int tab_size = edit_tab_spacing(edit, FALSE);
p->ch = 0;
p->style = 0;
@@ -632,7 +633,7 @@ edit_draw_this_line (WEdit * edit, off_t b, long row, long start_col, long end_c
col = end_col - edit->start_col + 1; /* quit */
break;
case '\t':
- i = TAB_SIZE - ((int) col % TAB_SIZE);
+ i = tab_size - ((int) col % tab_size);
tab_over = (end_col - edit->start_col) - (col + i - 1);
if (tab_over < 0)
i += tab_over;
diff --git a/src/editor/editwidget.h b/src/editor/editwidget.h
index 90c73f6..d58e197 100644
--- a/src/editor/editwidget.h
+++ b/src/editor/editwidget.h
@@ -163,6 +163,10 @@ struct WEdit
/* line break */
LineBreaks lb;
gboolean extmod;
+
+ int force_halftabs;
+ int force_fill_tabs_with_spaces;
+ int force_tab_spacing;
};
/*** global variables defined in .c file *********************************************************/
@@ -171,3 +175,5 @@ struct WEdit
/*** inline functions ****************************************************************************/
#endif /* MC__EDIT_WIDGET_H */
+
+/* vim: set tabstop=8 softtabstop=4 shiftwidth=4 expandtab: */
diff --git a/src/editor/wordproc.c b/src/editor/wordproc.c
index 8c42ce9..5358dab 100644
--- a/src/editor/wordproc.c
+++ b/src/editor/wordproc.c
@@ -50,8 +50,6 @@
#include "lib/global.h"
-#include "src/setup.h" /* option_tab_spacing */
-
#include "edit-impl.h"
#include "editwidget.h"
@@ -59,8 +57,6 @@
/*** file scope macro definitions ****************************************************************/
-#define tab_width option_tab_spacing
-
#define NO_FORMAT_CHARS_START "-+*\\,.;:&>"
#define FONT_MEAN_WIDTH 1
@@ -205,7 +201,7 @@ strip_newlines (unsigned char *t, off_t size)
*/
static inline off_t
-next_tab_pos (off_t x)
+next_tab_pos (off_t x, int tab_width)
{
x += tab_width - x % tab_width;
return x;
@@ -214,7 +210,7 @@ next_tab_pos (off_t x)
/* --------------------------------------------------------------------------------------------- */
static inline off_t
-line_pixel_length (unsigned char *t, off_t b, off_t l, gboolean utf8)
+line_pixel_length (unsigned char *t, off_t b, off_t l, int tab_width, gboolean utf8)
{
off_t xn, x; /* position conters */
off_t cw; /* character width in bytes */
@@ -235,7 +231,7 @@ line_pixel_length (unsigned char *t, off_t b, off_t l, gboolean utf8)
case '\n':
return b;
case '\t':
- xn = next_tab_pos (x);
+ xn = next_tab_pos (x, tab_width);
break;
default:
#ifdef HAVE_CHARSET
@@ -324,7 +320,7 @@ word_start (unsigned char *t, off_t q, off_t size)
/** replaces ' ' with '\n' to properly format a paragraph */
static inline void
-format_this (unsigned char *t, off_t size, long indent, gboolean utf8)
+format_this (unsigned char *t, off_t size, long indent, int tab_width, gboolean utf8)
{
off_t q = 0, ww;
@@ -337,7 +333,7 @@ format_this (unsigned char *t, off_t size, long indent, gboolean utf8)
{
off_t p;
- q = line_pixel_length (t, q, ww, utf8);
+ q = line_pixel_length (t, q, ww, tab_width, utf8);
if (q > size)
break;
if (t[q] == '\n')
@@ -386,11 +382,12 @@ edit_indent_width (const WEdit * edit, off_t p)
static void
edit_insert_indent (WEdit * edit, long indent)
{
+ int tab_size = edit_tab_spacing(edit, FALSE);
if (!option_fill_tabs_with_spaces)
- while (indent >= TAB_SIZE)
+ while (indent >= tab_size)
{
edit_insert (edit, '\t');
- indent -= TAB_SIZE;
+ indent -= tab_size;
}
while (indent-- > 0)
@@ -513,7 +510,7 @@ format_paragraph (WEdit * edit, gboolean force)
#ifdef HAVE_CHARSET
utf8 = edit->utf8;
#endif
- format_this (t2, q - p, indent, utf8);
+ format_this (t2, q - p, indent, edit_tab_spacing(edit, FALSE), utf8);
put_paragraph (edit, t2, p, indent, size);
g_free ((char *) t2);
@@ -522,3 +519,5 @@ format_paragraph (WEdit * edit, gboolean force)
}
/* --------------------------------------------------------------------------------------------- */
+
+/* vim: set tabstop=8 softtabstop=4 shiftwidth=4 expandtab: */