[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/speedrect b743b42208 55/90: Add x:corners and M:multipl
From: |
ELPA Syncer |
Subject: |
[elpa] externals/speedrect b743b42208 55/90: Add x:corners and M:multiple-cursors support |
Date: |
Fri, 6 Dec 2024 18:59:15 -0500 (EST) |
branch: externals/speedrect
commit b743b42208dff33298bf4a397028736d2bdf39c3
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: JD Smith <93749+jdtsmith@users.noreply.github.com>
Add x:corners and M:multiple-cursors support
---
README.md | 22 ++++++++++++++--------
speedrect.el | 34 ++++++++++++++++++++++++++--------
2 files changed, 40 insertions(+), 16 deletions(-)
diff --git a/README.md b/README.md
index 4aefc9ffe5..f395da9b26 100644
--- a/README.md
+++ b/README.md
@@ -18,6 +18,10 @@ Quick key bindings and other tools for Emacs'
`rectangle-mark-mode`.
- Two-way interaction with Calc: send sums or tables of data into calc, and
yank processed matrix data back into the rectangle from the top of calc's stack.
- A useful help page (`?`).
+## News
+
+v0.4:
+
## Installation
Just download, add to path, and arrange to `(require 'speedrect)`. For users
of `use-package`:
@@ -40,9 +44,9 @@ Start `rectangle-mark-mode` as usual (`C-x SPC`, by default).
Hit `?` to summon
## Hints
-A rectangle is just a _region_ (point and mark), specially interpreted. While
marking rectangles, you can `C-x C-x` to cycle point among any of the
rectangle's four corners. This is useful to make changes to the appropriate
side of the selected region.
+A rectangle is just a _region_ (point and mark), specially interpreted. While
marking rectangles, you can use `x` to cycle point among any of the rectangles
four corners. This is useful to make changes to the appropriate side of the
selected region.
-Use calc, it's super-powerful:
+Use calc, it's super-powerful...
### Using Calc
@@ -77,10 +81,10 @@ Killing:
[c] clear clear rectangle area by overwriting with spaces
[r] rest delete the rest of the columns, keeping the marked rectangle
-Change Rectangle:
+Copy/Yank:
- [n] new start a new rectangle from this location
- [l] last restore the last used rectangle position, if possible
+ [w] copy copy rectangle for future yanking
+ [y] yank yank rectangle, inserting at point
Shift Rectangle (can use numeric prefixes):
@@ -93,10 +97,11 @@ Shift Rectangle (can use numeric prefixes):
[M-S-up] move the rectangle up 5 columns
[M-S-down] move the rectangle down 5 lines
-Copy/Yank:
+Change Rectangle:
- [w] copy copy rectangle for future yanking
- [y] yank yank rectangle, inserting at point
+ [x] corners move point around corners of the rectangle
+ [n] new start a new rectangle from this location
+ [l] last restore the last used rectangle, if possible
Numerical:
@@ -108,6 +113,7 @@ Numerical:
Etc:
+ [M] multiple-cursors add cursors at current column
[?] help view this Help buffer
[q] quit exit rectangle-mark-mode
```
diff --git a/speedrect.el b/speedrect.el
index 15f3be9dd6..1ef5f91a3a 100644
--- a/speedrect.el
+++ b/speedrect.el
@@ -2,8 +2,8 @@
;; Copyright (C) 2023 J.D. Smith
;; Author: JD Smith
-;; Created: 2023
-;; Version: 0.3.1
+;; Created: 2023-2024
+;; Version: 0.4.0
;; Package-Requires: ((emacs "25.1") (compat "29.1.4.0"))
;; Homepage: https://github.com/jdtsmith/speedrect
;; Keywords: convenience
@@ -202,6 +202,20 @@ each side of the inserted text."
(length crect) height)))
(user-error "Calc rectangle yank not possible here")))
+(declare-function mc/edit-lines "mc-edit-lines")
+(defun speedrect-multiple-cursors ()
+ "Add multiple cursors on each line at the current column."
+ (interactive)
+ (condition-case nil
+ (require 'multiple-cursors)
+ (error (user-error "Multiple-cursors not found"))
+ (:success
+ (let ((col (current-column)))
+ (speedrect-stash)
+ (exchange-point-and-mark)
+ (move-to-column col)
+ (mc/edit-lines)))))
+
(defun speedrect-transient-map-info ()
"Documentation window for speedrect."
(interactive)
@@ -218,9 +232,9 @@ each side of the inserted text."
" [SPC] del-ws delete all whitespace, starting from left
column\n"
" [c] clear clear rectangle area by overwriting with spaces\n"
" [r] rest delete the rest of the columns, keeping the
marked rectangle\n\n"
- "Change Rectangle:\n\n"
- " [n] new start a new rectangle from this location\n"
- " [l] last restore the last used rectangle position, if
possible\n\n"
+ "Copy/Yank:\n\n"
+ " [w] copy copy rectangle for future yanking\n"
+ " [y] yank yank rectangle, inserting at point\n\n"
"Shift Rectangle (can use numeric prefixes):\n\n"
" [S-left] move the rectangle left\n"
" [S-right] move the rectangle right\n"
@@ -230,9 +244,10 @@ each side of the inserted text."
" [M-S-right] move the rectangle right 5 columns\n"
" [M-S-up] move the rectangle up 5 columns\n"
" [M-S-down] move the rectangle down 5 lines\n\n"
- "Copy/Yank:\n\n"
- " [w] copy copy rectangle for future yanking\n"
- " [y] yank yank rectangle, inserting at point\n\n"
+ "Change Rectangle:\n\n"
+ " [x] corners move point around corners of the rectangle\n"
+ " [n] new start a new rectangle from this location\n"
+ " [l] last restore the last used rectangle, if possible\n\n"
"Numerical:\n\n"
" [N] numbers fill the rectangle with numbers (prefix to set
start)\n"
" [#] grab grab the rectangle as a matrix in calc\n"
@@ -240,6 +255,7 @@ each side of the inserted text."
" [:] down sum down the columns and grab result in calc\n"
" [m] yank-mat yank matrix from top of calc stack, overwriting
selected rect\n\n"
"Etc:\n\n"
+ " [M] multiple-cursors add cursors at current column\n"
" [?] help view this Help buffer\n"
" [q] quit exit rectangle-mark-mode"))
(princ l))))
@@ -281,6 +297,7 @@ prior to deactivating mark."
("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)
+ ("x" rectangle-exchange-point-and-mark)
;; Shift rect
("S-<right>" speedrect-shift-right)
("S-<left>" speedrect-shift-left)
@@ -295,6 +312,7 @@ prior to deactivating mark."
("m" speedrect-yank-from-calc after)
;; Special
("n" speedrect-restart) ("l" speedrect-recall-last)
+ ("M" speedrect-multiple-cursors)
("?" speedrect-transient-map-info) ("q" speedrect-quit))
for bind = (if wrap (speedrect--wrap-command def (eq wrap 'after)) def)
do (define-key rectangle-mark-mode-map (kbd key) bind))
- [elpa] externals/speedrect d2af235ca3 60/90: stash: save point and mark crutches to stash, (continued)
- [elpa] externals/speedrect d2af235ca3 60/90: stash: save point and mark crutches to stash, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect 6dc047f54b 64/90: bump version, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect 4321fef672 40/90: Mention phi-rectangle, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect 4f9d3020e2 32/90: Update README.md, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect 0fa8964ce2 46/90: wrap commands for stash and restart, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect e7c0ca81cc 49/90: Bump version, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect 540dc4e790 58/90: Update README.md, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect 0f00af4c67 62/90: docstring tweak, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect 6982a08d25 11/90: doc: open uses tabs/spaces, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect 7bb4633c90 29/90: Update README.md, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect b743b42208 55/90: Add x:corners and M:multiple-cursors support,
ELPA Syncer <=
- [elpa] externals/speedrect 85b281d045 61/90: f - fill-text in rectangle, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect 6886e5c604 66/90: Update README.md, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect 932d983f02 65/90: Document fill, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect 1e1b713d65 57/90: Update README.md, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect 3e981896f1 71/90: Bump version, require Emacs v29.1, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect 1e897cc0d5 76/90: copy-rectangle-as-text, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect a8015aea6f 79/90: Bump version, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect c068c528e3 69/90: Update README.md, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect ed85814e48 72/90: help: correct typo, ELPA Syncer, 2024/12/06
- [elpa] externals/speedrect 94ed5cbc6c 80/90: README NEWS, ELPA Syncer, 2024/12/06