summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/init-editing.el22
1 files changed, 11 insertions, 11 deletions
diff --git a/lisp/init-editing.el b/lisp/init-editing.el
index f0a8277..69ae087 100644
--- a/lisp/init-editing.el
+++ b/lisp/init-editing.el
@@ -218,17 +218,17 @@ and '<<<' mark the bounds of the narrowed region.
(interactive)
(delete-indentation 1))
-(defmacro km/make-kill-thing-at-point (name thing kill-func)
- `(defun ,(intern (concat "km/kill-" name "-at-point")) (arg)
- (interactive "p")
- (goto-char (beginning-of-thing ,thing))
- (funcall ,kill-func arg)))
-
-(km/make-kill-thing-at-point "word" 'word 'kill-word)
-(km/make-kill-thing-at-point "sentence" 'sentence 'kill-sentence)
-(km/make-kill-thing-at-point "paragraph" 'paragraph 'kill-paragraph)
-(km/make-kill-thing-at-point "line" 'line 'kill-line)
-(km/make-kill-thing-at-point "sexp" 'sexp 'kill-sexp)
+(defmacro km/make-kill-thing-at-point (thing)
+ `(defun ,(intern (concat "km/kill-" thing "-at-point")) ()
+ ,(format "Kill %s at point." thing)
+ (interactive)
+ (goto-char (beginning-of-thing (make-symbol ,thing)))
+ (,(intern (concat "kill-" thing)) 1)))
+
+(km/make-kill-thing-at-point "line")
+(km/make-kill-thing-at-point "paragraph")
+(km/make-kill-thing-at-point "sentence")
+(km/make-kill-thing-at-point "word")
(define-prefix-command 'km/kill-map)
(global-set-key (kbd "C-c k") 'km/kill-map)