Created
November 18, 2012 21:18
-
-
Save takehiko/4107554 to your computer and use it in GitHub Desktop.
Extensions to match-paren
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 対応するカッコにジャンプ | |
(defun match-paren-japanese (arg) | |
"Go to the matching parenthesis." | |
(interactive "p") | |
(cond ((looking-at "[([{({[「『《〔【〈]") (forward-sexp 1) (backward-char)) | |
((looking-at "[])}){]」』》〕】〉]") (forward-char) (backward-sexp 1)) | |
(t (message "match-paren-japanese ignored")))) | |
(global-set-key [f5] 'match-paren-japanese) | |
;; 対応するカッコまでをコピー | |
(defun match-paren-kill-ring-save () | |
"Copy region from here to the matching parenthesis to kill ring and save." | |
(interactive) | |
(set-mark-command nil) | |
(match-paren-japanese nil) | |
(forward-char) | |
(exchange-point-and-mark) | |
(clipboard-kill-ring-save (mark) (point)) | |
(let ((c (abs (- (mark) (point))))) | |
(message "match-paren-kill-ring-save: %d characters saved" c))) | |
(global-set-key [C-f5] 'match-paren-kill-ring-save) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment