Created
January 29, 2014 01:30
-
-
Save igaiga/8680014 to your computer and use it in GitHub Desktop.
This file contains 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 move-forward-char (char) | |
(interactive "cMove to Char: ") | |
(if (eq (char-after (point)) char) (forward-char)) | |
(and (search-forward (char-to-string char) nil t) | |
(backward-char))) | |
(defun move-forward-char-repeatable () | |
(interactive) | |
(if (eq last-command this-command) | |
(command-execute 'previous-command) | |
(command-execute 'move-forward-char))) | |
;; 逆方向 | |
(defun move-backward-char (char) | |
(interactive "cMove backward to Char: ") | |
(search-backward (char-to-string char) nil t)) | |
(defun move-backward-char-repeatable () | |
(interactive) | |
(if (eq last-command this-command) | |
(command-execute 'previous-command) | |
(command-execute 'move-backward-char))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment