Created
June 5, 2012 06:30
-
-
Save jewel12/2873112 to your computer and use it in GitHub Desktop.
move-to-next-blank-line
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 blank-line? () | |
(string-match "^\n$" (substring-no-properties (thing-at-point 'line)))) | |
(defun move-to-next-blank-line () | |
(interactive) | |
(progn (forward-line 1) | |
(if (blank-line?) () (move-to-next-blank-line)))) | |
(defun move-to-previous-blank-line () | |
(interactive) | |
(progn (forward-line -1) | |
(if (blank-line?) () (move-to-previous-blank-line)))) | |
(global-set-key "\M-n" 'move-to-next-blank-line) | |
(global-set-key "\M-p" 'move-to-previous-blank-line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
forward/backward-paragraphでも、似た動きなんですが、こっちだとパラグラフ判定がたぶんシンタックステーブルに依存しているっぽくて、単純に空行に行って欲しいのに! に応えてくれなかったのが、助かりました。