Mercurial > hg > xemacs-beta
comparison lisp/buff-menu.el @ 444:576fb035e263 r21-2-37
Import from CVS: tag r21-2-37
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:36:19 +0200 |
parents | abe6d1db359e |
children | 1ccc32a20af4 |
comparison
equal
deleted
inserted
replaced
443:a8296e22da4e | 444:576fb035e263 |
---|---|
44 ;; current entry and then move to previous one. | 44 ;; current entry and then move to previous one. |
45 ;; | 45 ;; |
46 ;; Based on FSF code dating back to 1985. | 46 ;; Based on FSF code dating back to 1985. |
47 | 47 |
48 ;;; Code: | 48 ;;; Code: |
49 | 49 |
50 ;;;Trying to preserve the old window configuration works well in | 50 ;;;Trying to preserve the old window configuration works well in |
51 ;;;simple scenarios, when you enter the buffer menu, use it, and exit it. | 51 ;;;simple scenarios, when you enter the buffer menu, use it, and exit it. |
52 ;;;But it does strange things when you switch back to the buffer list buffer | 52 ;;;But it does strange things when you switch back to the buffer list buffer |
53 ;;;with C-x b, later on, when the window configuration is different. | 53 ;;;with C-x b, later on, when the window configuration is different. |
54 ;;;The choice seems to be, either restore the window configuration | 54 ;;;The choice seems to be, either restore the window configuration |
319 You can mark buffers with the \\<Buffer-menu-mode-map>\\[Buffer-menu-mark] command. | 319 You can mark buffers with the \\<Buffer-menu-mode-map>\\[Buffer-menu-mark] command. |
320 This command deletes and replaces all the previously existing windows | 320 This command deletes and replaces all the previously existing windows |
321 in the selected frame." | 321 in the selected frame." |
322 (interactive) | 322 (interactive) |
323 (let ((buff (Buffer-menu-buffer t)) | 323 (let ((buff (Buffer-menu-buffer t)) |
324 (menu (current-buffer)) | 324 (menu (current-buffer)) |
325 (others ()) | 325 (others ()) |
326 tem) | 326 tem) |
327 (goto-char (point-min)) | 327 (goto-char (point-min)) |
328 (while (search-forward "\n>" nil t) | 328 (while (search-forward "\n>" nil t) |
329 (setq tem (Buffer-menu-buffer t)) | 329 (setq tem (Buffer-menu-buffer t)) |
482 (error "no buffer on this line")))) | 482 (error "no buffer on this line")))) |
483 | 483 |
484 | 484 |
485 ;; XEmacs | 485 ;; XEmacs |
486 (defvar list-buffers-header-line | 486 (defvar list-buffers-header-line |
487 (purecopy (concat " MR Buffer Size Mode File\n" | 487 (concat " MR Buffer Size Mode File\n" |
488 " -- ------ ---- ---- ----\n"))) | 488 " -- ------ ---- ---- ----\n")) |
489 | 489 |
490 ;; XEmacs | 490 ;; XEmacs |
491 (defvar list-buffers-identification 'default-list-buffers-identification | 491 (defvar list-buffers-identification 'default-list-buffers-identification |
492 "String used to identify this buffer, or a function of one argument | 492 "String used to identify this buffer, or a function of one argument |
493 to generate such a string. This variable is always buffer-local.") | 493 to generate such a string. This variable is always buffer-local.") |
565 (setq this-buffer-line-start (point)) | 565 (setq this-buffer-line-start (point)) |
566 (insert (if (eq buffer current) | 566 (insert (if (eq buffer current) |
567 (progn (setq current (point)) ?\.) | 567 (progn (setq current (point)) ?\.) |
568 ?\ )) | 568 ?\ )) |
569 (insert (if (buffer-modified-p buffer) | 569 (insert (if (buffer-modified-p buffer) |
570 ?\* | 570 ?\* |
571 ?\ )) | 571 ?\ )) |
572 (insert (if ro | 572 (insert (if ro |
573 ?\% | 573 ?\% |
574 ?\ )) | 574 ?\ )) |
575 (if (string-match "[\n\"\\ \t]" name) | 575 (if (string-match "[\n\"\\ \t]" name) |
602 | 602 |
603 (defun list-buffers (&optional files-only) | 603 (defun list-buffers (&optional files-only) |
604 "Display a list of names of existing buffers. | 604 "Display a list of names of existing buffers. |
605 The list is displayed in a buffer named `*Buffer List*'. | 605 The list is displayed in a buffer named `*Buffer List*'. |
606 Note that buffers with names starting with spaces are omitted. | 606 Note that buffers with names starting with spaces are omitted. |
607 Non-null optional arg FILES-ONLY means mention only file buffers. | 607 Non-nil optional arg FILES-ONLY means mention only file buffers. |
608 | 608 |
609 The M column contains a * for buffers that are modified. | 609 The M column contains a * for buffers that are modified. |
610 The R column contains a % for buffers that are read-only." | 610 The R column contains a % for buffers that are read-only." |
611 (interactive (list (if current-prefix-arg t nil))) ; XEmacs | 611 (interactive (list (if current-prefix-arg t nil))) ; XEmacs |
612 (display-buffer (list-buffers-noselect files-only))) | 612 (display-buffer (list-buffers-noselect files-only))) |
614 ;; #### not synched | 614 ;; #### not synched |
615 (defun list-buffers-noselect (&optional files-only) | 615 (defun list-buffers-noselect (&optional files-only) |
616 "Create and return a buffer with a list of names of existing buffers. | 616 "Create and return a buffer with a list of names of existing buffers. |
617 The buffer is named `*Buffer List*'. | 617 The buffer is named `*Buffer List*'. |
618 Note that buffers with names starting with spaces are omitted. | 618 Note that buffers with names starting with spaces are omitted. |
619 Non-null optional arg FILES-ONLY means mention only file buffers. | 619 Non-nil optional arg FILES-ONLY means mention only file buffers. |
620 | 620 |
621 The M column contains a * for buffers that are modified. | 621 The M column contains a * for buffers that are modified. |
622 The R column contains a % for buffers that are read-only." | 622 The R column contains a % for buffers that are read-only." |
623 (let ((buffer (get-buffer-create "*Buffer List*"))) | 623 (let ((buffer (get-buffer-create "*Buffer List*"))) |
624 (list-buffers-internal buffer | 624 (list-buffers-internal buffer |