aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-12-11 09:48:25 +0000
committerRichard M. Stallman1994-12-11 09:48:25 +0000
commit5296fd18553c0d62e61fa1cd80b7abb13ed38fed (patch)
tree27ceaca87b963f2a86f625b37e3d37c2ef538cb0 /src
parent07f9b3e6a59d108927e50180ce48f8562fa0abe4 (diff)
downloademacs-5296fd18553c0d62e61fa1cd80b7abb13ed38fed.tar.gz
emacs-5296fd18553c0d62e61fa1cd80b7abb13ed38fed.zip
(list_buffers_1): Right-align the size values.
Diffstat (limited to 'src')
-rw-r--r--src/buffer.c32
1 files changed, 25 insertions, 7 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 26eefc3c986..4d4169c22ca 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1142,8 +1142,8 @@ list_buffers_1 (files)
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
@@ -1152,8 +1152,8 @@ list_buffers_1 (files)
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 {
@@ -1177,9 +1177,27 @@ list_buffers_1 (files)
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);