* lisp/calc/calc.el (calc-kill-line-numbering): New defcustom.
* lisp/calc/calc-yank.el (calc-kill): Unless calc-kill-line-numbering
is non-nil, do not include line numbering in copied text (bug#55133).
* etc/NEWS:
* doc/misc/calc.texi (Killing from the Stack): Document the change.
@kbd{C-k} with a prefix argument of 1 copies the number with its trailing
newline.
+You can customize @code{calc-kill-line-numbering} to nil to exclude
+line numbering from kills and copies made by @code{calc-kill} and
+@code{calc-copy-as-kill}. This option does not affect calc kill and
+copy commands which operate on the region, as that would not make
+sense.
+
@node Yanking Into Stack
@section Yanking into the Stack
commands are Lisp function or external when supplying absolute file
name arguments. See "Electric forward slash" in the Eshell manual.
+** Calc
+
++++
+*** New user option 'calc-kill-line-numbering'.
+This can be set to nil to exclude line numbering from kills and copies.
+
** Miscellaneous
+++
(calc-check-stack num)
(let ((stuff (calc-top-list n (- num n -1))))
(calc-cursor-stack-index num)
+ (unless calc-kill-line-numbering
+ (re-search-forward "\\=[0-9]+:\\s-+" (point-at-eol) t))
(let ((first (point)))
(calc-cursor-stack-index (- num n))
(if (null nn)
:version "24.1"
:type 'string)
+(defcustom calc-kill-line-numbering t
+ "If non-nil, calculator kills include any line numbering.
+
+This option does not affect calc kill and copy commands which
+operate on the region, such as `calc-copy-region-as-kill'."
+ :version "29.1"
+ :type 'boolean)
+
(defvar math-format-date-cache) ; calc-forms.el
(defface calc-nonselected-face