aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/calc/calc-yank.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/calc/calc-yank.el')
-rw-r--r--lisp/calc/calc-yank.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el
index be44a3b25d..a9a0e54b9a 100644
--- a/lisp/calc/calc-yank.el
+++ b/lisp/calc/calc-yank.el
@@ -46,6 +46,7 @@
(setq num (1- num)))
(setq num (- num n)
n (- n))))
+ (calc-check-stack num)
(let ((stuff (calc-top-list n (- num n -1))))
(calc-cursor-stack-index num)
(let ((first (point)))
@@ -82,9 +83,15 @@
(calc-force-refresh)
(calc-set-command-flag 'no-align)
(let* ((top-num (calc-locate-cursor-element top))
+ (top-pos (save-excursion
+ (calc-cursor-stack-index top-num)
+ (point)))
(bot-num (calc-locate-cursor-element (1- bot)))
+ (bot-pos (save-excursion
+ (calc-cursor-stack-index (max 0 (1- bot-num)))
+ (point)))
(num (- top-num bot-num -1)))
- (copy-region-as-kill top bot)
+ (copy-region-as-kill top-pos bot-pos)
(setq calc-last-kill (cons (car kill-ring)
(calc-top-list num bot-num)))
(if (not no-delete)