[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/speedrect 6363a7ba6d 47/90: yank-rectangle-dwim: exchan
From: |
ELPA Syncer |
Subject: |
[elpa] externals/speedrect 6363a7ba6d 47/90: yank-rectangle-dwim: exchange point and mark before yank if needed |
Date: |
Fri, 6 Dec 2024 18:59:13 -0500 (EST) |
branch: externals/speedrect
commit 6363a7ba6d47b6f93f33477ab20f74c69397ab36
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: JD Smith <93749+jdtsmith@users.noreply.github.com>
yank-rectangle-dwim: exchange point and mark before yank if needed
---
speedrect.el | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/speedrect.el b/speedrect.el
index a6cf25b914..046b33a133 100644
--- a/speedrect.el
+++ b/speedrect.el
@@ -135,6 +135,12 @@ Note that point and mark will not move beyond the end of
text on their lines."
(interactive "P")
(speedrect-shift-down (- (or lines 5))))
+(defun speedrect-yank-rectangle-dwim ()
+ "Yank rectangle, but first swap mark and point if needed."
+ (interactive)
+ (if (< (mark) (point)) (exchange-point-and-mark))
+ (call-interactively #'yank-rectangle))
+
(defun speedrect-delete-rest (start end)
"Keep rectangle between START and END, deleting the rest of the affected
lines."
(interactive "r")
@@ -274,7 +280,7 @@ prior to deactivating mark."
'(;; Rectangle basics
("k" kill-rectangle after) ("t" string-rectangle after)
("o" open-rectangle t) ("w" copy-rectangle-as-kill t)
- ("y" yank-rectangle t) ("c" clear-rectangle t)
+ ("y" speedrect-yank-rectangle-dwim t) ("c" clear-rectangle t)
("d" delete-rectangle after) ("N" rectangle-number-lines t)
("r" speedrect-delete-rest t) ("SPC" delete-whitespace-rectangle t)
;; Shift rect
@@ -288,7 +294,7 @@ prior to deactivating mark."
("M-S-<down>" speedrect-shift-down-fast)
;; Calc commands
("_" calc-grab-sum-across) (":" calc-grab-sum-down) ("#"
calc-grab-rectangle)
- ("m" speedrect-yank-from-calc t)
+ ("m" speedrect-yank-from-calc after)
;; Special
("n" speedrect-restart) ("l" speedrect-recall-last)
("?" speedrect-transient-map-info) ("q" speedrect-quit))
- [elpa] externals/speedrect 3120746026 56/90: Update README.md, (continued)
- [elpa] externals/speedrect 3120746026 56/90: Update README.md, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect e37d89acc6 63/90: wrap-command: ensure buffer is restored on re-running command, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect 94c125f60f 68/90: fill-text: use height of rect as line count limit, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect 5da3d70805 74/90: delete-rest: save rectangle after command, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect 16e79924ed 82/90: Prepare for ELPA, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect 2782b03be2 38/90: Update README.md, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect 7390122e49 75/90: calc-grab: improve with calc-top, avoid brackets/truncation, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect 4b79f0109d 88/90: README: document new `speedrect-mode' config, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect 43a89af9f7 52/90: allow rectangle-mark-mode-hook to operate on continue, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect c47e5e4e7b 43/90: move commands: use rectangle-right/next-line, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect 6363a7ba6d 47/90: yank-rectangle-dwim: exchange point and mark before yank if needed,
ELPA Syncer <=
- [elpa] externals/speedrect 9be7569c70 70/90: shift-right: use rectangle point-mark exchange for line ends, ELPA Syncer, 2024/12/06