comparison src/buffer.c @ 10143:33d8e8e8d46b

(list_buffers_1): Right-align the size values.
author Richard M. Stallman <rms@gnu.org>
date Sun, 11 Dec 1994 09:48:25 +0000
parents 8d3a71736423
children 24032289479c
comparison
equal deleted inserted replaced
10142:7151108ed6a0 10143:33d8e8e8d46b
1140 Lisp_Object other_file_symbol; 1140 Lisp_Object other_file_symbol;
1141 1141
1142 desired_point = Qnil; 1142 desired_point = Qnil;
1143 other_file_symbol = intern ("list-buffers-directory"); 1143 other_file_symbol = intern ("list-buffers-directory");
1144 1144
1145 XSETFASTINT (col1, 19); 1145 XSETFASTINT (col1, 17);
1146 XSETFASTINT (col2, 26); 1146 XSETFASTINT (col2, 28);
1147 XSETFASTINT (col3, 40); 1147 XSETFASTINT (col3, 40);
1148 XSETFASTINT (minspace, 1); 1148 XSETFASTINT (minspace, 1);
1149 1149
1150 Fset_buffer (Vstandard_output); 1150 Fset_buffer (Vstandard_output);
1151 Fbuffer_disable_undo (Vstandard_output); 1151 Fbuffer_disable_undo (Vstandard_output);
1152 current_buffer->read_only = Qnil; 1152 current_buffer->read_only = Qnil;
1153 1153
1154 write_string ("\ 1154 write_string ("\
1155 MR Buffer Size Mode File\n\ 1155 MR Buffer Size Mode File\n\
1156 -- ------ ---- ---- ----\n", -1); 1156 -- ------ ---- ---- ----\n", -1);
1157 1157
1158 for (tail = Vbuffer_alist; !NILP (tail); tail = Fcdr (tail)) 1158 for (tail = Vbuffer_alist; !NILP (tail); tail = Fcdr (tail))
1159 { 1159 {
1160 buf = Fcdr (Fcar (tail)); 1160 buf = Fcdr (Fcar (tail));
1161 b = XBUFFER (buf); 1161 b = XBUFFER (buf);
1175 It is actually made read-only by the call to 1175 It is actually made read-only by the call to
1176 Buffer-menu-mode, below. */ 1176 Buffer-menu-mode, below. */
1177 write_string ((b != current_buffer && NILP (b->read_only)) 1177 write_string ((b != current_buffer && NILP (b->read_only))
1178 ? " " : "% ", -1); 1178 ? " " : "% ", -1);
1179 Fprinc (b->name, Qnil); 1179 Fprinc (b->name, Qnil);
1180 Findent_to (col1, make_number (2)); 1180 tem = Findent_to (col1, make_number (2));
1181 XSETFASTINT (tem, BUF_Z (b) - BUF_BEG (b)); 1181 {
1182 Fprin1 (tem, Qnil); 1182 char sizebuf[9];
1183 int i;
1184 char *p;
1185
1186 sprintf (sizebuf, "%8d", BUF_Z (b) - BUF_BEG (b));
1187 /* Here's how many extra columns the buffer name used. */
1188 i = XFASTINT (tem) - XFASTINT (col1);
1189 /* Skip that many spaces in the size, if it has that many,
1190 to keep the size values right-aligned if possible. */
1191 p = sizebuf;
1192 while (i > 0)
1193 {
1194 if (*p == ' ')
1195 p++;
1196 i--;
1197 }
1198
1199 write_string (p, -1);
1200 }
1183 Findent_to (col2, minspace); 1201 Findent_to (col2, minspace);
1184 Fprinc (b->mode_name, Qnil); 1202 Fprinc (b->mode_name, Qnil);
1185 Findent_to (col3, minspace); 1203 Findent_to (col3, minspace);
1186 1204
1187 if (!NILP (b->filename)) 1205 if (!NILP (b->filename))