Permalink
Browse files

Add basic expansion: er/mark-defun

Avoids the superflous whitespace in the built-in mark-defun.
Thanks to @snosov1

Fixes #97
  • Loading branch information...
1 parent cf719ed commit bc707cc7687a3be3978efbc0a05eab6170b53f12 @magnars committed Apr 27, 2013
Showing with 12 additions and 1 deletion.
  1. +1 −0 README.md
  2. +11 −1 er-basic-expansions.el
View
@@ -40,6 +40,7 @@ nature of the basic expansions:
er/mark-comment
er/mark-url
er/mark-email
+ er/mark-defun
However, most languages also will benefit from some specially crafted
expansions. For instance, expand-region comes with these extra expansions for
View
@@ -217,6 +217,15 @@ period and marks next symbol."
(set-mark (point))
(beginning-of-thing 'email))
+(defun er/mark-defun ()
+ "Mark defun around or in front of point."
+ (interactive)
+ (end-of-defun)
+ (skip-chars-backward er--space-str)
+ (set-mark (point))
+ (beginning-of-defun)
+ (skip-chars-forward er--space-str))
+
;; Methods to try expanding to
(setq er/try-expand-list
(append '(er/mark-word
@@ -230,7 +239,8 @@ period and marks next symbol."
er/mark-outside-pairs
er/mark-comment
er/mark-url
- er/mark-email)
+ er/mark-email
+ er/mark-defun)
er/try-expand-list))
(provide 'er-basic-expansions)

0 comments on commit bc707cc

Please sign in to comment.