1#ifdef HAS_LINE_ATTR
2
3define set_selective_display ()
4{
5   variable c, arg, h;
6   variable msg;
7
8   c = prefix_argument (-1);
9
10   % Allow the current column be used to set the indent level.
11   if (c == -1)
12     c = what_column ();
13
14   if (c <= 1)
15     {
16	arg = 0;
17	msg = "Cancelling selective display mode...";
18     }
19   else
20     {
21	arg = 1;
22	c--;
23	msg = sprintf ("Hiding all lines beyond column %d...", c);
24     }
25   flush (msg);
26
27   push_spot ();
28   bob ();
29   h = 0;
30   do
31     {
32	bol_skip_white ();
33	!if (eolp ())
34	  h = arg * (what_column () > c);
35	% Otherwise, a blank line to if the last line was hidden, then
36	% hide this one too.
37	set_line_hidden (h);
38     }
39   while (down_1 ());
40
41   pop_spot ();
42   message (msg + "done");
43}
44