diff options
| author | Richard M. Stallman | 1995-01-30 00:37:22 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-01-30 00:37:22 +0000 |
| commit | c3e1d4359ed586fa30ba45e8b9bc8f3a230f130b (patch) | |
| tree | e6df99b2ab50645d0c3d404860799a9134c2e756 | |
| parent | 3b787dc3332b381eef7a1918396d826f0b92878f (diff) | |
| download | emacs-c3e1d4359ed586fa30ba45e8b9bc8f3a230f130b.tar.gz emacs-c3e1d4359ed586fa30ba45e8b9bc8f3a230f130b.zip | |
(menu-bar-update-yank-menu): If string is too long,
show start and end, with ... between them.
(yank-menu-length): Default value 20.
| -rw-r--r-- | lisp/menu-bar.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 7574d74390c..5babb7b19e4 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el | |||
| @@ -245,14 +245,17 @@ Do the same for the keys of the same name." | |||
| 245 | pending-undo-list) | 245 | pending-undo-list) |
| 246 | buffer-undo-list))) | 246 | buffer-undo-list))) |
| 247 | 247 | ||
| 248 | (defvar yank-menu-length 100 | 248 | (defvar yank-menu-length 20 |
| 249 | "*Maximum length to display in the yank-menu.") | 249 | "*Maximum length to display in the yank-menu.") |
| 250 | 250 | ||
| 251 | (defun menu-bar-update-yank-menu (string old) | 251 | (defun menu-bar-update-yank-menu (string old) |
| 252 | (let ((front (car (cdr yank-menu))) | 252 | (let ((front (car (cdr yank-menu))) |
| 253 | (menu-string (if (<= (length string) yank-menu-length) | 253 | (menu-string (if (<= (length string) yank-menu-length) |
| 254 | string | 254 | string |
| 255 | (substring string 0 yank-menu-length)))) | 255 | (concat |
| 256 | (substring string 0 (/ yank-menu-length 2)) | ||
| 257 | "..." | ||
| 258 | (substring string (- (/ yank-menu-length 2))))))) | ||
| 256 | ;; If we're supposed to be extending an existing string, and that | 259 | ;; If we're supposed to be extending an existing string, and that |
| 257 | ;; string really is at the front of the menu, then update it in place. | 260 | ;; string really is at the front of the menu, then update it in place. |
| 258 | (if (and old (or (eq old (car front)) | 261 | (if (and old (or (eq old (car front)) |