Commit be755c79 authored by Reuben Thomas's avatar Reuben Thomas Committed by Chong Yidong
Browse files

* rect.el (copy-rectangle-as-kill): New command.

* lisp/rect.el, lisp/register.el: Move bindings to bindings.el.

* lisp/bindings.el: Consolidate ctl-x-r-map bindings.  Bind
copy-rectangle-as-kill to C-x r w.

Fixes: debbugs:739
parent ed9265fc
......@@ -158,6 +158,9 @@ character when doing minibuffer filename prompts.
** `goto-char' is now bound to `M-g c'.
** New command `C-x r M-w' (copy-rectangle-as-kill).
It copies the region-rectangle as the last rectangle kill.
** New input method `vietnamese-vni'.
......
2012-07-14 Chong Yidong <cyd@gnu.org>
* bindings.el: Consolidate ctl-x-r-map bindings. Bind
copy-rectangle-as-kill to C-x r w.
* rect.el, register.el: Move bindings to bindings.el.
2012-07-14 Reuben Thomas <rrt@sc3d.org>
* rect.el (copy-rectangle-as-kill): New command (Bug#739).
2012-07-13 Andreas Schwab <schwab@linux-m68k.org>
 
* emacs-lisp/cl.el (labels): Remove spurious quote. (Bug#11938)
......
......@@ -1183,7 +1183,30 @@ if `inhibit-field-text-motion' is non-nil."
(define-key ctl-x-5-map "m" 'compose-mail-other-frame)
(defvar ctl-x-r-map (make-sparse-keymap)
(defvar ctl-x-r-map
(let ((map (make-sparse-keymap)))
(define-key map "c" 'clear-rectangle)
(define-key map "k" 'kill-rectangle)
(define-key map "d" 'delete-rectangle)
(define-key map "y" 'yank-rectangle)
(define-key map "o" 'open-rectangle)
(define-key map "t" 'string-rectangle)
(define-key map "N" 'rectangle-number-lines)
(define-key map "\M-w" 'copy-rectangle-as-kill)
(define-key map "\C-@" 'point-to-register)
(define-key map [?\C-\ ] 'point-to-register)
(define-key map " " 'point-to-register)
(define-key map "j" 'jump-to-register)
(define-key map "s" 'copy-to-register)
(define-key map "x" 'copy-to-register)
(define-key map "i" 'insert-register)
(define-key map "g" 'insert-register)
(define-key map "r" 'copy-rectangle-to-register)
(define-key map "n" 'number-to-register)
(define-key map "+" 'increment-register)
(define-key map "w" 'window-configuration-to-register)
(define-key map "f" 'frame-configuration-to-register)
map)
"Keymap for subcommands of C-x r.")
(define-key ctl-x-map "r" ctl-x-r-map)
......
......@@ -29,16 +29,6 @@
;; ### NOTE: this file was almost completely rewritten by Didier Verna
;; <didier@xemacs.org> in July 1999.
;;; Global key bindings
;;;###autoload (define-key ctl-x-r-map "c" 'clear-rectangle)
;;;###autoload (define-key ctl-x-r-map "k" 'kill-rectangle)
;;;###autoload (define-key ctl-x-r-map "d" 'delete-rectangle)
;;;###autoload (define-key ctl-x-r-map "y" 'yank-rectangle)
;;;###autoload (define-key ctl-x-r-map "o" 'open-rectangle)
;;;###autoload (define-key ctl-x-r-map "t" 'string-rectangle)
;;;###autoload (define-key ctl-x-r-map "N" 'rectangle-number-lines)
;;; Code:
;; FIXME: this function should be replaced by `apply-on-rectangle'
......@@ -235,6 +225,13 @@ even beep.)"
(barf-if-buffer-read-only)
(signal 'text-read-only (list (current-buffer)))))))
;;;###autoload
(defun copy-rectangle-as-kill (start end)
"Copy the region-rectangle and save it as the last killed one."
(interactive "r")
(setq killed-rectangle (extract-rectangle start end))
(setq deactivate-mark t))
;;;###autoload
(defun yank-rectangle ()
"Yank the last killed rectangle with upper left corner at point."
......
......@@ -34,22 +34,6 @@
(declare-function semantic-tag-buffer "semantic/tag" (tag))
(declare-function semantic-tag-start "semantic/tag" (tag))
;;; Global key bindings
(define-key ctl-x-r-map "\C-@" 'point-to-register)
(define-key ctl-x-r-map [?\C-\ ] 'point-to-register)
(define-key ctl-x-r-map " " 'point-to-register)
(define-key ctl-x-r-map "j" 'jump-to-register)
(define-key ctl-x-r-map "s" 'copy-to-register)
(define-key ctl-x-r-map "x" 'copy-to-register)
(define-key ctl-x-r-map "i" 'insert-register)
(define-key ctl-x-r-map "g" 'insert-register)
(define-key ctl-x-r-map "r" 'copy-rectangle-to-register)
(define-key ctl-x-r-map "n" 'number-to-register)
(define-key ctl-x-r-map "+" 'increment-register)
(define-key ctl-x-r-map "w" 'window-configuration-to-register)
(define-key ctl-x-r-map "f" 'frame-configuration-to-register)
;;; Code:
(cl-defstruct
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment