summaryrefslogtreecommitdiff
path: root/lisp/menu-bar.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/menu-bar.el')
-rw-r--r--lisp/menu-bar.el13
1 files changed, 10 insertions, 3 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 7c9fc1aeba0..1c3b8014e96 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -2169,10 +2169,16 @@ otherwise it could decide to silently do nothing."
(> count 1)))
(defcustom yank-menu-length 20
- "Maximum length to display in the `yank-menu'."
+ "Items in `yank-menu' longer than this will be truncated."
:type 'integer
:group 'menu)
+(defcustom yank-menu-max-items 60
+ "Maximum number of entries to display in the `yank-menu'."
+ :type 'integer
+ :group 'menu
+ :version "29.1")
+
(defun menu-bar-update-yank-menu (string old)
(let ((front (car (cdr yank-menu)))
(menu-string (if (<= (length string) yank-menu-length)
@@ -2196,8 +2202,9 @@ otherwise it could decide to silently do nothing."
(cons
(cons string (cons menu-string 'menu-bar-select-yank))
(cdr yank-menu)))))
- (if (> (length (cdr yank-menu)) kill-ring-max)
- (setcdr (nthcdr kill-ring-max yank-menu) nil)))
+ (let ((max-items (min yank-menu-max-items kill-ring-max)))
+ (if (> (length (cdr yank-menu)) max-items)
+ (setcdr (nthcdr max-items yank-menu) nil))))
(put 'menu-bar-select-yank 'apropos-inhibit t)
(defun menu-bar-select-yank ()