summaryrefslogtreecommitdiff
path: root/lisp/calc/calc-yank.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2014-02-02 16:40:49 -0800
committerGlenn Morris <rgm@gnu.org>2014-02-02 16:40:49 -0800
commit6a6b8e405e82dfcc506bb926f742c9fa1f5b080b (patch)
tree5469241861b6b0501fdbce2486caec0789053e2b /lisp/calc/calc-yank.el
parent5dca7759a78e8b2a50308a9d5f276799ec46c975 (diff)
downloademacs-6a6b8e405e82dfcc506bb926f742c9fa1f5b080b.tar.gz
Be more consistent in using register-read-with-preview to read registers
* frameset.el (frameset-to-register): * kmacro.el (kmacro-to-register): * register.el (increment-register): * calc/calc-yank.el (calc-copy-to-register, calc-insert-register) (calc-append-to-register, calc-prepend-to-register): * play/gametree.el (gametree-layout-to-register) (gametree-apply-register-layout): * textmodes/picture.el (picture-clear-rectangle-to-register) (picture-yank-rectangle-from-register): * vc/emerge.el (emerge-combine-versions-register): Use register-read-with-preview to read registers. * cedet/semantic/senator.el (senator-copy-tag-to-register): Use register-read-with-preview, if available. * calculator.el, emulation/viper-cmd.el: Comments.
Diffstat (limited to 'lisp/calc/calc-yank.el')
-rw-r--r--lisp/calc/calc-yank.el30
1 files changed, 22 insertions, 8 deletions
diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el
index 0f38b318432..8d182372cfb 100644
--- a/lisp/calc/calc-yank.el
+++ b/lisp/calc/calc-yank.el
@@ -163,8 +163,12 @@ text) or `nil'."
(defun calc-copy-to-register (register start end &optional delete-flag)
"Copy the lines in the region into register REGISTER.
-With prefix arg, delete as well."
- (interactive "cCopy to register: \nr\nP")
+With prefix arg, delete as well.
+
+Interactively, reads the register using `register-read-with-preview'."
+ (interactive (list (register-read-with-preview "Copy to register: ")
+ (region-beginning) (region-end)
+ current-prefix-arg))
(if (eq major-mode 'calc-mode)
(let* ((top-num (calc-locate-cursor-element start))
(top-pos (save-excursion
@@ -183,8 +187,10 @@ With prefix arg, delete as well."
(copy-to-register register start end delete-flag)))
(defun calc-insert-register (register)
- "Insert the contents of register REGISTER."
- (interactive "cInsert register: ")
+ "Insert the contents of register REGISTER.
+
+Interactively, reads the register using `register-read-with-preview'."
+ (interactive (list (register-read-with-preview "Insert register: ")))
(if (eq major-mode 'calc-mode)
(let ((val (calc-get-register register)))
(calc-wrapper
@@ -237,16 +243,24 @@ otherwise the end. If DELETE-FLAG is non-nil, also delete the region."
(defun calc-append-to-register (register start end &optional delete-flag)
"Copy the lines in the region to the end of register REGISTER.
-With prefix arg, also delete the region."
- (interactive "cAppend to register: \nr\nP")
+With prefix arg, also delete the region.
+
+Interactively, reads the register using `register-read-with-preview'."
+ (interactive (list (register-read-with-preview "Append to register: ")
+ (region-beginning) (region-end)
+ current-prefix-arg))
(if (eq major-mode 'calc-mode)
(calc-add-to-register register start end nil delete-flag)
(append-to-register register start end delete-flag)))
(defun calc-prepend-to-register (register start end &optional delete-flag)
"Copy the lines in the region to the beginning of register REGISTER.
-With prefix arg, also delete the region."
- (interactive "cPrepend to register: \nr\nP")
+With prefix arg, also delete the region.
+
+Interactively, reads the register using `register-read-with-preview'."
+ (interactive (list (register-read-with-preview "Prepend to register: ")
+ (region-beginning) (region-end)
+ current-prefix-arg))
(if (eq major-mode 'calc-mode)
(calc-add-to-register register start end t delete-flag)
(prepend-to-register register start end delete-flag)))