summaryrefslogtreecommitdiff
path: root/do-at-point.el
diff options
context:
space:
mode:
authorPhilip Kaludercic <philipk@posteo.net>2024-05-27 17:51:25 +0200
committerPhilip Kaludercic <philipk@posteo.net>2024-05-27 17:51:25 +0200
commit03c0313d62f0d7dd526df33c6ec23fa5b3690337 (patch)
tree7f68899531af81ccf1420738592c527e31197c4b /do-at-point.el
parent8079eaee2a797becafe468de58beddfd0cf03793 (diff)
Add a "Yank and Swap" command
Diffstat (limited to 'do-at-point.el')
-rw-r--r--do-at-point.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/do-at-point.el b/do-at-point.el
index 8f529ec..962b32e 100644
--- a/do-at-point.el
+++ b/do-at-point.el
@@ -1,6 +1,6 @@
;;; do-at-point.el --- Generic context-sensitive action dispatcher. -*- lexical-binding: t; -*-
-;; Copyright (C) 2023 Free Software Foundation, Inc.
+;; Copyright (C) 2023, 2024 Free Software Foundation, Inc.
;; Author: Philip Kaludercic <philipk@posteo.net>
;; Maintainer: Philip Kaludercic <~pkal/public-inbox@lists.sr.ht>
@@ -108,7 +108,12 @@ of this variable.")
(let ((hi-lock-auto-select-face t))
(highlight-regexp
(regexp-quote str)
- (hi-lock-read-face-name)))))))
+ (hi-lock-read-face-name))))))
+ (?y "Yank & Swap"
+ ,(lambda (start end)
+ (let ((str (delete-and-extract-region start end)))
+ (insert-for-yank (current-kill 0))
+ (kill-new str t)))))
(email
(?m "Compose message" ,(lambda (to) (compose-mail to))))
(existing-filename