kmacro-x

a fork of vifon's kmacro-x
git clone https://git.trogloxene.org/kmacro-x.git
Log | Files | Refs | README | LICENSE

commit eed86b40543e57866d232d03c821a9054478a32e
parent 10ce46a10157016967264830df33d3f711fe791e
Author: Wojciech Siewierski <wojciech@siewierski.eu>
Date:   Fri,  3 Mar 2023 17:30:02 +0100

Add kmacro-x-mc-mark-whole-symbol

Diffstat:
Mkmacro-x-mc.el | 29+++++++++++++++++++++++++----
1 file changed, 25 insertions(+), 4 deletions(-)

diff --git a/kmacro-x-mc.el b/kmacro-x-mc.el @@ -43,6 +43,23 @@ '((t (:underline t))) "The face used for the original cursor when using `kmacro-x-mc-mode'.") +(defcustom kmacro-x-mc-mark-whole-symbol nil + "When invoking `kmacro-x-mc-mark-next' with no region, mark the whole symbol. + +If nil, keep point in place and put the mark at the end of the symbol. + +If t, move the point to the end of the symbol and put the mark at its beginning. + +Example, with | being the point and ^ being the mark: + + exam|ple-symbol + ^ + + example-symbol| + ^ +" + :type 'boolean) + (defcustom kmacro-x-mc-pre-apply-hook nil "Functions to run before applying the recorded keyboard macro to cursors." :type 'hook) @@ -217,10 +234,14 @@ user directory. (setq-local kmacro-x-mc-cursors (list ov))) (unless (use-region-p) - ;; The end of the symbol is as good of a place as any for - ;; the mark. Definitely better than whatever random - ;; position it was before. - (push-mark (cdr bounds))) + (if kmacro-x-mc-mark-whole-symbol + (progn + (push-mark (car bounds)) + (goto-char (cdr bounds))) + ;; The end of the symbol is as good of a place as any for + ;; the mark. Definitely better than whatever random + ;; position it was before. + (push-mark (cdr bounds)))) (setq-local kmacro-x-mc-offsets (cons (- (point)