diff options
| author | Richard M. Stallman | 1995-01-17 02:33:24 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-01-17 02:33:24 +0000 |
| commit | 01c386ba5ef79131e7e0dda61138866cc308c934 (patch) | |
| tree | 4673675f882e38ba9c2bb15c8143eb403dce3ba9 /src/buffer.c | |
| parent | d917be71a8466e98f2c3dd55670fd540c727638e (diff) | |
| download | emacs-01c386ba5ef79131e7e0dda61138866cc308c934.tar.gz emacs-01c386ba5ef79131e7e0dda61138866cc308c934.zip | |
(list_buffers_1, Flist_buffers): Functions deleted.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 131 |
1 files changed, 0 insertions, 131 deletions
diff --git a/src/buffer.c b/src/buffer.c index 1d84c71c5bb..78f75525b19 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -1407,135 +1407,6 @@ validate_region (b, e) | |||
| 1407 | args_out_of_range (*b, *e); | 1407 | args_out_of_range (*b, *e); |
| 1408 | } | 1408 | } |
| 1409 | 1409 | ||
| 1410 | static Lisp_Object | ||
| 1411 | list_buffers_1 (files) | ||
| 1412 | Lisp_Object files; | ||
| 1413 | { | ||
| 1414 | register Lisp_Object tail, tem, buf; | ||
| 1415 | Lisp_Object col1, col2, col3, minspace; | ||
| 1416 | register struct buffer *old = current_buffer, *b; | ||
| 1417 | Lisp_Object desired_point; | ||
| 1418 | Lisp_Object other_file_symbol; | ||
| 1419 | |||
| 1420 | desired_point = Qnil; | ||
| 1421 | other_file_symbol = intern ("list-buffers-directory"); | ||
| 1422 | |||
| 1423 | XSETFASTINT (col1, 17); | ||
| 1424 | XSETFASTINT (col2, 28); | ||
| 1425 | XSETFASTINT (col3, 40); | ||
| 1426 | XSETFASTINT (minspace, 1); | ||
| 1427 | |||
| 1428 | Fset_buffer (Vstandard_output); | ||
| 1429 | Fbuffer_disable_undo (Vstandard_output); | ||
| 1430 | current_buffer->read_only = Qnil; | ||
| 1431 | |||
| 1432 | write_string ("\ | ||
| 1433 | MR Buffer Size Mode File\n\ | ||
| 1434 | -- ------ ---- ---- ----\n", -1); | ||
| 1435 | |||
| 1436 | for (tail = Vbuffer_alist; !NILP (tail); tail = Fcdr (tail)) | ||
| 1437 | { | ||
| 1438 | buf = Fcdr (Fcar (tail)); | ||
| 1439 | b = XBUFFER (buf); | ||
| 1440 | /* Don't mention the minibuffers. */ | ||
| 1441 | if (XSTRING (b->name)->data[0] == ' ') | ||
| 1442 | continue; | ||
| 1443 | /* Optionally don't mention buffers that lack files. */ | ||
| 1444 | if (!NILP (files) && NILP (b->filename)) | ||
| 1445 | continue; | ||
| 1446 | /* Identify the current buffer. */ | ||
| 1447 | if (b == old) | ||
| 1448 | XSETFASTINT (desired_point, PT); | ||
| 1449 | write_string (b == old ? "." : " ", -1); | ||
| 1450 | /* Identify modified buffers */ | ||
| 1451 | write_string (BUF_MODIFF (b) > BUF_SAVE_MODIFF (b) ? "*" : " ", -1); | ||
| 1452 | /* The current buffer is special-cased to be marked read-only. | ||
| 1453 | It is actually made read-only by the call to | ||
| 1454 | Buffer-menu-mode, below. */ | ||
| 1455 | write_string ((b != current_buffer && NILP (b->read_only)) | ||
| 1456 | ? " " : "% ", -1); | ||
| 1457 | Fprinc (b->name, Qnil); | ||
| 1458 | tem = Findent_to (col1, make_number (2)); | ||
| 1459 | { | ||
| 1460 | char sizebuf[9]; | ||
| 1461 | int i; | ||
| 1462 | char *p; | ||
| 1463 | |||
| 1464 | sprintf (sizebuf, "%8d", BUF_Z (b) - BUF_BEG (b)); | ||
| 1465 | /* Here's how many extra columns the buffer name used. */ | ||
| 1466 | i = XFASTINT (tem) - XFASTINT (col1); | ||
| 1467 | /* Skip that many spaces in the size, if it has that many, | ||
| 1468 | to keep the size values right-aligned if possible. */ | ||
| 1469 | p = sizebuf; | ||
| 1470 | while (i > 0) | ||
| 1471 | { | ||
| 1472 | if (*p == ' ') | ||
| 1473 | p++; | ||
| 1474 | i--; | ||
| 1475 | } | ||
| 1476 | |||
| 1477 | write_string (p, -1); | ||
| 1478 | } | ||
| 1479 | Findent_to (col2, minspace); | ||
| 1480 | Fprinc (b->mode_name, Qnil); | ||
| 1481 | Findent_to (col3, minspace); | ||
| 1482 | |||
| 1483 | if (!NILP (b->filename)) | ||
| 1484 | Fprinc (b->filename, Qnil); | ||
| 1485 | else | ||
| 1486 | { | ||
| 1487 | /* No visited file; check local value of list-buffers-directory. */ | ||
| 1488 | Lisp_Object tem; | ||
| 1489 | set_buffer_internal (b); | ||
| 1490 | tem = Fboundp (other_file_symbol); | ||
| 1491 | if (!NILP (tem)) | ||
| 1492 | { | ||
| 1493 | tem = Fsymbol_value (other_file_symbol); | ||
| 1494 | Fset_buffer (Vstandard_output); | ||
| 1495 | if (STRINGP (tem)) | ||
| 1496 | Fprinc (tem, Qnil); | ||
| 1497 | } | ||
| 1498 | else | ||
| 1499 | Fset_buffer (Vstandard_output); | ||
| 1500 | } | ||
| 1501 | write_string ("\n", -1); | ||
| 1502 | } | ||
| 1503 | |||
| 1504 | tail = intern ("Buffer-menu-mode"); | ||
| 1505 | if ((tem = Ffboundp (tail), !NILP (tem))) | ||
| 1506 | call0 (tail); | ||
| 1507 | set_buffer_internal (old); | ||
| 1508 | return desired_point; | ||
| 1509 | } | ||
| 1510 | |||
| 1511 | DEFUN ("list-buffers", Flist_buffers, Slist_buffers, 0, 1, "P", | ||
| 1512 | "Display a list of names of existing buffers.\n\ | ||
| 1513 | The list is displayed in a buffer named `*Buffer List*'.\n\ | ||
| 1514 | Note that buffers with names starting with spaces are omitted.\n\ | ||
| 1515 | Non-null optional arg FILES-ONLY means mention only file buffers.\n\ | ||
| 1516 | \n\ | ||
| 1517 | The M column contains a * for buffers that are modified.\n\ | ||
| 1518 | The R column contains a % for buffers that are read-only.") | ||
| 1519 | (files) | ||
| 1520 | Lisp_Object files; | ||
| 1521 | { | ||
| 1522 | Lisp_Object desired_point; | ||
| 1523 | |||
| 1524 | desired_point | ||
| 1525 | = internal_with_output_to_temp_buffer ("*Buffer List*", | ||
| 1526 | list_buffers_1, files); | ||
| 1527 | |||
| 1528 | if (NUMBERP (desired_point)) | ||
| 1529 | { | ||
| 1530 | int count = specpdl_ptr - specpdl; | ||
| 1531 | record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); | ||
| 1532 | Fset_buffer (build_string ("*Buffer List*")); | ||
| 1533 | SET_PT (XINT (desired_point)); | ||
| 1534 | return unbind_to (count, Qnil); | ||
| 1535 | } | ||
| 1536 | return Qnil; | ||
| 1537 | } | ||
| 1538 | |||
| 1539 | DEFUN ("kill-all-local-variables", Fkill_all_local_variables, Skill_all_local_variables, | 1410 | DEFUN ("kill-all-local-variables", Fkill_all_local_variables, Skill_all_local_variables, |
| 1540 | 0, 0, 0, | 1411 | 0, 0, 0, |
| 1541 | "Switch to Fundamental mode by killing current buffer's local variables.\n\ | 1412 | "Switch to Fundamental mode by killing current buffer's local variables.\n\ |
| @@ -3395,7 +3266,6 @@ is a member of the list."); | |||
| 3395 | defsubr (&Sset_buffer); | 3266 | defsubr (&Sset_buffer); |
| 3396 | defsubr (&Sbarf_if_buffer_read_only); | 3267 | defsubr (&Sbarf_if_buffer_read_only); |
| 3397 | defsubr (&Sbury_buffer); | 3268 | defsubr (&Sbury_buffer); |
| 3398 | defsubr (&Slist_buffers); | ||
| 3399 | defsubr (&Skill_all_local_variables); | 3269 | defsubr (&Skill_all_local_variables); |
| 3400 | 3270 | ||
| 3401 | defsubr (&Soverlayp); | 3271 | defsubr (&Soverlayp); |
| @@ -3419,7 +3289,6 @@ keys_of_buffer () | |||
| 3419 | { | 3289 | { |
| 3420 | initial_define_key (control_x_map, 'b', "switch-to-buffer"); | 3290 | initial_define_key (control_x_map, 'b', "switch-to-buffer"); |
| 3421 | initial_define_key (control_x_map, 'k', "kill-buffer"); | 3291 | initial_define_key (control_x_map, 'k', "kill-buffer"); |
| 3422 | initial_define_key (control_x_map, Ctl ('B'), "list-buffers"); | ||
| 3423 | 3292 | ||
| 3424 | /* This must not be in syms_of_buffer, because Qdisabled is not | 3293 | /* This must not be in syms_of_buffer, because Qdisabled is not |
| 3425 | initialized when that function gets called. */ | 3294 | initialized when that function gets called. */ |