diff options
| author | Juanma Barranquero | 2002-12-16 08:13:19 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2002-12-16 08:13:19 +0000 |
| commit | bc7bb432d6af6b59cef41c990f49a2f18026fdda (patch) | |
| tree | 0279f702525aa07c8e10eb482290d3e3db3c399f | |
| parent | 644e04f80801c3dc09ab3deccdc9bb8d13b2dc5d (diff) | |
| download | emacs-bc7bb432d6af6b59cef41c990f49a2f18026fdda.tar.gz emacs-bc7bb432d6af6b59cef41c990f49a2f18026fdda.zip | |
(Buffer-menu, Buffer-menu-use-header-line, Buffer-menu-buffer-face,
Buffer-menu-buffer+size-width, Buffer-menu-mode-width): New customization.
(Buffer-menu-sort-column): New var.
(Buffer-menu-no-header): New function for not changing header line and
recognizing swapped M&R columns, used by modifying commands in Buffer Menu.
(Buffer-menu-buffer+size): New function for variable width buffer name.
(list-buffers-noselect): Rewritten for nicer menu.
| -rw-r--r-- | lisp/ChangeLog | 14 | ||||
| -rw-r--r-- | lisp/buff-menu.el | 273 |
2 files changed, 178 insertions, 109 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 93ebfb3d4da..40a67ec1c97 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2002-12-16 Daniel Pfeiffer <occitan@esperanto.org> | ||
| 2 | |||
| 3 | * buff-menu.el (Buffer-menu, Buffer-menu-use-header-line) | ||
| 4 | (Buffer-menu-buffer-face, Buffer-menu-buffer+size-width) | ||
| 5 | (Buffer-menu-mode-width): New customization. | ||
| 6 | (Buffer-menu-sort-column): New var. | ||
| 7 | (Buffer-menu-no-header): New function for not changing header line and | ||
| 8 | recognizing swapped M&R columns, used by modifying commands in Buffer | ||
| 9 | Menu. | ||
| 10 | (Buffer-menu-buffer+size): New function for variable width buffer name. | ||
| 11 | (list-buffers-noselect): Rewritten for nicer menu. | ||
| 12 | |||
| 1 | 2002-12-16 Markus Rost <rost@math.ohio-state.edu> | 13 | 2002-12-16 Markus Rost <rost@math.ohio-state.edu> |
| 2 | 14 | ||
| 3 | * filesets.el (filesets-build-menu-now): Don't clear messages. | 15 | * filesets.el (filesets-build-menu-now): Don't clear messages. |
| @@ -18,7 +30,7 @@ | |||
| 18 | 30 | ||
| 19 | 2002-12-15 David Kastrup <David.Kastrup@t-online.de> | 31 | 2002-12-15 David Kastrup <David.Kastrup@t-online.de> |
| 20 | 32 | ||
| 21 | * emacs-lisp/autoload.el (autoload-ensure-default-file): insert | 33 | * emacs-lisp/autoload.el (autoload-ensure-default-file): Insert |
| 22 | missing space in file end comment. | 34 | missing space in file end comment. |
| 23 | 35 | ||
| 24 | 2002-12-15 Simon Josefsson <jas@extundo.com> | 36 | 2002-12-15 Simon Josefsson <jas@extundo.com> |
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el index ea8a4ba914a..3efd9fac943 100644 --- a/lisp/buff-menu.el +++ b/lisp/buff-menu.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; buff-menu.el --- buffer menu main function and support functions | 1 | ;;; buff-menu.el --- buffer menu main function and support functions |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 86, 87, 93, 94, 95, 2000, 2001 | 3 | ;; Copyright (C) 1985, 86, 87, 93, 94, 95, 2000, 2001, 2002 |
| 4 | ;; Free Software Foundation, Inc. | 4 | ;; Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Maintainer: FSF | 6 | ;; Maintainer: FSF |
| @@ -64,7 +64,37 @@ | |||
| 64 | ; Put buffer *Buffer List* into proper mode right away | 64 | ; Put buffer *Buffer List* into proper mode right away |
| 65 | ; so that from now on even list-buffers is enough to get a buffer menu. | 65 | ; so that from now on even list-buffers is enough to get a buffer menu. |
| 66 | 66 | ||
| 67 | (defvar Buffer-menu-buffer-column nil) | 67 | (defgroup Buffer-menu nil |
| 68 | "Show a menu of all buffers in a buffer." | ||
| 69 | :group 'tools | ||
| 70 | :group 'convenience) | ||
| 71 | |||
| 72 | (defcustom Buffer-menu-use-header-line t | ||
| 73 | "*Non-nil means to use an immovable header-line." | ||
| 74 | :type 'boolean | ||
| 75 | :group 'Buffer-menu) | ||
| 76 | |||
| 77 | (defface Buffer-menu-buffer-face | ||
| 78 | '((t (:weight bold))) | ||
| 79 | "Face used to highlight buffer name." | ||
| 80 | :group 'font-lock-highlighting-faces) | ||
| 81 | |||
| 82 | (defcustom Buffer-menu-buffer+size-width 21 | ||
| 83 | "*How wide to jointly make the buffer name and size columns." | ||
| 84 | :type 'number | ||
| 85 | :group 'Buffer-menu) | ||
| 86 | |||
| 87 | (defcustom Buffer-menu-mode-width 11 | ||
| 88 | "*How wide to make the mode name column." | ||
| 89 | :type 'number | ||
| 90 | :group 'Buffer-menu) | ||
| 91 | |||
| 92 | ; This should get updated & resorted when you click on a column heading | ||
| 93 | (defvar Buffer-menu-sort-column nil | ||
| 94 | "*2 for sorting by buffer names. 5 for sorting by file names. | ||
| 95 | nil for default sorting by visited order.") | ||
| 96 | |||
| 97 | (defconst Buffer-menu-buffer-column 4) | ||
| 68 | 98 | ||
| 69 | (defvar Buffer-menu-mode-map nil "") | 99 | (defvar Buffer-menu-mode-map nil "") |
| 70 | 100 | ||
| @@ -183,9 +213,10 @@ The first column shows `>' for a buffer you have | |||
| 183 | marked to be displayed, `D' for one you have marked for | 213 | marked to be displayed, `D' for one you have marked for |
| 184 | deletion, and `.' for the current buffer. | 214 | deletion, and `.' for the current buffer. |
| 185 | 215 | ||
| 216 | The C column has a `.' for the buffer from which you came. | ||
| 217 | The R column has a `%' if the buffer is read-only. | ||
| 186 | The M column has a `*' if it is modified, | 218 | The M column has a `*' if it is modified, |
| 187 | or `S' if you have marked it for saving. | 219 | or `S' if you have marked it for saving. |
| 188 | The R column has a `%' if the buffer is read-only. | ||
| 189 | After this come the buffer name, its size in characters, | 220 | After this come the buffer name, its size in characters, |
| 190 | its major mode, and the visited file name (if any)." | 221 | its major mode, and the visited file name (if any)." |
| 191 | (interactive "P") | 222 | (interactive "P") |
| @@ -207,12 +238,19 @@ For more information, see the function `buffer-menu'." | |||
| 207 | (message | 238 | (message |
| 208 | "Commands: d, s, x, u; f, o, 1, 2, m, v; ~, %%; q to quit; ? for help.")) | 239 | "Commands: d, s, x, u; f, o, 1, 2, m, v; ~, %%; q to quit; ? for help.")) |
| 209 | 240 | ||
| 241 | (defun Buffer-menu-no-header () | ||
| 242 | (beginning-of-line) | ||
| 243 | (if (or Buffer-menu-use-header-line | ||
| 244 | (not (eq (char-after) ?C))) | ||
| 245 | t | ||
| 246 | (ding) | ||
| 247 | (forward-line 1) | ||
| 248 | nil)) | ||
| 249 | |||
| 210 | (defun Buffer-menu-mark () | 250 | (defun Buffer-menu-mark () |
| 211 | "Mark buffer on this line for being displayed by \\<Buffer-menu-mode-map>\\[Buffer-menu-select] command." | 251 | "Mark buffer on this line for being displayed by \\<Buffer-menu-mode-map>\\[Buffer-menu-select] command." |
| 212 | (interactive) | 252 | (interactive) |
| 213 | (beginning-of-line) | 253 | (when (Buffer-menu-no-header) |
| 214 | (if (looking-at " [-M]") | ||
| 215 | (ding) | ||
| 216 | (let ((buffer-read-only nil)) | 254 | (let ((buffer-read-only nil)) |
| 217 | (delete-char 1) | 255 | (delete-char 1) |
| 218 | (insert ?>) | 256 | (insert ?>) |
| @@ -222,15 +260,13 @@ For more information, see the function `buffer-menu'." | |||
| 222 | "Cancel all requested operations on buffer on this line and move down. | 260 | "Cancel all requested operations on buffer on this line and move down. |
| 223 | Optional ARG means move up." | 261 | Optional ARG means move up." |
| 224 | (interactive "P") | 262 | (interactive "P") |
| 225 | (beginning-of-line) | 263 | (when (Buffer-menu-no-header) |
| 226 | (if (looking-at " [-M]") | ||
| 227 | (ding) | ||
| 228 | (let* ((buf (Buffer-menu-buffer t)) | 264 | (let* ((buf (Buffer-menu-buffer t)) |
| 229 | (mod (buffer-modified-p buf)) | 265 | (mod (buffer-modified-p buf)) |
| 230 | (readonly (save-excursion (set-buffer buf) buffer-read-only)) | 266 | (readonly (save-excursion (set-buffer buf) buffer-read-only)) |
| 231 | (buffer-read-only nil)) | 267 | (buffer-read-only nil)) |
| 232 | (delete-char 3) | 268 | (delete-char 3) |
| 233 | (insert (if readonly (if mod " *%" " %") (if mod " * " " "))))) | 269 | (insert (if readonly (if mod " %*" " % ") (if mod " *" " "))))) |
| 234 | (forward-line (if backup -1 1))) | 270 | (forward-line (if backup -1 1))) |
| 235 | 271 | ||
| 236 | (defun Buffer-menu-backup-unmark () | 272 | (defun Buffer-menu-backup-unmark () |
| @@ -245,9 +281,7 @@ Optional ARG means move up." | |||
| 245 | Prefix arg is how many buffers to delete. | 281 | Prefix arg is how many buffers to delete. |
| 246 | Negative arg means delete backwards." | 282 | Negative arg means delete backwards." |
| 247 | (interactive "p") | 283 | (interactive "p") |
| 248 | (beginning-of-line) | 284 | (when (Buffer-menu-no-header) |
| 249 | (if (looking-at " [-M]") ;header lines | ||
| 250 | (ding) | ||
| 251 | (let ((buffer-read-only nil)) | 285 | (let ((buffer-read-only nil)) |
| 252 | (if (or (null arg) (= arg 0)) | 286 | (if (or (null arg) (= arg 0)) |
| 253 | (setq arg 1)) | 287 | (setq arg 1)) |
| @@ -256,7 +290,8 @@ Negative arg means delete backwards." | |||
| 256 | (insert ?D) | 290 | (insert ?D) |
| 257 | (forward-line 1) | 291 | (forward-line 1) |
| 258 | (setq arg (1- arg))) | 292 | (setq arg (1- arg))) |
| 259 | (while (< arg 0) | 293 | (while (and (< arg 0) |
| 294 | (Buffer-menu-no-header)) | ||
| 260 | (delete-char 1) | 295 | (delete-char 1) |
| 261 | (insert ?D) | 296 | (insert ?D) |
| 262 | (forward-line -1) | 297 | (forward-line -1) |
| @@ -266,18 +301,14 @@ Negative arg means delete backwards." | |||
| 266 | "Mark buffer on this line to be deleted by \\<Buffer-menu-mode-map>\\[Buffer-menu-execute] command | 301 | "Mark buffer on this line to be deleted by \\<Buffer-menu-mode-map>\\[Buffer-menu-execute] command |
| 267 | and then move up one line. Prefix arg means move that many lines." | 302 | and then move up one line. Prefix arg means move that many lines." |
| 268 | (interactive "p") | 303 | (interactive "p") |
| 269 | (Buffer-menu-delete (- (or arg 1))) | 304 | (Buffer-menu-delete (- (or arg 1)))) |
| 270 | (while (looking-at " [-M]") | ||
| 271 | (forward-line 1))) | ||
| 272 | 305 | ||
| 273 | (defun Buffer-menu-save () | 306 | (defun Buffer-menu-save () |
| 274 | "Mark buffer on this line to be saved by \\<Buffer-menu-mode-map>\\[Buffer-menu-execute] command." | 307 | "Mark buffer on this line to be saved by \\<Buffer-menu-mode-map>\\[Buffer-menu-execute] command." |
| 275 | (interactive) | 308 | (interactive) |
| 276 | (beginning-of-line) | 309 | (when (Buffer-menu-no-header) |
| 277 | (if (looking-at " [-M]") ;header lines | ||
| 278 | (ding) | ||
| 279 | (let ((buffer-read-only nil)) | 310 | (let ((buffer-read-only nil)) |
| 280 | (forward-char 1) | 311 | (forward-char 2) |
| 281 | (delete-char 1) | 312 | (delete-char 1) |
| 282 | (insert ?S) | 313 | (insert ?S) |
| 283 | (forward-line 1)))) | 314 | (forward-line 1)))) |
| @@ -290,8 +321,8 @@ and then move up one line. Prefix arg means move that many lines." | |||
| 290 | (set-buffer-modified-p arg)) | 321 | (set-buffer-modified-p arg)) |
| 291 | (save-excursion | 322 | (save-excursion |
| 292 | (beginning-of-line) | 323 | (beginning-of-line) |
| 293 | (forward-char 1) | 324 | (forward-char 2) |
| 294 | (if (= (char-after (point)) (if arg ? ?*)) | 325 | (if (= (char-after) (if arg ? ?*)) |
| 295 | (let ((buffer-read-only nil)) | 326 | (let ((buffer-read-only nil)) |
| 296 | (delete-char 1) | 327 | (delete-char 1) |
| 297 | (insert (if arg ?* ? )))))) | 328 | (insert (if arg ?* ? )))))) |
| @@ -302,7 +333,7 @@ and then move up one line. Prefix arg means move that many lines." | |||
| 302 | (save-excursion | 333 | (save-excursion |
| 303 | (goto-char (point-min)) | 334 | (goto-char (point-min)) |
| 304 | (forward-line 1) | 335 | (forward-line 1) |
| 305 | (while (re-search-forward "^.S" nil t) | 336 | (while (re-search-forward "^..S" nil t) |
| 306 | (let ((modp nil)) | 337 | (let ((modp nil)) |
| 307 | (save-excursion | 338 | (save-excursion |
| 308 | (set-buffer (Buffer-menu-buffer t)) | 339 | (set-buffer (Buffer-menu-buffer t)) |
| @@ -437,7 +468,7 @@ The current window remains selected." | |||
| 437 | (setq char (if buffer-read-only ?% ? ))) | 468 | (setq char (if buffer-read-only ?% ? ))) |
| 438 | (save-excursion | 469 | (save-excursion |
| 439 | (beginning-of-line) | 470 | (beginning-of-line) |
| 440 | (forward-char 2) | 471 | (forward-char 1) |
| 441 | (if (/= (following-char) char) | 472 | (if (/= (following-char) char) |
| 442 | (let (buffer-read-only) | 473 | (let (buffer-read-only) |
| 443 | (delete-char 1) | 474 | (delete-char 1) |
| @@ -446,9 +477,7 @@ The current window remains selected." | |||
| 446 | (defun Buffer-menu-bury () | 477 | (defun Buffer-menu-bury () |
| 447 | "Bury the buffer listed on this line." | 478 | "Bury the buffer listed on this line." |
| 448 | (interactive) | 479 | (interactive) |
| 449 | (beginning-of-line) | 480 | (when (Buffer-menu-no-header) |
| 450 | (if (looking-at " [-M]") ;header lines | ||
| 451 | (ding) | ||
| 452 | (save-excursion | 481 | (save-excursion |
| 453 | (beginning-of-line) | 482 | (beginning-of-line) |
| 454 | (bury-buffer (Buffer-menu-buffer t)) | 483 | (bury-buffer (Buffer-menu-buffer t)) |
| @@ -484,6 +513,32 @@ For more information, see the function `buffer-menu'." | |||
| 484 | (interactive "P") | 513 | (interactive "P") |
| 485 | (display-buffer (list-buffers-noselect files-only))) | 514 | (display-buffer (list-buffers-noselect files-only))) |
| 486 | 515 | ||
| 516 | (defun Buffer-menu-buffer+size (name size &optional name-props size-props) | ||
| 517 | (if (> (+ (length name) (length size) 2) Buffer-menu-buffer+size-width) | ||
| 518 | (setq name | ||
| 519 | (if (string-match "<[0-9]+>$" name) | ||
| 520 | (concat (substring name 0 | ||
| 521 | (- Buffer-menu-buffer+size-width | ||
| 522 | (max (length size) 3) | ||
| 523 | (match-end 0) | ||
| 524 | (- (match-beginning 0)) | ||
| 525 | 2)) | ||
| 526 | ":" ; narrow ellipsis | ||
| 527 | (match-string 0 name)) | ||
| 528 | (concat (substring name 0 | ||
| 529 | (- Buffer-menu-buffer+size-width | ||
| 530 | (max (length size) 3) | ||
| 531 | 2)) | ||
| 532 | ":")))) ; narrow ellipsis | ||
| 533 | (add-text-properties 0 (length name) name-props name) | ||
| 534 | (add-text-properties 0 (length size) size-props size) | ||
| 535 | (concat name | ||
| 536 | (make-string (- Buffer-menu-buffer+size-width | ||
| 537 | (length name) | ||
| 538 | (length size)) | ||
| 539 | ? ) | ||
| 540 | size)) | ||
| 541 | |||
| 487 | (defun list-buffers-noselect (&optional files-only) | 542 | (defun list-buffers-noselect (&optional files-only) |
| 488 | "Create and return a buffer with a list of names of existing buffers. | 543 | "Create and return a buffer with a list of names of existing buffers. |
| 489 | The buffer is named `*Buffer List*'. | 544 | The buffer is named `*Buffer List*'. |
| @@ -491,92 +546,94 @@ Note that buffers with names starting with spaces are omitted. | |||
| 491 | Non-null optional arg FILES-ONLY means mention only file buffers. | 546 | Non-null optional arg FILES-ONLY means mention only file buffers. |
| 492 | 547 | ||
| 493 | For more information, see the function `buffer-menu'." | 548 | For more information, see the function `buffer-menu'." |
| 494 | (let ((old-buffer (current-buffer)) | 549 | (let* ((old-buffer (current-buffer)) |
| 495 | (standard-output standard-output) | 550 | (standard-output standard-output) |
| 496 | desired-point) | 551 | (mode-end (make-string (- Buffer-menu-mode-width 2) ? )) |
| 552 | (header (concat "CRM " (Buffer-menu-buffer+size "Buffer" "Size") | ||
| 553 | " Mode" mode-end "File\n")) | ||
| 554 | list desired-point name file mode) | ||
| 497 | (save-excursion | 555 | (save-excursion |
| 498 | (set-buffer (get-buffer-create "*Buffer List*")) | 556 | (set-buffer (get-buffer-create "*Buffer List*")) |
| 499 | (setq buffer-read-only nil) | 557 | (setq buffer-read-only nil) |
| 500 | (erase-buffer) | 558 | (erase-buffer) |
| 501 | (setq standard-output (current-buffer)) | 559 | (setq standard-output (current-buffer)) |
| 502 | (princ "\ | 560 | (unless Buffer-menu-use-header-line |
| 503 | MR Buffer Size Mode File | 561 | (insert header "--- ------") |
| 504 | -- ------ ---- ---- ---- | 562 | (indent-to Buffer-menu-buffer+size-width) |
| 505 | ") | 563 | (insert "---- ----" mode-end "----\n") |
| 506 | ;; Record the column where buffer names start. | 564 | (put-text-property 1 (point) 'intangible t)) |
| 507 | (setq Buffer-menu-buffer-column 4) | 565 | (setq list |
| 508 | (dolist (buffer (buffer-list)) | 566 | (delq t |
| 509 | (let ((name (buffer-name buffer)) | 567 | (mapcar |
| 510 | (file (buffer-file-name buffer)) | 568 | (lambda (buffer) |
| 511 | this-buffer-line-start | 569 | (with-current-buffer buffer |
| 512 | this-buffer-read-only | 570 | (setq name (buffer-name) |
| 513 | (this-buffer-size (buffer-size buffer)) | 571 | file (buffer-file-name)) |
| 514 | this-buffer-mode-name | 572 | (cond |
| 515 | this-buffer-directory) | 573 | ;; Don't mention internal buffers. |
| 516 | (with-current-buffer buffer | 574 | ((and (string= (substring name 0 1) " ") (null file))) |
| 517 | (setq this-buffer-read-only buffer-read-only | 575 | ;; Maybe don't mention buffers without files. |
| 518 | this-buffer-mode-name mode-name) | 576 | ((and files-only (not file))) |
| 519 | (unless file | 577 | ((string= name "*Buffer List*")) |
| 520 | ;; No visited file. Check local value of | 578 | ;; Otherwise output info. |
| 521 | ;; list-buffers-directory. | 579 | (t |
| 522 | (when (and (boundp 'list-buffers-directory) | 580 | (unless file |
| 523 | list-buffers-directory) | 581 | ;; No visited file. Check local value of |
| 524 | (setq this-buffer-directory list-buffers-directory)))) | 582 | ;; list-buffers-directory. |
| 525 | (cond | 583 | (when (and (boundp 'list-buffers-directory) |
| 526 | ;; Don't mention internal buffers. | 584 | list-buffers-directory) |
| 527 | ((and (string= (substring name 0 1) " ") (null file))) | 585 | (setq file list-buffers-directory))) |
| 528 | ;; Maybe don't mention buffers without files. | 586 | (list buffer |
| 529 | ((and files-only (not file))) | 587 | (format "%c%c%c " |
| 530 | ((string= name "*Buffer List*")) | 588 | (if (eq buffer old-buffer) ?. ? ) |
| 531 | ;; Otherwise output info. | 589 | ;; Handle readonly status. The output buffer is special |
| 532 | (t | 590 | ;; cased to appear readonly; it is actually made so at a |
| 533 | (setq this-buffer-line-start (point)) | 591 | ;; later date. |
| 534 | ;; Identify current buffer. | 592 | (if (or (eq buffer standard-output) |
| 535 | (if (eq buffer old-buffer) | 593 | buffer-read-only) |
| 536 | (progn | 594 | ?% ? ) |
| 537 | (setq desired-point (point)) | 595 | ;; Identify modified buffers. |
| 538 | (princ ".")) | 596 | (if (buffer-modified-p) ?* ? )) |
| 539 | (princ " ")) | 597 | name (buffer-size) mode-name file))))) |
| 540 | ;; Identify modified buffers. | 598 | (buffer-list)))) |
| 541 | (princ (if (buffer-modified-p buffer) "*" " ")) | 599 | (dolist (buffer |
| 542 | ;; Handle readonly status. The output buffer is special | 600 | (if Buffer-menu-sort-column |
| 543 | ;; cased to appear readonly; it is actually made so at a | 601 | (sort list |
| 544 | ;; later date. | 602 | (if (eq Buffer-menu-sort-column 3) |
| 545 | (princ (if (or (eq buffer standard-output) | 603 | (lambda (a b) |
| 546 | this-buffer-read-only) | 604 | (< (nth Buffer-menu-sort-column a) |
| 547 | "% " | 605 | (nth Buffer-menu-sort-column b))) |
| 548 | " ")) | 606 | (lambda (a b) |
| 549 | (princ name) | 607 | (string< (nth Buffer-menu-sort-column a) |
| 550 | ;; Put the buffer name into a text property | 608 | (nth Buffer-menu-sort-column b))))) |
| 551 | ;; so we don't have to extract it from the text. | 609 | list)) |
| 552 | ;; This way we avoid problems with unusual buffer names. | 610 | (if (eq (car buffer) old-buffer) |
| 553 | (setq this-buffer-line-start | 611 | (setq desired-point (point))) |
| 554 | (+ this-buffer-line-start Buffer-menu-buffer-column)) | 612 | (insert (cadr buffer) |
| 555 | (let ((name-end (point))) | 613 | ;; Put the buffer name into a text property |
| 556 | (indent-to 17 2) | 614 | ;; so we don't have to extract it from the text. |
| 557 | (put-text-property this-buffer-line-start name-end | 615 | ;; This way we avoid problems with unusual buffer names. |
| 558 | 'buffer-name name) | 616 | (Buffer-menu-buffer+size (nth 2 buffer) |
| 559 | (put-text-property this-buffer-line-start (point) | 617 | (int-to-string (nth 3 buffer)) |
| 560 | 'buffer buffer) | 618 | `(buffer-name ,(nth 2 buffer) |
| 561 | (put-text-property this-buffer-line-start name-end | 619 | buffer ,(car buffer) |
| 562 | 'mouse-face 'highlight) | 620 | face Buffer-menu-buffer-face |
| 563 | (put-text-property this-buffer-line-start name-end | 621 | mouse-face highlight |
| 564 | 'help-echo "mouse-2: select this buffer")) | 622 | help-echo "mouse-2: select this buffer")) |
| 565 | (let ((size (format "%8d" this-buffer-size)) | 623 | " " |
| 566 | (mode this-buffer-mode-name) | 624 | (if (> (length (nth 4 buffer)) Buffer-menu-mode-width) |
| 567 | (excess (- (current-column) 17))) | 625 | (substring (nth 4 buffer) 0 Buffer-menu-mode-width) |
| 568 | (while (and (> excess 0) (= (aref size 0) ?\ )) | 626 | (nth 4 buffer))) |
| 569 | (setq size (substring size 1) | 627 | (when (nth 5 buffer) |
| 570 | excess (1- excess))) | 628 | (indent-to (+ Buffer-menu-buffer-column Buffer-menu-buffer+size-width |
| 571 | (princ size) | 629 | Buffer-menu-mode-width 4) 1) |
| 572 | (indent-to 27 1) | 630 | (princ (abbreviate-file-name (nth 5 buffer)))) |
| 573 | (princ mode)) | 631 | (princ "\n")) |
| 574 | (indent-to 40 1) | ||
| 575 | (or file (setq file this-buffer-directory)) | ||
| 576 | (when file | ||
| 577 | (princ (abbreviate-file-name file))) | ||
| 578 | (princ "\n"))))) | ||
| 579 | (Buffer-menu-mode) | 632 | (Buffer-menu-mode) |
| 633 | (when Buffer-menu-use-header-line | ||
| 634 | (set (make-local-variable 'Buffer-menu-header-line) | ||
| 635 | (concat " " header)) | ||
| 636 | (setq header-line-format 'Buffer-menu-header-line)) | ||
| 580 | ;; DESIRED-POINT doesn't have to be set; it is not when the | 637 | ;; DESIRED-POINT doesn't have to be set; it is not when the |
| 581 | ;; current buffer is not displayed for some reason. | 638 | ;; current buffer is not displayed for some reason. |
| 582 | (and desired-point | 639 | (and desired-point |