From 87bd269a9472f62a7e3a41d5642fc213a790c065 Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Sun, 18 May 2008 05:10:51 +0000 Subject: [PATCH] (calc-kill): Make sure that only the stack is operated on. (calc-kill-region): Kill entire lines. --- lisp/ChangeLog | 6 ++++++ lisp/calc/calc-yank.el | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9f4d24bd100..40189330206 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2008-05-18 Jay Belanger + + * calc/calc-yank.el (calc-kill): Make sure that only the stack is + operated on. + (calc-kill-region): Kill entire lines. + 2008-05-17 Glenn Morris * ezimage.el (ezimage-use-images): Drop support for Emacs < 21 and diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el index be44a3b25d4..a9a0e54b9a8 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) -- 2.39.2