diff options
author | Kyle Meyer <kyle@kyleam.com> | 2017-07-23 14:08:48 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2017-07-23 14:08:48 -0400 |
commit | bfd015badf58b7bb235652c9bf9544cbb9a1bb05 (patch) | |
tree | 3d8976b093eb5714e97a249b6f66938483c70d21 /lisp | |
parent | ce44fdc8222ccc1adc7a94ac33e93d478bc3754f (diff) | |
download | emacs.d-bfd015badf58b7bb235652c9bf9544cbb9a1bb05.tar.gz |
Add copy line action to avy-dispatch-alist
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/km-avy.el | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lisp/km-avy.el b/lisp/km-avy.el index e0be1d7..c17f1f0 100644 --- a/lisp/km-avy.el +++ b/lisp/km-avy.el @@ -86,5 +86,22 @@ (notmuch-tree-mode (call-interactively #'notmuch-tree-show-message))))) +;;;###autoload +(defun km/avy-action-copy-line (pt) + "Copy line containing PT." + ;; Modified from `avy-action-copy'. + (save-excursion + (let (str) + (goto-char pt) + (setq str (buffer-substring (line-beginning-position) + (line-end-position))) + (kill-new str) + (message "Copied: %s" str))) + (let ((dat (ring-ref avy-ring 0))) + (select-frame-set-input-focus + (window-frame (cdr dat))) + (select-window (cdr dat)) + (goto-char (car dat)))) + (provide 'km-avy) ;;; km-avy.el ends here |