diff options
| author | Juri Linkov | 2008-04-22 20:36:08 +0000 |
|---|---|---|
| committer | Juri Linkov | 2008-04-22 20:36:08 +0000 |
| commit | d3434a5b8a034f288cc905c2e8c42ddf91484668 (patch) | |
| tree | f7e22b1eac6fb7110e4dda46a30e827e5fbeb29a | |
| parent | 320bc739d34fee050d3e05943a449efc4f7c9afe (diff) | |
| download | emacs-d3434a5b8a034f288cc905c2e8c42ddf91484668.tar.gz emacs-d3434a5b8a034f288cc905c2e8c42ddf91484668.zip | |
(buffers-menu-max-size): Move its definition down to
the "Buffers Menu" section. Change group name `mouse' to `menu'.
(yank-menu-length): Change group name `mouse' to `menu'.
(buffers-menu-buffer-name-length): New user option.
(menu-bar-update-buffers): Use buffers-menu-buffer-name-length
instead of the hard-coded number 27.
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/menu-bar.el | 48 |
2 files changed, 40 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7db5250f09c..fac09bccdb9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,14 @@ | |||
| 1 | 2008-04-22 Juri Linkov <juri@jurta.org> | 1 | 2008-04-22 Juri Linkov <juri@jurta.org> |
| 2 | 2 | ||
| 3 | * menu-bar.el (buffers-menu-max-size): Move its definition down to | ||
| 4 | the "Buffers Menu" section. Change group name `mouse' to `menu'. | ||
| 5 | (yank-menu-length): Change group name `mouse' to `menu'. | ||
| 6 | (buffers-menu-buffer-name-length): New user option. | ||
| 7 | (menu-bar-update-buffers): Use buffers-menu-buffer-name-length | ||
| 8 | instead of the hard-coded number 27. | ||
| 9 | |||
| 10 | 2008-04-22 Juri Linkov <juri@jurta.org> | ||
| 11 | |||
| 3 | * isearch.el (eval-when-compile): Require `help-macro'. | 12 | * isearch.el (eval-when-compile): Require `help-macro'. |
| 4 | (isearch-help-for-help-internal): Isearch specific Help screen | 13 | (isearch-help-for-help-internal): Isearch specific Help screen |
| 5 | created by `make-help-screen'. | 14 | created by `make-help-screen'. |
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 00f76789b34..fe15c81c176 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el | |||
| @@ -30,17 +30,6 @@ | |||
| 30 | 30 | ||
| 31 | ;;; Code: | 31 | ;;; Code: |
| 32 | 32 | ||
| 33 | ;;; User options: | ||
| 34 | |||
| 35 | (defcustom buffers-menu-max-size 10 | ||
| 36 | "*Maximum number of entries which may appear on the Buffers menu. | ||
| 37 | If this is 10, then only the ten most-recently-selected buffers are shown. | ||
| 38 | If this is nil, then all buffers are shown. | ||
| 39 | A large number or nil slows down menu responsiveness." | ||
| 40 | :type '(choice integer | ||
| 41 | (const :tag "All" nil)) | ||
| 42 | :group 'mouse) | ||
| 43 | |||
| 44 | ;; Don't clobber an existing menu-bar keymap, to preserve any menu-bar key | 33 | ;; Don't clobber an existing menu-bar keymap, to preserve any menu-bar key |
| 45 | ;; definitions made in loaddefs.el. | 34 | ;; definitions made in loaddefs.el. |
| 46 | (or (lookup-key global-map [menu-bar]) | 35 | (or (lookup-key global-map [menu-bar]) |
| @@ -1482,7 +1471,7 @@ using `abort-recursive-edit'." | |||
| 1482 | (defcustom yank-menu-length 20 | 1471 | (defcustom yank-menu-length 20 |
| 1483 | "*Maximum length to display in the yank-menu." | 1472 | "*Maximum length to display in the yank-menu." |
| 1484 | :type 'integer | 1473 | :type 'integer |
| 1485 | :group 'mouse) | 1474 | :group 'menu) |
| 1486 | 1475 | ||
| 1487 | (defun menu-bar-update-yank-menu (string old) | 1476 | (defun menu-bar-update-yank-menu (string old) |
| 1488 | (let ((front (car (cdr yank-menu))) | 1477 | (let ((front (car (cdr yank-menu))) |
| @@ -1519,6 +1508,26 @@ The menu shows all the killed text sequences stored in `kill-ring'." | |||
| 1519 | (insert last-command-event)) | 1508 | (insert last-command-event)) |
| 1520 | 1509 | ||
| 1521 | 1510 | ||
| 1511 | ;;; Buffers Menu | ||
| 1512 | |||
| 1513 | (defcustom buffers-menu-max-size 10 | ||
| 1514 | "*Maximum number of entries which may appear on the Buffers menu. | ||
| 1515 | If this is 10, then only the ten most-recently-selected buffers are shown. | ||
| 1516 | If this is nil, then all buffers are shown. | ||
| 1517 | A large number or nil slows down menu responsiveness." | ||
| 1518 | :type '(choice integer | ||
| 1519 | (const :tag "All" nil)) | ||
| 1520 | :group 'menu) | ||
| 1521 | |||
| 1522 | (defcustom buffers-menu-buffer-name-length 30 | ||
| 1523 | "*Maximum length of the buffer name on the Buffers menu. | ||
| 1524 | If this is a number, then buffer names are truncated to this length. | ||
| 1525 | If this is nil, then buffer names are shown in full. | ||
| 1526 | A large number or nil makes the menu too wide." | ||
| 1527 | :type '(choice integer | ||
| 1528 | (const :tag "Full length" nil)) | ||
| 1529 | :group 'menu) | ||
| 1530 | |||
| 1522 | (defcustom buffers-menu-show-directories 'unless-uniquify | 1531 | (defcustom buffers-menu-show-directories 'unless-uniquify |
| 1523 | "If non-nil, show directories in the Buffers menu for buffers that have them. | 1532 | "If non-nil, show directories in the Buffers menu for buffers that have them. |
| 1524 | The special value `unless-uniquify' means that directories will be shown | 1533 | The special value `unless-uniquify' means that directories will be shown |
| @@ -1606,11 +1615,16 @@ Buffers menu is regenerated." | |||
| 1606 | (unless (eq ?\s (aref name 0)) | 1615 | (unless (eq ?\s (aref name 0)) |
| 1607 | (push (menu-bar-update-buffers-1 | 1616 | (push (menu-bar-update-buffers-1 |
| 1608 | (cons buf | 1617 | (cons buf |
| 1609 | (if (> (length name) 27) | 1618 | (if (and (integerp buffers-menu-buffer-name-length) |
| 1610 | (concat (substring name 0 12) | 1619 | (> (length name) buffers-menu-buffer-name-length)) |
| 1611 | "..." | 1620 | (concat |
| 1612 | (substring name -12)) | 1621 | (substring |
| 1613 | name))) | 1622 | name 0 (/ buffers-menu-buffer-name-length 2)) |
| 1623 | "..." | ||
| 1624 | (substring | ||
| 1625 | name (- (/ buffers-menu-buffer-name-length 2)))) | ||
| 1626 | name) | ||
| 1627 | )) | ||
| 1614 | alist)))) | 1628 | alist)))) |
| 1615 | ;; Now make the actual list of items. | 1629 | ;; Now make the actual list of items. |
| 1616 | (let ((buffers-vec (make-vector (length alist) nil)) | 1630 | (let ((buffers-vec (make-vector (length alist) nil)) |