summaryrefslogtreecommitdiff
path: root/lisp/calc/calc.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/calc/calc.el')
-rw-r--r--lisp/calc/calc.el12
1 files changed, 3 insertions, 9 deletions
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index 254c703ee22..6c21430b1b3 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -1959,12 +1959,8 @@ See calc-keypad for details."
(or n (setq n 1))
(or m (setq m 1))
(calc-check-stack (+ n m -1))
- (and (> n 0)
- (let ((top (copy-sequence (nthcdr (+ m calc-stack-top -1)
- calc-stack))))
- (setcdr (nthcdr (1- n) top) nil)
- (nreverse
- (mapcar (lambda (x) (calc-get-stack-element x sel-mode)) top)))))
+ (nreverse (mapcar (lambda (x) (calc-get-stack-element x sel-mode))
+ (take n (nthcdr (+ m calc-stack-top -1) calc-stack)))))
(defun calc-top-list-n (&optional n m sel-mode)
(mapcar #'math-check-complete
@@ -2291,9 +2287,7 @@ the United States."
((and (null n)
(eq (car-safe top) 'incomplete)
(> (length top) (if (eq (nth 1 top) 'intv) 3 2)))
- (calc-pop-push-list 1 (let ((tt (copy-sequence top)))
- (setcdr (nthcdr (- (length tt) 2) tt) nil)
- (list tt))))
+ (calc-pop-push-list 1 (list (butlast top))))
((< nn 0)
(if (and calc-any-selections
(calc-top-selected 1 (- nn)))