summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/km-avy.el17
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