Mercurial > emacs
comparison lisp/menu-bar.el @ 10590:9f68d8d6357b
(menu-bar-update-yank-menu): If string is too long,
show start and end, with ... between them.
(yank-menu-length): Default value 20.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 30 Jan 1995 00:37:22 +0000 |
parents | 49eee3cb0ffa |
children | 3d056c5a8319 |
comparison
equal
deleted
inserted
replaced
10589:4d7bc901319a | 10590:9f68d8d6357b |
---|---|
243 (if (eq last-command 'undo) | 243 (if (eq last-command 'undo) |
244 (and (boundp 'pending-undo-list) | 244 (and (boundp 'pending-undo-list) |
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)) |
259 (string= old (car front)))) | 262 (string= old (car front)))) |
260 (progn | 263 (progn |