From d8c6b947071448913ac0834c57a309fdab6a7019 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Sun, 26 Apr 2026 20:02:31 +0200 Subject: [PATCH] update multiple-cursors --- .../multiple-cursors-20260419.931/README-elpa | 161 ++++++++++++++++++ .../mc-cycle-cursors.el | 10 +- .../mc-edit-lines.el | 2 +- .../mc-hide-unmatched-lines-mode.el | 12 +- .../mc-mark-more.el | 18 +- .../mc-mark-pop.el | 2 +- .../mc-separate-operations.el | 4 +- .../multiple-cursors-autoloads.el | 154 ++++++++--------- .../multiple-cursors-core.el | 102 ++++++----- .../multiple-cursors-pkg.el | 11 +- .../multiple-cursors.el | 8 +- .../rectangular-region-mode.el | 33 ++-- 12 files changed, 343 insertions(+), 174 deletions(-) create mode 100644 elpa/multiple-cursors-20260419.931/README-elpa rename elpa/{multiple-cursors-20250210.1813 => multiple-cursors-20260419.931}/mc-cycle-cursors.el (92%) rename elpa/{multiple-cursors-20250210.1813 => multiple-cursors-20260419.931}/mc-edit-lines.el (98%) rename elpa/{multiple-cursors-20250210.1813 => multiple-cursors-20260419.931}/mc-hide-unmatched-lines-mode.el (88%) rename elpa/{multiple-cursors-20250210.1813 => multiple-cursors-20260419.931}/mc-mark-more.el (98%) rename elpa/{multiple-cursors-20250210.1813 => multiple-cursors-20260419.931}/mc-mark-pop.el (86%) rename elpa/{multiple-cursors-20250210.1813 => multiple-cursors-20260419.931}/mc-separate-operations.el (97%) rename elpa/{multiple-cursors-20250210.1813 => multiple-cursors-20260419.931}/multiple-cursors-autoloads.el (65%) rename elpa/{multiple-cursors-20250210.1813 => multiple-cursors-20260419.931}/multiple-cursors-core.el (92%) rename elpa/{multiple-cursors-20250210.1813 => multiple-cursors-20260419.931}/multiple-cursors-pkg.el (55%) rename elpa/{multiple-cursors-20250210.1813 => multiple-cursors-20260419.931}/multiple-cursors.el (97%) rename elpa/{multiple-cursors-20250210.1813 => multiple-cursors-20260419.931}/rectangular-region-mode.el (77%) diff --git a/elpa/multiple-cursors-20260419.931/README-elpa b/elpa/multiple-cursors-20260419.931/README-elpa new file mode 100644 index 00000000..cf37e650 --- /dev/null +++ b/elpa/multiple-cursors-20260419.931/README-elpa @@ -0,0 +1,161 @@ +Multiple cursors for Emacs. This is some pretty crazy functionality, so yes, +there are kinks. Don't be afraid though, I've been using it since 2011 with +great success and much merriment. + +## Basic usage + +Start out with: + + (require 'multiple-cursors) + +Then you have to set up your keybindings - multiple-cursors doesn't presume to +know how you'd like them laid out. Here are some examples: + +When you have an active region that spans multiple lines, the following will +add a cursor to each line: + + (global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines) + +When you want to add multiple cursors not based on continuous lines, but based on +keywords in the buffer, use: + + (global-set-key (kbd "C->") 'mc/mark-next-like-this) + (global-set-key (kbd "C-<") 'mc/mark-previous-like-this) + (global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this) + +First mark the word, then add more cursors. + +To get out of multiple-cursors-mode, press `` or `C-g`. The latter will +first disable multiple regions before disabling multiple cursors. If you want to +insert a newline in multiple-cursors-mode, use `C-j`. + +## Video + +You can [watch an intro to multiple-cursors at Emacs Rocks](http://emacsrocks.com/e13.html). + +## Command overview + +### Mark one more occurrence + + - `mc/mark-next-like-this`: Adds a cursor and region at the next part of the buffer forwards that matches the current region. + - `mc/mark-next-like-this-word`: Adds a cursor and region at the next part of the buffer forwards that matches the current region, if no region is selected it selects the word at the point. + - `mc/mark-next-like-this-symbol`: Adds a cursor and region at the next part of the buffer forwards that matches the current region, if no region is selected it selects the symbol at the point. + - `mc/mark-next-word-like-this`: Like `mc/mark-next-like-this` but only for whole words. + - `mc/mark-next-symbol-like-this`: Like `mc/mark-next-like-this` but only for whole symbols. + - `mc/mark-previous-like-this`: Adds a cursor and region at the next part of the buffer backwards that matches the current region. + - `mc/mark-previous-word-like-this`: Like `mc/mark-previous-like-this` but only for whole words. + - `mc/mark-previous-symbol-like-this`: Like `mc/mark-previous-like-this` but only for whole symbols. + - `mc/mark-more-like-this-extended`: Use arrow keys to quickly mark/skip next/previous occurrences. + - `mc/add-cursor-on-click`: Bind to a mouse event to add cursors by clicking. See tips-section. + +### Mark many occurrences + + - `mc/mark-all-like-this`: Marks all parts of the buffer that matches the current region. + - `mc/mark-all-words-like-this`: Like `mc/mark-all-like-this` but only for whole words. + - `mc/mark-all-symbols-like-this`: Like `mc/mark-all-like-this` but only for whole symbols. + - `mc/mark-all-in-region`: Prompts for a string to match in the region, adding cursors to all of them. + - `mc/mark-all-like-this-in-defun`: Marks all parts of the current defun that matches the current region. + - `mc/mark-all-words-like-this-in-defun`: Like `mc/mark-all-like-this-in-defun` but only for whole words. + - `mc/mark-all-symbols-like-this-in-defun`: Like `mc/mark-all-like-this-in-defun` but only for whole symbols. + - `mc/mark-all-like-this-dwim`: Tries to be smart about marking everything you want. Can be pressed multiple times. + +### Special + + - `set-rectangular-region-anchor`: Think of this one as `set-mark` except you're marking a rectangular region. + - `mc/mark-sgml-tag-pair`: Mark the current opening and closing tag. + - `mc/insert-numbers`: Insert increasing numbers for each cursor, top to bottom. + - `mc/insert-letters`: Insert increasing letters for each cursor, top to bottom. + - `mc/sort-regions`: Sort the marked regions alphabetically. + - `mc/reverse-regions`: Reverse the order of the marked regions. + +## Tips and tricks + +- To get out of multiple-cursors-mode, press `` or `C-g`. The latter will + first disable multiple regions before disabling multiple cursors. If you want to + insert a newline in multiple-cursors-mode, use `C-j`. + +- Sometimes you end up with cursors outside of your view. You can + scroll the screen to center on each cursor with `C-v` and `M-v`. + +- Try pressing `mc/mark-next-like-this` with no region selected. It will just add a cursor + on the next line. + +- Try pressing `mc/mark-next-like-this-word` or + `mc/mark-next-like-this-symbol` with no region selected. It will + mark the symbol and add a cursor at the next occurrence + +- Try pressing `mc/mark-all-like-this-dwim` on a tagname in html-mode. + +- Notice that the number of cursors active can be seen in the modeline. + +- If you get out of multiple-cursors-mode and yank - it will yank only + from the kill-ring of main cursor. To yank from the kill-rings of + every cursor use yank-rectangle, normally found at C-x r y. + +- You can use `mc/reverse-regions` with nothing selected and just one cursor. + It will then flip the sexp at point and the one below it. + +- If you would like to keep the global bindings clean, and get custom keybindings + when the region is active, you can try [region-bindings-mode](https://github.com/fgallina/region-bindings-mode). + +BTW, I highly recommend adding `mc/mark-next-like-this` to a key binding that's +right next to the key for `er/expand-region`. + +### Binding mouse events + +To override a mouse event, you will likely have to also unbind the +`down-mouse` part of the event. Like this: + + (global-unset-key (kbd "M-")) + (global-set-key (kbd "M-") 'mc/add-cursor-on-click) + +Or you can do like me and find an unused, but less convenient, binding: + + (global-set-key (kbd "C-S-") 'mc/add-cursor-on-click) + +## Unknown commands + +Multiple-cursors uses two lists of commands to know what to do: the run-once list +and the run-for-all list. It comes with a set of defaults, but it would be beyond silly +to try and include all the known Emacs commands. + +So that's why multiple-cursors occasionally asks what to do about a command. It will +then remember your choice by saving it in `~/.emacs.d/.mc-lists.el`. You can change +the location with: + + (setq mc/list-file "/my/preferred/file") + +## Known limitations + +* isearch-forward and isearch-backward aren't supported with multiple cursors. + You should feel free to add a simplified version that can work with it. +* All key bindings that refer to lambdas are always run for all cursors. If you + need to limit it, you will have to give it a name. +* Redo might screw with your cursors. Undo works very well. + +## Contribute + +Yes, please do. There's a suite of tests, so remember to add tests for your +specific feature, or I might break it later. + +You'll find the repo at: + + https://github.com/magnars/multiple-cursors.el + +To fetch the test dependencies: + + $ cd /path/to/multiple-cursors + $ git submodule update --init + +Run the tests with: + + $ ./util/ecukes/ecukes --graphical + +## Contributors + +* [Takafumi Arakaki](https://github.com/tkf) made .mc-lists.el diff friendly +* [Marco Baringer](https://github.com/segv) contributed looping to mc/cycle and adding cursors without region for mark-more. +* [Ivan Andrus](https://github.com/gvol) added showing number of cursors in mode-line +* [Fuco](https://github.com/Fuco1) added the first version of `mc/mark-all-like-this-dwim` + +Thanks! diff --git a/elpa/multiple-cursors-20250210.1813/mc-cycle-cursors.el b/elpa/multiple-cursors-20260419.931/mc-cycle-cursors.el similarity index 92% rename from elpa/multiple-cursors-20250210.1813/mc-cycle-cursors.el rename to elpa/multiple-cursors-20260419.931/mc-cycle-cursors.el index 0248b9cd..f648f2c5 100644 --- a/elpa/multiple-cursors-20250210.1813/mc-cycle-cursors.el +++ b/elpa/multiple-cursors-20260419.931/mc-cycle-cursors.el @@ -1,4 +1,4 @@ -;;; mc-cycle-cursors.el +;;; mc-cycle-cursors.el -*- lexical-binding: t; -*- ;; Copyright (C) 2012-2016 Magnar Sveen @@ -73,7 +73,7 @@ (cursors-after-point (cl-remove-if (lambda (cursor) (< (mc/cursor-beg cursor) point)) cursors)) - (cursors-in-order (cl-sort cursors-after-point '< :key 'mc/cursor-beg))) + (cursors-in-order (cl-sort cursors-after-point #'< :key #'mc/cursor-beg))) (car cursors-in-order))) (defun mc/last-fake-cursor-before (point) @@ -82,7 +82,7 @@ (cursors-before-point (cl-remove-if (lambda (cursor) (> (mc/cursor-end cursor) point)) cursors)) - (cursors-in-order (cl-sort cursors-before-point '> :key 'mc/cursor-end))) + (cursors-in-order (cl-sort cursors-before-point #'> :key #'mc/cursor-end))) (car cursors-in-order))) (cl-defun mc/cycle (next-cursor fallback-cursor loop-message) @@ -110,8 +110,8 @@ (mc/last-fake-cursor-before (point-max)) "We're already at the last cursor")) -(define-key mc/keymap (kbd "C-v") 'mc/cycle-forward) -(define-key mc/keymap (kbd "M-v") 'mc/cycle-backward) +(define-key mc/keymap (kbd "C-v") #'mc/cycle-forward) +(define-key mc/keymap (kbd "M-v") #'mc/cycle-backward) (provide 'mc-cycle-cursors) diff --git a/elpa/multiple-cursors-20250210.1813/mc-edit-lines.el b/elpa/multiple-cursors-20260419.931/mc-edit-lines.el similarity index 98% rename from elpa/multiple-cursors-20250210.1813/mc-edit-lines.el rename to elpa/multiple-cursors-20260419.931/mc-edit-lines.el index 33e7df24..c837eafd 100644 --- a/elpa/multiple-cursors-20250210.1813/mc-edit-lines.el +++ b/elpa/multiple-cursors-20260419.931/mc-edit-lines.el @@ -1,4 +1,4 @@ -;;; mc-edit-lines.el +;;; mc-edit-lines.el -*- lexical-binding: t; -*- ;; Copyright (C) 2012-2016 Magnar Sveen diff --git a/elpa/multiple-cursors-20250210.1813/mc-hide-unmatched-lines-mode.el b/elpa/multiple-cursors-20260419.931/mc-hide-unmatched-lines-mode.el similarity index 88% rename from elpa/multiple-cursors-20250210.1813/mc-hide-unmatched-lines-mode.el rename to elpa/multiple-cursors-20260419.931/mc-hide-unmatched-lines-mode.el index 7565c0b8..ed9db7f8 100644 --- a/elpa/multiple-cursors-20250210.1813/mc-hide-unmatched-lines-mode.el +++ b/elpa/multiple-cursors-20260419.931/mc-hide-unmatched-lines-mode.el @@ -1,4 +1,4 @@ -;;; mc-hide-unmatched-lines-mode.el +;;; mc-hide-unmatched-lines-mode.el -*- lexical-binding: t; -*- ;; Copyright (C) 2014 Aleksey Fedotov @@ -35,8 +35,8 @@ (defvar hum/hide-unmatched-lines-mode-map (make-sparse-keymap) "Keymap for hide unmatched lines is mainly for rebinding C-g") -(define-key hum/hide-unmatched-lines-mode-map (kbd "C-g") 'hum/keyboard-quit) -(define-key hum/hide-unmatched-lines-mode-map (kbd "") 'hum/keyboard-quit) +(define-key hum/hide-unmatched-lines-mode-map (kbd "C-g") #'hum/keyboard-quit) +(define-key hum/hide-unmatched-lines-mode-map (kbd "") #'hum/keyboard-quit) (defun hum/keyboard-quit () "Leave hide-unmatched-lines mode" @@ -61,10 +61,10 @@ mode. To leave this mode press or \"C-g\"" ;;just in case if mc mode will be disabled while hide-unmatched-lines is active (progn (hum/hide-unmatched-lines) - (add-hook 'multiple-cursors-mode-disabled-hook 'hum/disable-hum-mode t t)) + (add-hook 'multiple-cursors-mode-disabled-hook #'hum/disable-hum-mode t t)) (progn (hum/unhide-unmatched-lines) - (remove-hook 'multiple-cursors-mode-disabled-hook 'hum/disable-hum-mode)))) + (remove-hook 'multiple-cursors-mode-disabled-hook #'hum/disable-hum-mode)))) (defconst hum/invisible-overlay-name 'hum/invisible-overlay-name) @@ -104,6 +104,6 @@ mode. To leave this mode press or \"C-g\"" (defun hum/unhide-unmatched-lines () (remove-overlays nil nil hum/invisible-overlay-name t)) -(define-key mc/keymap (kbd "C-'") 'mc-hide-unmatched-lines-mode) +(define-key mc/keymap (kbd "C-'") #'mc-hide-unmatched-lines-mode) (provide 'mc-hide-unmatched-lines-mode) diff --git a/elpa/multiple-cursors-20250210.1813/mc-mark-more.el b/elpa/multiple-cursors-20260419.931/mc-mark-more.el similarity index 98% rename from elpa/multiple-cursors-20250210.1813/mc-mark-more.el rename to elpa/multiple-cursors-20260419.931/mc-mark-more.el index 51f867e9..8db16d7a 100644 --- a/elpa/multiple-cursors-20250210.1813/mc-mark-more.el +++ b/elpa/multiple-cursors-20260419.931/mc-mark-more.el @@ -1,4 +1,4 @@ -;;; mc-mark-more.el +;;; mc-mark-more.el -*- lexical-binding: t; -*- ;; Copyright (C) 2012-2016 Magnar Sveen @@ -56,7 +56,7 @@ beg)) (defun mc/furthest-cursor-before-point () - (let ((beg (if mark-active (min (mark) (point)) (point))) + (let ((beg (or (use-region-beginning) (point))) furthest) (mc/for-each-fake-cursor (when (< (mc/cursor-beg cursor) beg) @@ -65,7 +65,7 @@ furthest)) (defun mc/furthest-cursor-after-point () - (let ((end (if mark-active (max (mark) (point)) (point))) + (let ((end (or (use-region-end) (point))) furthest) (mc/for-each-fake-cursor (when (> (mc/cursor-end cursor) end) @@ -309,7 +309,7 @@ With zero ARG, skip the last one and mark next." (mc/mark-previous-like-this arg))) (defun mc/mark-lines (num-lines direction) - (dotimes (i (if (= num-lines 0) 1 num-lines)) + (dotimes (_ (if (= num-lines 0) 1 num-lines)) (mc/save-excursion (let ((furthest-cursor (cl-ecase direction (forwards (mc/furthest-cursor-after-point)) @@ -500,10 +500,10 @@ remove the keymap depends on user input and KEEP-PRED: (defvar mc/mark-more-like-this-extended-keymap (make-sparse-keymap)) -(define-key mc/mark-more-like-this-extended-keymap (kbd "") 'mc/mmlte--up) -(define-key mc/mark-more-like-this-extended-keymap (kbd "") 'mc/mmlte--down) -(define-key mc/mark-more-like-this-extended-keymap (kbd "") 'mc/mmlte--left) -(define-key mc/mark-more-like-this-extended-keymap (kbd "") 'mc/mmlte--right) +(define-key mc/mark-more-like-this-extended-keymap (kbd "") #'mc/mmlte--up) +(define-key mc/mark-more-like-this-extended-keymap (kbd "") #'mc/mmlte--down) +(define-key mc/mark-more-like-this-extended-keymap (kbd "") #'mc/mmlte--left) +(define-key mc/mark-more-like-this-extended-keymap (kbd "") #'mc/mmlte--right) ;;;###autoload (defun mc/mark-more-like-this-extended () @@ -706,7 +706,7 @@ already there." (mc/maybe-multiple-cursors-mode))) ;;;###autoload -(defalias 'mc/add-cursor-on-click 'mc/toggle-cursor-on-click) +(defalias 'mc/add-cursor-on-click #'mc/toggle-cursor-on-click) ;;;###autoload (defun mc/mark-sgml-tag-pair () diff --git a/elpa/multiple-cursors-20250210.1813/mc-mark-pop.el b/elpa/multiple-cursors-20260419.931/mc-mark-pop.el similarity index 86% rename from elpa/multiple-cursors-20250210.1813/mc-mark-pop.el rename to elpa/multiple-cursors-20260419.931/mc-mark-pop.el index 8a183812..15a9c8b0 100644 --- a/elpa/multiple-cursors-20250210.1813/mc-mark-pop.el +++ b/elpa/multiple-cursors-20260419.931/mc-mark-pop.el @@ -1,4 +1,4 @@ -;;; mc-mark-pop.el --- Pop cursors off of the mark stack +;;; mc-mark-pop.el --- Pop cursors off of the mark stack -*- lexical-binding: t; -*- (require 'multiple-cursors-core) diff --git a/elpa/multiple-cursors-20250210.1813/mc-separate-operations.el b/elpa/multiple-cursors-20260419.931/mc-separate-operations.el similarity index 97% rename from elpa/multiple-cursors-20250210.1813/mc-separate-operations.el rename to elpa/multiple-cursors-20260419.931/mc-separate-operations.el index ddc7395b..6ece65d6 100644 --- a/elpa/multiple-cursors-20250210.1813/mc-separate-operations.el +++ b/elpa/multiple-cursors-20260419.931/mc-separate-operations.el @@ -1,4 +1,4 @@ -;;; mc-separate-operations.el - functions that work differently on each cursor +;;; mc-separate-operations.el --- Functions that work differently on each cursor -*- lexical-binding: t; -*- ;; Copyright (C) 2012-2016 Magnar Sveen @@ -118,7 +118,7 @@ (interactive) (unless (use-region-p) (mc/execute-command-for-all-cursors 'mark-sexp)) - (setq mc--strings-to-replace (sort (mc--ordered-region-strings) 'string<)) + (setq mc--strings-to-replace (sort (mc--ordered-region-strings) #'string<)) (mc--replace-region-strings)) diff --git a/elpa/multiple-cursors-20250210.1813/multiple-cursors-autoloads.el b/elpa/multiple-cursors-20260419.931/multiple-cursors-autoloads.el similarity index 65% rename from elpa/multiple-cursors-20250210.1813/multiple-cursors-autoloads.el rename to elpa/multiple-cursors-20260419.931/multiple-cursors-autoloads.el index 41e78974..a8d19602 100644 --- a/elpa/multiple-cursors-20250210.1813/multiple-cursors-autoloads.el +++ b/elpa/multiple-cursors-20260419.931/multiple-cursors-autoloads.el @@ -16,8 +16,8 @@ ;;; Generated autoloads from mc-edit-lines.el -(autoload 'mc/edit-lines "mc-edit-lines" "\ -Add one cursor to each line of the active region. +(autoload 'mc/edit-lines "mc-edit-lines" +"Add one cursor to each line of the active region. Starts from mark and moves in straight down or up towards the line point is on. @@ -29,17 +29,17 @@ Otherwise, if ARG negative, short lines will be ignored. Any other non-nil value will cause short lines to be padded. (fn &optional ARG)" t) -(autoload 'mc/edit-ends-of-lines "mc-edit-lines" "\ -Add one cursor to the end of each line in the active region." t) -(autoload 'mc/edit-beginnings-of-lines "mc-edit-lines" "\ -Add one cursor to the beginning of each line in the active region." t) +(autoload 'mc/edit-ends-of-lines "mc-edit-lines" +"Add one cursor to the end of each line in the active region." t) +(autoload 'mc/edit-beginnings-of-lines "mc-edit-lines" +"Add one cursor to the beginning of each line in the active region." t) (register-definition-prefixes "mc-edit-lines" '("mc/edit-lines-empty-lines")) ;;; Generated autoloads from mc-hide-unmatched-lines-mode.el -(autoload 'mc-hide-unmatched-lines-mode "mc-hide-unmatched-lines-mode" "\ -Minor mode when enabled hides all lines where no cursors (and +(autoload 'mc-hide-unmatched-lines-mode "mc-hide-unmatched-lines-mode" +"Minor mode when enabled hides all lines where no cursors (and also hum/lines-to-expand below and above) To make use of this mode press \"C-'\" while multiple-cursor-mode is active. You can @@ -67,38 +67,38 @@ disabled. ;;; Generated autoloads from mc-mark-more.el -(autoload 'mc/mark-next-like-this "mc-mark-more" "\ -Find and mark the next part of the buffer matching the currently active region +(autoload 'mc/mark-next-like-this "mc-mark-more" +"Find and mark the next part of the buffer matching the currently active region If no region is active add a cursor on the next line With negative ARG, delete the last one instead. With zero ARG, skip the last one and mark next. (fn ARG)" t) -(autoload 'mc/mark-next-like-this-word "mc-mark-more" "\ -Find and mark the next part of the buffer matching the currently active region +(autoload 'mc/mark-next-like-this-word "mc-mark-more" +"Find and mark the next part of the buffer matching the currently active region If no region is active, mark the word at the point and find the next match With negative ARG, delete the last one instead. With zero ARG, skip the last one and mark next. (fn ARG)" t) -(autoload 'mc/mark-next-word-like-this "mc-mark-more" "\ -Find and mark the next word of the buffer matching the currently active region +(autoload 'mc/mark-next-word-like-this "mc-mark-more" +"Find and mark the next word of the buffer matching the currently active region The matching region must be a whole word to be a match If no region is active add a cursor on the next line With negative ARG, delete the last one instead. With zero ARG, skip the last one and mark next. (fn ARG)" t) -(autoload 'mc/mark-next-symbol-like-this "mc-mark-more" "\ -Find and mark the next symbol of the buffer matching the currently active region +(autoload 'mc/mark-next-symbol-like-this "mc-mark-more" +"Find and mark the next symbol of the buffer matching the currently active region The matching region must be a whole symbol to be a match If no region is active add a cursor on the next line With negative ARG, delete the last one instead. With zero ARG, skip the last one and mark next. (fn ARG)" t) -(autoload 'mc/mark-previous-like-this "mc-mark-more" "\ -Find and mark the previous part of the buffer matching the +(autoload 'mc/mark-previous-like-this "mc-mark-more" +"Find and mark the previous part of the buffer matching the currently active region. If no region is active ,add a cursor on the previous line. @@ -108,8 +108,8 @@ With negative ARG, delete the last one instead. With zero ARG, skip the last one and mark next. (fn ARG)" t) -(autoload 'mc/mark-previous-like-this-word "mc-mark-more" "\ -Find and mark the previous part of the buffer matching the +(autoload 'mc/mark-previous-like-this-word "mc-mark-more" +"Find and mark the previous part of the buffer matching the currently active region. If no region is active, mark the word at the point and find the @@ -120,8 +120,8 @@ With negative ARG, delete the last one instead. With zero ARG, skip the last one and mark previous. (fn ARG)" t) -(autoload 'mc/mark-previous-word-like-this "mc-mark-more" "\ -Find and mark the previous part of the buffer matching the +(autoload 'mc/mark-previous-word-like-this "mc-mark-more" +"Find and mark the previous part of the buffer matching the currently active region. The matching region must be a whole word to be a match. @@ -133,8 +133,8 @@ With negative ARG, delete the last one instead. With zero ARG, skip the last one and mark next. (fn ARG)" t) -(autoload 'mc/mark-previous-symbol-like-this "mc-mark-more" "\ -Find and mark the previous part of the buffer matching +(autoload 'mc/mark-previous-symbol-like-this "mc-mark-more" +"Find and mark the previous part of the buffer matching the currently active region. The matching region must be a whole symbol to be a match. @@ -146,38 +146,38 @@ With negative ARG, delete the last one instead. With zero ARG, skip the last one and mark next. (fn ARG)" t) -(autoload 'mc/mark-next-lines "mc-mark-more" "\ - +(autoload 'mc/mark-next-lines "mc-mark-more" +" (fn ARG)" t) -(autoload 'mc/mark-previous-lines "mc-mark-more" "\ - +(autoload 'mc/mark-previous-lines "mc-mark-more" +" (fn ARG)" t) -(autoload 'mc/unmark-next-like-this "mc-mark-more" "\ -Deselect next part of the buffer matching the currently active region." t) -(autoload 'mc/unmark-previous-like-this "mc-mark-more" "\ -Deselect prev part of the buffer matching the currently active region." t) -(autoload 'mc/skip-to-next-like-this "mc-mark-more" "\ -Skip the current one and select the next part of the buffer +(autoload 'mc/unmark-next-like-this "mc-mark-more" +"Deselect next part of the buffer matching the currently active region." t) +(autoload 'mc/unmark-previous-like-this "mc-mark-more" +"Deselect prev part of the buffer matching the currently active region." t) +(autoload 'mc/skip-to-next-like-this "mc-mark-more" +"Skip the current one and select the next part of the buffer matching the currently active region." t) -(autoload 'mc/skip-to-previous-like-this "mc-mark-more" "\ -Skip the current one and select the prev part of the buffer +(autoload 'mc/skip-to-previous-like-this "mc-mark-more" +"Skip the current one and select the prev part of the buffer matching the currently active region." t) -(autoload 'mc/mark-all-like-this "mc-mark-more" "\ -Find and mark all the parts of the buffer matching the currently active region" t) +(autoload 'mc/mark-all-like-this "mc-mark-more" +"Find and mark all the parts of the buffer matching the currently active region" t) (autoload 'mc/mark-all-words-like-this "mc-mark-more" nil t) (autoload 'mc/mark-all-symbols-like-this "mc-mark-more" nil t) -(autoload 'mc/mark-all-in-region "mc-mark-more" "\ -Find and mark all the parts in the region matching the given search +(autoload 'mc/mark-all-in-region "mc-mark-more" +"Find and mark all the parts in the region matching the given search (fn BEG END &optional SEARCH)" t) -(autoload 'mc/mark-all-in-region-regexp "mc-mark-more" "\ -Find and mark all the parts in the region matching the given regexp. +(autoload 'mc/mark-all-in-region-regexp "mc-mark-more" +"Find and mark all the parts in the region matching the given regexp. (fn BEG END)" t) -(autoload 'mc/mark-more-like-this-extended "mc-mark-more" "\ -Like mark-more-like-this, but then lets you adjust with arrow keys. +(autoload 'mc/mark-more-like-this-extended "mc-mark-more" +"Like mark-more-like-this, but then lets you adjust with arrow keys. The adjustments work like this: Mark previous like this and set direction to \\='up @@ -195,15 +195,15 @@ If direction is \\='down: The bindings for these commands can be changed. See `mc/mark-more-like-this-extended-keymap'." t) -(autoload 'mc/mark-all-like-this-dwim "mc-mark-more" "\ -Tries to guess what you want to mark all of. +(autoload 'mc/mark-all-like-this-dwim "mc-mark-more" +"Tries to guess what you want to mark all of. Can be pressed multiple times to increase selection. With prefix, it behaves the same as original `mc/mark-all-like-this' (fn ARG)" t) -(autoload 'mc/mark-all-dwim "mc-mark-more" "\ -Tries even harder to guess what you want to mark all of. +(autoload 'mc/mark-all-dwim "mc-mark-more" +"Tries even harder to guess what you want to mark all of. If the region is active and spans multiple lines, it will behave as if `mc/mark-all-in-region'. With the prefix ARG, it will call @@ -213,64 +213,64 @@ If the region is inactive or on a single line, it will behave like `mc/mark-all-like-this-dwim'. (fn ARG)" t) -(autoload 'mc/mark-all-like-this-in-defun "mc-mark-more" "\ -Mark all like this in defun." t) -(autoload 'mc/mark-all-words-like-this-in-defun "mc-mark-more" "\ -Mark all words like this in defun." t) -(autoload 'mc/mark-all-symbols-like-this-in-defun "mc-mark-more" "\ -Mark all symbols like this in defun." t) -(autoload 'mc/toggle-cursor-on-click "mc-mark-more" "\ -Add a cursor where you click, or remove a fake cursor that is +(autoload 'mc/mark-all-like-this-in-defun "mc-mark-more" +"Mark all like this in defun." t) +(autoload 'mc/mark-all-words-like-this-in-defun "mc-mark-more" +"Mark all words like this in defun." t) +(autoload 'mc/mark-all-symbols-like-this-in-defun "mc-mark-more" +"Mark all symbols like this in defun." t) +(autoload 'mc/toggle-cursor-on-click "mc-mark-more" +"Add a cursor where you click, or remove a fake cursor that is already there. (fn EVENT)" t) -(defalias 'mc/add-cursor-on-click 'mc/toggle-cursor-on-click) -(autoload 'mc/mark-sgml-tag-pair "mc-mark-more" "\ -Mark the tag we're in and its pair for renaming." t) +(defalias 'mc/add-cursor-on-click #'mc/toggle-cursor-on-click) +(autoload 'mc/mark-sgml-tag-pair "mc-mark-more" +"Mark the tag we're in and its pair for renaming." t) (register-definition-prefixes "mc-mark-more" '("mc--" "mc/")) ;;; Generated autoloads from mc-mark-pop.el -(autoload 'mc/mark-pop "mc-mark-pop" "\ -Add a cursor at the current point, pop off mark ring and jump +(autoload 'mc/mark-pop "mc-mark-pop" +"Add a cursor at the current point, pop off mark ring and jump to the popped mark." t) ;;; Generated autoloads from mc-separate-operations.el -(autoload 'mc/insert-numbers "mc-separate-operations" "\ -Insert increasing numbers for each cursor, starting at +(autoload 'mc/insert-numbers "mc-separate-operations" +"Insert increasing numbers for each cursor, starting at `mc/insert-numbers-default' or ARG. (fn ARG)" t) -(autoload 'mc/insert-letters "mc-separate-operations" "\ -Insert increasing letters for each cursor, starting at 0 or ARG. +(autoload 'mc/insert-letters "mc-separate-operations" +"Insert increasing letters for each cursor, starting at 0 or ARG. Where letter[0]=a letter[2]=c letter[26]=aa (fn ARG)" t) (autoload 'mc/reverse-regions "mc-separate-operations" nil t) (autoload 'mc/sort-regions "mc-separate-operations" nil t) -(autoload 'mc/vertical-align "mc-separate-operations" "\ -Aligns all cursors vertically with a given CHARACTER to the one with the +(autoload 'mc/vertical-align "mc-separate-operations" +"Aligns all cursors vertically with a given CHARACTER to the one with the highest column number (the rightest). Might not behave as intended if more than one cursors are on the same line. (fn CHARACTER)" t) -(autoload 'mc/vertical-align-with-space "mc-separate-operations" "\ -Aligns all cursors with whitespace like `mc/vertical-align' does" t) +(autoload 'mc/vertical-align-with-space "mc-separate-operations" +"Aligns all cursors with whitespace like `mc/vertical-align' does" t) (register-definition-prefixes "mc-separate-operations" '("mc--" "mc/insert-numbers-default")) ;;; Generated autoloads from multiple-cursors-core.el -(autoload 'activate-cursor-for-undo "multiple-cursors-core" "\ -Called when undoing to temporarily activate the fake cursor +(autoload 'activate-cursor-for-undo "multiple-cursors-core" +"Called when undoing to temporarily activate the fake cursor which action is being undone. (fn ID)") -(autoload 'multiple-cursors-mode "multiple-cursors-core" "\ -Mode while multiple cursors are active. +(autoload 'multiple-cursors-mode "multiple-cursors-core" +"Mode while multiple cursors are active. This is a minor mode. If called interactively, toggle the `Multiple-Cursors mode' mode. If the prefix argument is positive, @@ -292,14 +292,14 @@ disabled. ;;; Generated autoloads from rectangular-region-mode.el -(autoload 'set-rectangular-region-anchor "rectangular-region-mode" "\ -Anchors the rectangular region at point. +(autoload 'set-rectangular-region-anchor "rectangular-region-mode" +"Anchors the rectangular region at point. Think of this one as `set-mark' except you're marking a rectangular region. It is an exceedingly quick way of adding multiple cursors to multiple lines." t) -(autoload 'rectangular-region-mode "rectangular-region-mode" "\ -A mode for creating a rectangular region to edit +(autoload 'rectangular-region-mode "rectangular-region-mode" +"A mode for creating a rectangular region to edit This is a minor mode. If called interactively, toggle the `Rectangular-Region mode' mode. If the prefix argument is positive, diff --git a/elpa/multiple-cursors-20250210.1813/multiple-cursors-core.el b/elpa/multiple-cursors-20260419.931/multiple-cursors-core.el similarity index 92% rename from elpa/multiple-cursors-20250210.1813/multiple-cursors-core.el rename to elpa/multiple-cursors-20260419.931/multiple-cursors-core.el index 2ce92ac1..b88145eb 100644 --- a/elpa/multiple-cursors-20250210.1813/multiple-cursors-core.el +++ b/elpa/multiple-cursors-20260419.931/multiple-cursors-core.el @@ -1,4 +1,4 @@ -;;; multiple-cursors-core.el --- An experiment in multiple cursors for emacs. +;;; multiple-cursors-core.el --- An experiment in multiple cursors for Emacs -*- lexical-binding: t; -*- ;; Copyright (C) 2012-2016 Magnar Sveen @@ -67,7 +67,7 @@ rendered or shift text." (cons (cons 'apply (cons 'activate-cursor-for-undo (list id))) buffer-undo-list)))))) (defun mc/all-fake-cursors (&optional start end) - (cl-remove-if-not 'mc/fake-cursor-p + (cl-remove-if-not #'mc/fake-cursor-p (overlays-in (or start (point-min)) (or end (point-max))))) @@ -95,7 +95,7 @@ rendered or shift text." (mapc #'(lambda (cursor) (when (mc/fake-cursor-p cursor) ,@forms)) - (sort (overlays-in (point-min) (point-max)) 'mc--compare-by-overlay-start)) + (sort (overlays-in (point-min) (point-max)) #'mc--compare-by-overlay-start)) (mc/pop-state-from-overlay (mc/cursor-with-id ,rci))))) (defmacro mc/save-window-scroll (&rest forms) @@ -123,18 +123,20 @@ rendered or shift text." (and (listp cursor-type) (eq (car cursor-type) 'bar))))) -(defun mc/line-number-at-pos (&optional pos absolute) - "Faster implementation of `line-number-at-pos'." - (if pos - (save-excursion - (if absolute - (save-restriction - (widen) - (goto-char pos) - (string-to-number (format-mode-line "%l"))) - (goto-char pos) - (string-to-number (format-mode-line "%l")))) - (string-to-number (format-mode-line "%l")))) +(if (>= emacs-major-version 28) + (defalias 'mc/line-number-at-pos #'line-number-at-pos) + (defun mc/line-number-at-pos (&optional pos absolute) + "Faster implementation of `line-number-at-pos'." + (if pos + (save-excursion + (if absolute + (save-restriction + (widen) + (goto-char pos) + (string-to-number (format-mode-line "%l"))) + (goto-char pos) + (string-to-number (format-mode-line "%l")))) + (string-to-number (format-mode-line "%l"))))) (defun mc/make-cursor-overlay-at-eol (pos) "Create overlay to look like cursor at end of line." @@ -288,6 +290,8 @@ makes sense for fake cursors." (defvar mc--executing-command-for-fake-cursor nil) (defun mc/execute-command-for-fake-cursor (cmd cursor) + (defvar annoying-arrows-mode) + (defvar smooth-scroll-margin) (let ((mc--executing-command-for-fake-cursor t) (id (overlay-get cursor 'mc-id)) (annoying-arrows-mode nil) @@ -579,7 +583,7 @@ which action is being undone." (defun mc/num-cursors () "The number of cursors (real and fake) in the buffer." - (1+ (cl-count-if 'mc/fake-cursor-p + (1+ (cl-count-if #'mc/fake-cursor-p (overlays-in (point-min) (point-max))))) (defvar mc--this-command nil @@ -611,9 +615,10 @@ not be recognized through the command-remapping lookup." ;; execute-kbd-macro should never be run for fake cursors. The real cursor will ;; execute the keyboard macro, resulting in new commands in the command loop, ;; and the fake cursors can pick up on those instead. -(defadvice execute-kbd-macro (around skip-fake-cursors activate) +(advice-add 'execute-kbd-macro :around #'mc--skip-fake-cursors) +(defun mc--skip-fake-cursors (orig-fun &rest args) (unless mc--executing-command-for-fake-cursor - ad-do-it)) + (apply orig-fun args))) (defun mc/execute-this-command-for-all-cursors-1 () "Used with post-command-hook to execute supported commands for all cursors. @@ -692,7 +697,7 @@ you should disable multiple-cursors-mode." (mc/execute-command-for-all-fake-cursors (lambda () (interactive) (cl-letf (((symbol-function 'read-from-minibuffer) - (lambda (p &optional i k r h d m) (read i)))) + (lambda (_p &optional i &rest _) (read i)))) (repeat-complex-command 0)))))) (defvar mc/keymap nil @@ -701,13 +706,13 @@ Main goal of the keymap is to rebind C-g and to conclude multiple cursors editing.") (unless mc/keymap (setq mc/keymap (make-sparse-keymap)) - (define-key mc/keymap (kbd "C-g") 'mc/keyboard-quit) - (define-key mc/keymap (kbd "") 'multiple-cursors-mode) - (define-key mc/keymap (kbd "C-:") 'mc/repeat-command) + (define-key mc/keymap (kbd "C-g") #'mc/keyboard-quit) + (define-key mc/keymap (kbd "") #'multiple-cursors-mode) + (define-key mc/keymap (kbd "C-:") #'mc/repeat-command) (when (fboundp 'phi-search) - (define-key mc/keymap (kbd "C-s") 'phi-search)) + (define-key mc/keymap (kbd "C-s") #'phi-search)) (when (fboundp 'phi-search-backward) - (define-key mc/keymap (kbd "C-r") 'phi-search-backward))) + (define-key mc/keymap (kbd "C-r") #'phi-search-backward))) (defun mc--all-equal (list) "Are all the items in LIST equal?" @@ -748,13 +753,13 @@ They are temporarily disabled when multiple-cursors are active.") (funcall mode -1))) (defun mc/temporarily-disable-unsupported-minor-modes () - (mapc 'mc/temporarily-disable-minor-mode mc/unsupported-minor-modes)) + (mapc #'mc/temporarily-disable-minor-mode mc/unsupported-minor-modes)) (defun mc/enable-minor-mode (mode) (funcall mode 1)) (defun mc/enable-temporarily-disabled-minor-modes () - (mapc 'mc/enable-minor-mode mc/temporarily-disabled-minor-modes) + (mapc #'mc/enable-minor-mode mc/temporarily-disabled-minor-modes) (setq mc/temporarily-disabled-minor-modes nil)) (defcustom mc/mode-line @@ -774,11 +779,11 @@ They are temporarily disabled when multiple-cursors are active.") (if multiple-cursors-mode (progn (mc/temporarily-disable-unsupported-minor-modes) - (add-hook 'pre-command-hook 'mc/make-a-note-of-the-command-being-run nil t) - (add-hook 'post-command-hook 'mc/execute-this-command-for-all-cursors t t) + (add-hook 'pre-command-hook #'mc/make-a-note-of-the-command-being-run nil t) + (add-hook 'post-command-hook #'mc/execute-this-command-for-all-cursors t t) (run-hooks 'multiple-cursors-mode-enabled-hook)) - (remove-hook 'post-command-hook 'mc/execute-this-command-for-all-cursors t) - (remove-hook 'pre-command-hook 'mc/make-a-note-of-the-command-being-run t) + (remove-hook 'post-command-hook #'mc/execute-this-command-for-all-cursors t) + (remove-hook 'pre-command-hook #'mc/make-a-note-of-the-command-being-run t) (setq mc--this-command nil) (mc--maybe-set-killed-rectangle) (mc/remove-fake-cursors) @@ -790,7 +795,7 @@ They are temporarily disabled when multiple-cursors are active.") (multiple-cursors-mode 0) (run-hooks 'multiple-cursors-mode-disabled-hook)) -(add-hook 'after-revert-hook 'mc/disable-multiple-cursors-mode) +(add-hook 'after-revert-hook #'mc/disable-multiple-cursors-mode) (defun mc/maybe-multiple-cursors-mode () "Enable multiple-cursors-mode if there is more than one currently active cursor." @@ -798,23 +803,26 @@ They are temporarily disabled when multiple-cursors are active.") (multiple-cursors-mode 1) (mc/disable-multiple-cursors-mode))) +(defun mc--unsupported-advice (orig-fun &rest args) + "command isn't supported with multiple cursors." + (unless (and multiple-cursors-mode (called-interactively-p 'any)) + (apply orig-fun args))) + (defmacro unsupported-cmd (cmd msg) "Adds command to list of unsupported commands and prevents it from being executed if in multiple-cursors-mode." `(progn - (put (quote ,cmd) 'mc--unsupported ,msg) - (defadvice ,cmd (around unsupported-advice activate) - "command isn't supported with multiple cursors" - (unless (and multiple-cursors-mode (called-interactively-p 'any)) - ad-do-it)))) + (put ',cmd 'mc--unsupported ,msg) + (advice-add ',cmd :around #'mc--unsupported-advice))) ;; Commands that does not work with multiple-cursors (unsupported-cmd isearch-forward ". Feel free to add a compatible version.") (unsupported-cmd isearch-backward ". Feel free to add a compatible version.") ;; Make sure pastes from other programs are added to all kill-rings when yanking -(defadvice current-kill (before interprogram-paste-for-all-cursors - (n &optional do-not-move) activate) +(advice-add 'current-kill :before #'mc--interprogram-paste-for-all-cursors) +(defun mc--interprogram-paste-for-all-cursors (n &rest _) + ;; FIXME: Shouldn't we check `multiple-cursors-mode' or something? (let ((interprogram-paste (and (= n 0) interprogram-paste-function (funcall interprogram-paste-function)))) @@ -825,7 +833,7 @@ from being executed if in multiple-cursors-mode." ;; something once. It is not a pure function. (let ((interprogram-cut-function nil)) (if (listp interprogram-paste) - (mapc 'kill-new (nreverse interprogram-paste)) + (mapc #'kill-new (nreverse interprogram-paste)) (kill-new interprogram-paste)) ;; And then add interprogram-paste to the kill-rings ;; of all the other cursors too. @@ -833,12 +841,13 @@ from being executed if in multiple-cursors-mode." (let ((kill-ring (overlay-get cursor 'kill-ring)) (kill-ring-yank-pointer (overlay-get cursor 'kill-ring-yank-pointer))) (if (listp interprogram-paste) - (mapc 'kill-new (nreverse interprogram-paste)) + (mapc #'kill-new (nreverse interprogram-paste)) (kill-new interprogram-paste)) (overlay-put cursor 'kill-ring kill-ring) (overlay-put cursor 'kill-ring-yank-pointer kill-ring-yank-pointer))))))) -(defadvice execute-extended-command (after execute-extended-command-for-all-cursors () activate) +(advice-add 'execute-extended-command :after #'mc--execute-extended-command-for-all-cursors) +(defun mc--execute-extended-command-for-all-cursors (&rest _) (when multiple-cursors-mode (unless (or mc/always-run-for-all (not (symbolp this-command)) @@ -868,7 +877,7 @@ for running commands with multiple cursors." (setq mc--list-file-loaded t))) (defun mc/dump-list (list-symbol) - "Insert (setq 'LIST-SYMBOL LIST-VALUE) to current buffer." + "Insert (setq LIST-SYMBOL LIST-VALUE) to current buffer." (cl-symbol-macrolet ((value (symbol-value list-symbol))) (insert "(setq " (symbol-name list-symbol) "\n" " '(") @@ -885,11 +894,10 @@ for running commands with multiple cursors." "Saves preferences for running commands with multiple cursors to `mc/list-file'" (with-temp-file mc/list-file (emacs-lisp-mode) - (insert ";; This file is automatically generated by the multiple-cursors extension.") - (newline) - (insert ";; It keeps track of your preferences for running commands with multiple cursors.") - (newline) - (newline) + (when (> emacs-major-version 30) + (insert ";; -*- lexical-binding: t; -*-\n")) + (insert ";; This file is automatically generated by the multiple-cursors extension.\n") + (insert ";; It keeps track of your preferences for running commands with multiple cursors.\n\n") (mc/dump-list 'mc/cmds-to-run-for-all) (newline) (mc/dump-list 'mc/cmds-to-run-once))) diff --git a/elpa/multiple-cursors-20250210.1813/multiple-cursors-pkg.el b/elpa/multiple-cursors-20260419.931/multiple-cursors-pkg.el similarity index 55% rename from elpa/multiple-cursors-20250210.1813/multiple-cursors-pkg.el rename to elpa/multiple-cursors-20260419.931/multiple-cursors-pkg.el index 486caefc..4326d343 100644 --- a/elpa/multiple-cursors-20250210.1813/multiple-cursors-pkg.el +++ b/elpa/multiple-cursors-20260419.931/multiple-cursors-pkg.el @@ -1,10 +1,11 @@ ;; -*- no-byte-compile: t; lexical-binding: nil -*- -(define-package "multiple-cursors" "20250210.1813" - "Multiple cursors for emacs." - '((cl-lib "0.5")) +(define-package "multiple-cursors" "20260419.931" + "Multiple cursors for Emacs." + '((emacs "24.4") + (cl-lib "0.5")) :url "https://github.com/magnars/multiple-cursors.el" - :commit "89f1a8df9b1fc721b1672b4c7b6d3ab451e7e3ef" - :revdesc "89f1a8df9b1f" + :commit "94b8b07a4bab87f803123723b68227565429dfa1" + :revdesc "94b8b07a4bab" :keywords '("editing" "cursors") :authors '(("Magnar Sveen" . "magnars@gmail.com")) :maintainers '(("Magnar Sveen" . "magnars@gmail.com"))) diff --git a/elpa/multiple-cursors-20250210.1813/multiple-cursors.el b/elpa/multiple-cursors-20260419.931/multiple-cursors.el similarity index 97% rename from elpa/multiple-cursors-20250210.1813/multiple-cursors.el rename to elpa/multiple-cursors-20260419.931/multiple-cursors.el index efedbc9e..d2291c17 100644 --- a/elpa/multiple-cursors-20250210.1813/multiple-cursors.el +++ b/elpa/multiple-cursors-20260419.931/multiple-cursors.el @@ -1,11 +1,11 @@ -;;; multiple-cursors.el --- Multiple cursors for emacs. +;;; multiple-cursors.el --- Multiple cursors for Emacs -*- lexical-binding: t; -*- ;; Copyright (C) 2012-2016 Magnar Sveen ;; Author: Magnar Sveen -;; Package-Version: 20250210.1813 -;; Package-Revision: 89f1a8df9b1f -;; Package-Requires: ((cl-lib "0.5")) +;; Package-Version: 20260419.931 +;; Package-Revision: 94b8b07a4bab +;; Package-Requires: ((emacs "24.4") (cl-lib "0.5")) ;; Keywords: editing cursors ;; Homepage: https://github.com/magnars/multiple-cursors.el diff --git a/elpa/multiple-cursors-20250210.1813/rectangular-region-mode.el b/elpa/multiple-cursors-20260419.931/rectangular-region-mode.el similarity index 77% rename from elpa/multiple-cursors-20250210.1813/rectangular-region-mode.el rename to elpa/multiple-cursors-20260419.931/rectangular-region-mode.el index e4683cfa..ad865ea5 100644 --- a/elpa/multiple-cursors-20250210.1813/rectangular-region-mode.el +++ b/elpa/multiple-cursors-20260419.931/rectangular-region-mode.el @@ -1,4 +1,4 @@ -;;; rectangular-region-mode.el +;;; rectangular-region-mode.el -*- lexical-binding: t; -*- ;; Copyright (C) 2012-2016 Magnar Sveen @@ -35,8 +35,8 @@ (defvar rectangular-region-mode-map (make-sparse-keymap) "Keymap for rectangular region is mainly for rebinding C-g") -(define-key rectangular-region-mode-map (kbd "C-g") 'rrm/keyboard-quit) -(define-key rectangular-region-mode-map (kbd "") 'rrm/switch-to-multiple-cursors) +(define-key rectangular-region-mode-map (kbd "C-g") #'rrm/keyboard-quit) +(define-key rectangular-region-mode-map (kbd "") #'rrm/switch-to-multiple-cursors) (defvar rectangular-region-mode nil) @@ -71,16 +71,17 @@ multiple cursors to multiple lines." (defun rrm/repaint () "Start from the anchor and draw a rectangle between it and point." (if (not rectangular-region-mode) - (remove-hook 'post-command-hook 'rrm/repaint t) + (remove-hook 'post-command-hook #'rrm/repaint t) ;; else + (defvar annoying-arrows-mode) (rrm/remove-rectangular-region-overlays) (let* ((annoying-arrows-mode nil) (point-column (current-column)) (point-line (mc/line-number-at-pos)) (anchor-column (save-excursion (goto-char rrm/anchor) (current-column))) (anchor-line (save-excursion (goto-char rrm/anchor) (mc/line-number-at-pos))) - (left-column (if (< point-column anchor-column) point-column anchor-column)) - (right-column (if (> point-column anchor-column) point-column anchor-column)) + ;; (left-column (if (< point-column anchor-column) point-column anchor-column)) + ;; (right-column (if (> point-column anchor-column) point-column anchor-column)) (navigation-step (if (< point-line anchor-line) 1 -1))) (move-to-column anchor-column) (set-mark (point)) @@ -95,17 +96,15 @@ multiple cursors to multiple lines." (when (= point-column (current-column)) (mc/create-fake-cursor-at-point)))))))) -(defun rrm/switch-to-multiple-cursors (&rest forms) - "Switch from rectangular-region-mode to multiple-cursors-mode." +(defun rrm/switch-to-multiple-cursors (&rest _) + "Switch from `rectangular-region-mode' to `multiple-cursors-mode'." (interactive) (rectangular-region-mode 0) (multiple-cursors-mode 1)) -(defadvice er/expand-region (before switch-from-rrm-to-mc activate) - (when rectangular-region-mode - (rrm/switch-to-multiple-cursors))) - -(defadvice kill-ring-save (before switch-from-rrm-to-mc activate) +(advice-add 'er/expand-region :before #'rrm//switch-from-rrm-to-mc) +(advice-add 'kill-ring-save :before #'rrm//switch-from-rrm-to-mc) +(defun rrm//switch-from-rrm-to-mc (&rest _) (when rectangular-region-mode (rrm/switch-to-multiple-cursors))) @@ -117,10 +116,10 @@ multiple cursors to multiple lines." :keymap rectangular-region-mode-map (if rectangular-region-mode (progn - (add-hook 'after-change-functions 'rrm/switch-to-multiple-cursors t t) - (add-hook 'post-command-hook 'rrm/repaint t t)) - (remove-hook 'after-change-functions 'rrm/switch-to-multiple-cursors t) - (remove-hook 'post-command-hook 'rrm/repaint t) + (add-hook 'after-change-functions #'rrm/switch-to-multiple-cursors t t) + (add-hook 'post-command-hook #'rrm/repaint t t)) + (remove-hook 'after-change-functions #'rrm/switch-to-multiple-cursors t) + (remove-hook 'post-command-hook #'rrm/repaint t) (set-marker rrm/anchor nil))) (provide 'rectangular-region-mode) -- 2.47.3