emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r116247: Be more consistent in using register-read-w


From: Glenn Morris
Subject: [Emacs-diffs] trunk r116247: Be more consistent in using register-read-with-preview to read registers
Date: Mon, 03 Feb 2014 00:40:59 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116247
revision-id: address@hidden
parent: address@hidden
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Sun 2014-02-02 16:40:49 -0800
message:
  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.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/calc/calc-yank.el         
calcyank.el-20091113204419-o5vbwnq5f7feedwu-2305
  lisp/calculator.el             
calculator.el-20091113204419-o5vbwnq5f7feedwu-1770
  lisp/cedet/ChangeLog           changelog-20100919015713-3rbr456yray5m84f-1
  lisp/cedet/semantic/senator.el 
senator.el-20091113204419-o5vbwnq5f7feedwu-11292
  lisp/emulation/viper-cmd.el    
vipercmd.el-20091113204419-o5vbwnq5f7feedwu-1184
  lisp/frameset.el               frameset.el-20130802043218-tfwraxv1c2zlibpw-1
  lisp/kmacro.el                 kmacro.el-20091113204419-o5vbwnq5f7feedwu-2431
  lisp/play/gametree.el          
gametree.el-20091113204419-o5vbwnq5f7feedwu-1259
  lisp/register.el               register.el-20091113204419-o5vbwnq5f7feedwu-104
  lisp/textmodes/picture.el      picture.el-20091113204419-o5vbwnq5f7feedwu-213
  lisp/vc/emerge.el              emerge.el-20091113204419-o5vbwnq5f7feedwu-464
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-02-03 00:28:57 +0000
+++ b/lisp/ChangeLog    2014-02-03 00:40:49 +0000
@@ -1,3 +1,17 @@
+2014-02-03  Glenn Morris  <address@hidden>
+
+       * 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.
+
 2014-02-03  João Távora  <address@hidden>
 
        * elec-pair.el (electric-pair-backward-delete-char): Don't error

=== modified file 'lisp/calc/calc-yank.el'
--- a/lisp/calc/calc-yank.el    2014-01-06 06:25:30 +0000
+++ b/lisp/calc/calc-yank.el    2014-02-03 00:40:49 +0000
@@ -163,8 +163,12 @@
 
 (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 @@
     (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 @@
 
 (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)))

=== modified file 'lisp/calculator.el'
--- a/lisp/calculator.el        2014-01-01 07:43:34 +0000
+++ b/lisp/calculator.el        2014-02-03 00:40:49 +0000
@@ -1618,6 +1618,8 @@
              (setq s (match-string 1 s)))
            (kill-new s)))))
 
+;; FIXME this should use register-read-with-preview, but it
+;; uses calculator-registers rather than register-alist.
 (defun calculator-set-register (reg)
   "Set a register value for REG."
   (interactive "cRegister to store into: ")
@@ -1660,6 +1662,8 @@
                             (or (match-string 3 str) ""))))
      (ignore-errors (calculator-string-to-number str)))))
 
+;; FIXME this should use register-read-with-preview, but it
+;; uses calculator-registers rather than register-alist.
 (defun calculator-get-register (reg)
   "Get a value from a register REG."
   (interactive "cRegister to get value from: ")

=== modified file 'lisp/cedet/ChangeLog'
--- a/lisp/cedet/ChangeLog      2014-01-15 03:06:07 +0000
+++ b/lisp/cedet/ChangeLog      2014-02-03 00:40:49 +0000
@@ -1,3 +1,8 @@
+2014-02-03  Glenn Morris  <address@hidden>
+
+       * semantic/senator.el (senator-copy-tag-to-register):
+       Use register-read-with-preview, if available.
+
 2014-01-13  Eric Ludlam  <address@hidden>
 
        * semantic/analyze/refs.el (semantic-analyze-refs-impl): Fix typo

=== modified file 'lisp/cedet/semantic/senator.el'
--- a/lisp/cedet/semantic/senator.el    2014-01-01 07:43:34 +0000
+++ b/lisp/cedet/semantic/senator.el    2014-02-03 00:40:49 +0000
@@ -722,8 +722,14 @@
 (defun senator-copy-tag-to-register (register &optional kill-flag)
   "Copy the current tag into REGISTER.
 Optional argument KILL-FLAG will delete the text of the tag to the
-kill ring."
-  (interactive "cTag to register: \nP")
+kill ring.
+
+Interactively, reads the register using `register-read-with-preview',
+if available."
+  (interactive (list (if (fboundp 'register-read-with-preview)
+                        (register-read-with-preview "Tag to register: ")
+                      (read-char "Tag to register: "))
+                    current-prefix-arg))
   (semantic-fetch-tags)
   (let ((ft (semantic-obtain-foreign-tag)))
     (when ft

=== modified file 'lisp/emulation/viper-cmd.el'
--- a/lisp/emulation/viper-cmd.el       2014-01-08 19:16:10 +0000
+++ b/lisp/emulation/viper-cmd.el       2014-02-03 00:40:49 +0000
@@ -4831,6 +4831,7 @@
   (beep 1))
 
 
+;; FIXME Use register-read-with-preview?
 ;; if ENFORCE-BUFFER is not nil, error if CHAR is a marker in another buffer
 (defun viper-register-to-point (char &optional enforce-buffer)
   "Like `jump-to-register', but switches to another buffer in another window."

=== modified file 'lisp/frameset.el'
--- a/lisp/frameset.el  2014-01-01 07:43:34 +0000
+++ b/lisp/frameset.el  2014-02-03 00:40:49 +0000
@@ -1223,8 +1223,11 @@
 (defun frameset-to-register (register &optional _arg)
   "Store the current frameset in register REGISTER.
 Use \\[jump-to-register] to restore the frameset.
-Argument is a character, naming the register."
-  (interactive "cFrameset to register: \nP")
+Argument is a character, naming the register.
+
+Interactively, reads the register using `register-read-with-preview'."
+  (interactive (list (register-read-with-preview "Frameset to register: ")
+                    current-prefix-arg))
   (set-register register
                (registerv-make
                 (vector (frameset-save nil

=== modified file 'lisp/kmacro.el'
--- a/lisp/kmacro.el    2014-01-01 07:43:34 +0000
+++ b/lisp/kmacro.el    2014-02-03 00:40:49 +0000
@@ -845,11 +845,13 @@
   (kmacro-call-macro current-prefix-arg nil nil k))
 
 (defun kmacro-to-register (r)
-  "Store the last keyboard macro in register R."
+  "Store the last keyboard macro in register R.
+
+Interactively, reads the register using `register-read-with-preview'."
   (interactive
    (progn
      (or last-kbd-macro (error "No keyboard macro defined"))
-     (list (read-char "Save to register: "))))
+     (list (register-read-with-preview "Save to register: "))))
   (set-register r (registerv-make
                   last-kbd-macro
                   :jump-func 'kmacro-execute-from-register

=== modified file 'lisp/play/gametree.el'
--- a/lisp/play/gametree.el     2014-01-16 06:24:06 +0000
+++ b/lisp/play/gametree.el     2014-02-03 00:40:49 +0000
@@ -531,8 +531,10 @@
 (defun gametree-layout-to-register (register)
   "Store current tree layout in register REGISTER.
 Use \\[gametree-apply-register-layout] to restore that configuration.
-Argument is a character, naming the register."
-  (interactive "cLayout to register: ")
+Argument is a character, naming the register.
+
+Interactively, reads the register using `register-read-with-preview'."
+  (interactive (list (register-read-with-preview "Layout to register: ")))
   (save-excursion
     (goto-char (point-min))
     (set-register register
@@ -540,8 +542,13 @@
 
 (defun gametree-apply-register-layout (char)
   "Return to a tree layout stored in a register.
-Argument is a character, naming the register."
-  (interactive "*cApply layout from register: ")
+Argument is a character, naming the register.
+
+Interactively, reads the register using `register-read-with-preview'."
+  (interactive
+   (progn
+     (barf-if-buffer-read-only)
+     (list (register-read-with-preview "Apply layout from register: "))))
   (save-excursion
     (goto-char (point-min))
     (gametree-apply-layout (get-register char) 0 t)))

=== modified file 'lisp/register.el'
--- a/lisp/register.el  2014-02-02 03:42:20 +0000
+++ b/lisp/register.el  2014-02-03 00:40:49 +0000
@@ -296,8 +296,11 @@
 PREFIX to it.
 
 If REGISTER is empty or if it contains text, call
-`append-to-register' with `delete-flag' set to PREFIX."
-  (interactive "P\ncIncrement register: ")
+`append-to-register' with `delete-flag' set to PREFIX.
+
+Interactively, reads the register using `register-read-with-preview'."
+  (interactive (list current-prefix-arg
+                    (register-read-with-preview "Increment register: ")))
   (let ((register-val (get-register register)))
     (cond
      ((numberp register-val)

=== modified file 'lisp/textmodes/picture.el'
--- a/lisp/textmodes/picture.el 2014-01-01 07:43:34 +0000
+++ b/lisp/textmodes/picture.el 2014-02-03 00:40:49 +0000
@@ -494,8 +494,12 @@
 (defun picture-clear-rectangle-to-register (start end register &optional killp)
   "Clear rectangle delineated by point and mark into REGISTER.
 The rectangle is saved in REGISTER and replaced with whitespace.  With
-prefix argument, the rectangle is actually killed, shifting remaining text."
-  (interactive "r\ncRectangle to register: \nP")
+prefix argument, the rectangle is actually killed, shifting remaining text.
+
+Interactively, reads the register using `register-read-with-preview'."
+  (interactive (list (region-beginning) (region-end)
+                    (register-read-with-preview "Rectangle to register: ")
+                    current-prefix-arg))
   (set-register register (picture-snarf-rectangle start end killp)))
 
 (defun picture-snarf-rectangle (start end &optional killp)
@@ -534,8 +538,11 @@
 The rectangle is positioned with upper left corner at point, overwriting
 existing text.  With prefix argument, the rectangle is
 inserted instead, shifting existing text.  Leaves mark at one corner
-of rectangle and point at the other (diagonally opposed) corner."
-  (interactive "cRectangle from register: \nP")
+of rectangle and point at the other (diagonally opposed) corner.
+
+Interactively, reads the register using `register-read-with-preview'."
+  (interactive (list (register-read-with-preview "Rectangle from register: ")
+                    current-prefix-arg))
   (let ((rectangle (get-register register)))
     (if (not (consp rectangle))
        (error "Register %c does not contain a rectangle" register)

=== modified file 'lisp/vc/emerge.el'
--- a/lisp/vc/emerge.el 2013-09-05 03:30:07 +0000
+++ b/lisp/vc/emerge.el 2014-02-03 00:40:49 +0000
@@ -2516,8 +2516,12 @@
 Refuses to function if this difference has been edited, i.e., if it is
 neither the A nor the B variant.
 An argument forces the variant to be selected even if the difference has
-been edited."
-  (interactive "cRegister containing template: \nP")
+been edited.
+
+Interactively, reads the register using `register-read-with-preview'."
+  (interactive (list
+               (register-read-with-preview "Register containing template: ")
+               current-prefix-arg))
   (let ((template (get-register char)))
     (if (not (stringp template))
        (error "Register does not contain text"))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]