dongbin / my_emacs

Everybody have his own emacs, why not me?

This URL has Read+Write access

my_emacs / rect-mark.el
100644 30 lines (30 sloc) 1.411 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
;;; rect-mark.el
;; ~/Emacs/Extensions/rect-mark.el
(require 'rect-mark)
;
;; Use this section in your "~/.emacs" when rect-mark isn't included
;; as an integral part of Emacs. Don't forget to remove the first
;; three columns.
;; Support for marking a rectangle of text with highlighting.
(define-key ctl-x-map "r\C-@" 'rm-set-mark)
(define-key ctl-x-map [?r ?\C-\ ] 'rm-set-mark)
(define-key ctl-x-map "r\C-x" 'rm-exchange-point-and-mark)
(define-key ctl-x-map "r\C-w" 'rm-kill-region)
(define-key ctl-x-map "r\M-w" 'rm-kill-ring-save)
(define-key global-map [S-down-mouse-1] 'rm-mouse-drag-region)
(autoload 'rm-set-mark "rect-mark"
 "Set mark for rectangle." t)
(autoload 'rm-exchange-point-and-mark "rect-mark"
 "Exchange point and mark for rectangle." t)
(autoload 'rm-kill-region "rect-mark"
 "Kill a rectangular region and save it in the kill ring." t)
(autoload 'rm-kill-ring-save "rect-mark"
 "Copy a rectangular region to the kill ring." t)
(autoload 'rm-mouse-drag-region "rect-mark"
 "Drag out a rectangular region with the mouse." t)
;; Use this section in your "~/.emacs" to modify picture mode so that
;; it automatically uses the rect-mark equivalents of many commands.
;; One vision of a better picture mode.
(add-hook 'picture-mode-hook 'rm-example-picture-mode-bindings)
(autoload 'rm-example-picture-mode-bindings "rect-mark"
 "Example rect-mark key and mouse bindings for picture mode.")