[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 97c4f84: Double the default value of kill-ring-max
From: |
Stefan Kangas |
Subject: |
master 97c4f84: Double the default value of kill-ring-max |
Date: |
Wed, 13 Oct 2021 18:24:49 -0400 (EDT) |
branch: master
commit 97c4f84cbce4fef3dddebdae29df590bbb7fd516
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
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.
---
doc/emacs/custom.texi | 2 +-
doc/emacs/killing.texi | 2 +-
doc/lispintro/emacs-lisp-intro.texi | 2 +-
doc/lispref/text.texi | 2 +-
etc/NEWS | 8 ++++++++
lisp/menu-bar.el | 13 ++++++++++---
lisp/simple.el | 5 +++--
7 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index 73dfe03..eb30a6a 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -195,7 +195,7 @@ the customization buffer:
The first line shows that the variable is named
@code{kill-ring-max}, formatted as @samp{Kill Ring Max} for easier
-viewing. Its value is @samp{60}. The button labeled @samp{[Hide]},
+viewing. Its value is @samp{120}. The button labeled @samp{[Hide]},
if activated, hides the variable's value and state; this is useful to
avoid cluttering up the customization buffer with very long values
(for this reason, variables that have very long values may start out
diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi
index 6e4fd77..76fccdb 100644
--- a/doc/emacs/killing.texi
+++ b/doc/emacs/killing.texi
@@ -353,7 +353,7 @@ other ways to move text around.)
@vindex kill-ring-max
The maximum number of entries in the kill ring is controlled by the
-variable @code{kill-ring-max}. The default is 60. If you make a new
+variable @code{kill-ring-max}. The default is 120. If you make a new
kill when this limit has been reached, Emacs makes room by deleting
the oldest entry in the kill ring.
diff --git a/doc/lispintro/emacs-lisp-intro.texi
b/doc/lispintro/emacs-lisp-intro.texi
index 6ecd552..81ae253 100644
--- a/doc/lispintro/emacs-lisp-intro.texi
+++ b/doc/lispintro/emacs-lisp-intro.texi
@@ -8767,7 +8767,7 @@ keeps the kill ring from growing too long. It looks like
this:
The code checks whether the length of the kill ring is greater than
the maximum permitted length. This is the value of
-@code{kill-ring-max} (which is 60, by default). If the length of the
+@code{kill-ring-max} (which is 120, by default). If the length of the
kill ring is too long, then this code sets the last element of the
kill ring to @code{nil}. It does this by using two functions,
@code{nthcdr} and @code{setcdr}.
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 1e062be..163ac90 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -1342,7 +1342,7 @@ that @kbd{C-y} should yank.
@defopt kill-ring-max
The value of this variable is the maximum length to which the kill
ring can grow, before elements are thrown away at the end. The default
-value for @code{kill-ring-max} is 60.
+value for @code{kill-ring-max} is 120.
@end defopt
@node Undo
diff --git a/etc/NEWS b/etc/NEWS
index 9daf958..82847cf 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -78,6 +78,14 @@ the point is now moved only when releasing the mouse button.
This no
longer results in a bogus selection, unless the mouse has been
effectively dragged.
++++
+** 'kill-ring-max' now defaults to 120.
+
+---
+** New user option 'yank-menu-max-items'.
+Customize this option to limit the amount of entries in the menu
+"Edit->Paste from Kill Menu". The default is 60.
+
* Changes in Specialized Modes and Packages in Emacs 29.1
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 7c9fc1a..1c3b801 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 ()
diff --git a/lisp/simple.el b/lisp/simple.el
index 7b6c52a..c7bb928 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -5076,10 +5076,11 @@ interact nicely with `interprogram-cut-function' and
interaction; you may want to use them instead of manipulating the kill
ring directly.")
-(defcustom kill-ring-max 60
+(defcustom kill-ring-max 120
"Maximum length of kill ring before oldest elements are thrown away."
:type 'integer
- :group 'killing)
+ :group 'killing
+ :version "29.1")
(defvar kill-ring-yank-pointer nil
"The tail of the kill ring whose car is the last thing yanked.")
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 97c4f84: Double the default value of kill-ring-max,
Stefan Kangas <=