Rename SCR_WIDTH to print_width
This commit is contained in:
parent
8b6b2d96e4
commit
4550e1ba79
|
@ -2622,7 +2622,7 @@ static void lisp_init(size_t initial_heapsize)
|
||||||
Fsym = symbol("F");
|
Fsym = symbol("F");
|
||||||
set(printprettysym = symbol("*print-pretty*"), FL_T);
|
set(printprettysym = symbol("*print-pretty*"), FL_T);
|
||||||
set(printreadablysym = symbol("*print-readably*"), FL_T);
|
set(printreadablysym = symbol("*print-readably*"), FL_T);
|
||||||
set(printwidthsym = symbol("*print-width*"), fixnum(SCR_WIDTH));
|
set(printwidthsym = symbol("*print-width*"), fixnum(print_width));
|
||||||
set(printlengthsym = symbol("*print-length*"), FL_F);
|
set(printlengthsym = symbol("*print-length*"), FL_F);
|
||||||
set(printlevelsym = symbol("*print-level*"), FL_F);
|
set(printlevelsym = symbol("*print-level*"), FL_F);
|
||||||
builtins_table_sym = symbol("*builtins*");
|
builtins_table_sym = symbol("*builtins*");
|
||||||
|
|
18
c/print.h
18
c/print.h
|
@ -7,7 +7,7 @@ static int print_princ;
|
||||||
static int print_pretty;
|
static int print_pretty;
|
||||||
|
|
||||||
// *print-width* -- maximum line length when indenting, ignored when not
|
// *print-width* -- maximum line length when indenting, ignored when not
|
||||||
static int SCR_WIDTH = 80;
|
static int print_width = 80;
|
||||||
|
|
||||||
// *print-length* -- truncate lists after N items and write "..."
|
// *print-length* -- truncate lists after N items and write "..."
|
||||||
static fixnum_t print_length;
|
static fixnum_t print_length;
|
||||||
|
@ -48,7 +48,7 @@ static int outindent(int n, struct ios *f)
|
||||||
int n0;
|
int n0;
|
||||||
|
|
||||||
// move back to left margin if we get too indented
|
// move back to left margin if we get too indented
|
||||||
if (n > SCR_WIDTH - 12)
|
if (n > print_width - 12)
|
||||||
n = 2;
|
n = 2;
|
||||||
n0 = n;
|
n0 = n;
|
||||||
ios_putc('\n', f);
|
ios_putc('\n', f);
|
||||||
|
@ -330,12 +330,12 @@ static void print_pair(struct ios *f, value_t v)
|
||||||
est = lengthestimate(car_(cd));
|
est = lengthestimate(car_(cd));
|
||||||
nextsmall = smallp(car_(cd));
|
nextsmall = smallp(car_(cd));
|
||||||
thistiny = tinyp(car_(v));
|
thistiny = tinyp(car_(v));
|
||||||
ind = (((VPOS > lastv) || (HPOS > SCR_WIDTH / 2 && !nextsmall &&
|
ind = (((VPOS > lastv) || (HPOS > print_width / 2 && !nextsmall &&
|
||||||
!thistiny && n > 0)) ||
|
!thistiny && n > 0)) ||
|
||||||
|
|
||||||
(HPOS > SCR_WIDTH - 4) ||
|
(HPOS > print_width - 4) ||
|
||||||
|
|
||||||
(est != -1 && (HPOS + est > SCR_WIDTH - 2)) ||
|
(est != -1 && (HPOS + est > print_width - 2)) ||
|
||||||
|
|
||||||
((head == LAMBDA) && !nextsmall) ||
|
((head == LAMBDA) && !nextsmall) ||
|
||||||
|
|
||||||
|
@ -487,9 +487,9 @@ void fl_print_child(struct ios *f, value_t v)
|
||||||
outc(' ', f);
|
outc(' ', f);
|
||||||
} else {
|
} else {
|
||||||
est = lengthestimate(vector_elt(v, i + 1));
|
est = lengthestimate(vector_elt(v, i + 1));
|
||||||
if (HPOS > SCR_WIDTH - 4 ||
|
if (HPOS > print_width - 4 ||
|
||||||
(est != -1 && (HPOS + est > SCR_WIDTH - 2)) ||
|
(est != -1 && (HPOS + est > print_width - 2)) ||
|
||||||
(HPOS > SCR_WIDTH / 2 &&
|
(HPOS > print_width / 2 &&
|
||||||
!smallp(vector_elt(v, i + 1)) &&
|
!smallp(vector_elt(v, i + 1)) &&
|
||||||
!tinyp(vector_elt(v, i))))
|
!tinyp(vector_elt(v, i))))
|
||||||
newindent = outindent(newindent, f);
|
newindent = outindent(newindent, f);
|
||||||
|
@ -862,7 +862,7 @@ static void set_print_width(void)
|
||||||
pw = symbol_value(printwidthsym);
|
pw = symbol_value(printwidthsym);
|
||||||
if (!isfixnum(pw))
|
if (!isfixnum(pw))
|
||||||
return;
|
return;
|
||||||
SCR_WIDTH = numval(pw);
|
print_width = numval(pw);
|
||||||
}
|
}
|
||||||
|
|
||||||
void fl_print(struct ios *f, value_t v)
|
void fl_print(struct ios *f, value_t v)
|
||||||
|
|
Loading…
Reference in New Issue