diff options
author | Stefan Kangas <stefan@marxist.se> | 2021-10-12 18:23:46 +0200 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2021-10-14 00:23:34 +0200 |
commit | 97c4f84cbce4fef3dddebdae29df590bbb7fd516 (patch) | |
tree | 28a6ba3e0a235e937197690aa36282793c1eb99c /lisp/menu-bar.el | |
parent | 845640538ecec167bbda8abeb98fcee70d68fd0a (diff) | |
download | emacs-97c4f84cbce4fef3dddebdae29df590bbb7fd516.tar.gz |
Double the default value of kill-ring-max
* lisp/simple.el (kill-ring-max): Double the default to 120.
* lisp/menu-bar.el (yank-menu-length): Doc fix.
(yank-menu-max-items): New variable.
(menu-bar-update-yank-menu): Don't display more than
'yank-menu-max-items' in the yank menu.
* doc/emacs/custom.texi (Changing a Variable):
* doc/emacs/killing.texi (Kill Ring):
* doc/lispintro/emacs-lisp-intro.texi (kill-new function):
* doc/lispref/text.texi (Internals of Kill Ring): Doc fix to use
the new value.
Diffstat (limited to 'lisp/menu-bar.el')
-rw-r--r-- | lisp/menu-bar.el | 13 |
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 () |