From: Richard M. Stallman Date: Mon, 30 Jan 1995 00:37:22 +0000 (+0000) Subject: (menu-bar-update-yank-menu): If string is too long, X-Git-Tag: emacs-19.34~5268 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c3e1d4359ed586fa30ba45e8b9bc8f3a230f130b;p=emacs.git (menu-bar-update-yank-menu): If string is too long, show start and end, with ... between them. (yank-menu-length): Default value 20. --- 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." pending-undo-list) buffer-undo-list))) -(defvar yank-menu-length 100 +(defvar yank-menu-length 20 "*Maximum length to display in the yank-menu.") (defun menu-bar-update-yank-menu (string old) (let ((front (car (cdr yank-menu))) (menu-string (if (<= (length string) yank-menu-length) string - (substring string 0 yank-menu-length)))) + (concat + (substring string 0 (/ yank-menu-length 2)) + "..." + (substring string (- (/ yank-menu-length 2))))))) ;; If we're supposed to be extending an existing string, and that ;; string really is at the front of the menu, then update it in place. (if (and old (or (eq old (car front))