From d609a2b8463f70939d930077295640895a740dcb Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Tue, 13 Nov 2018 11:11:48 +0100 Subject: [PATCH] update multiple-cursors. Signed-off-by: Andreas Gerler --- .../multiple-cursors-pkg.el | 5 - .../mc-cycle-cursors.el | 2 +- .../mc-edit-lines.el | 2 +- .../mc-hide-unmatched-lines-mode.el | 0 .../mc-mark-more.el | 112 +++++++++++++----- .../mc-mark-pop.el | 0 .../mc-separate-operations.el | 40 ++++--- .../multiple-cursors-autoloads.el | 83 ++++++++++--- .../multiple-cursors-core.el | 72 +++++++++-- .../multiple-cursors-pkg.el | 5 + .../multiple-cursors.el | 8 +- .../rectangular-region-mode.el | 2 +- 12 files changed, 245 insertions(+), 86 deletions(-) delete mode 100644 elpa/multiple-cursors-20160513.316/multiple-cursors-pkg.el rename elpa/{multiple-cursors-20160513.316 => multiple-cursors-20180913.1237}/mc-cycle-cursors.el (99%) rename elpa/{multiple-cursors-20160513.316 => multiple-cursors-20180913.1237}/mc-edit-lines.el (98%) rename elpa/{multiple-cursors-20160513.316 => multiple-cursors-20180913.1237}/mc-hide-unmatched-lines-mode.el (100%) rename elpa/{multiple-cursors-20160513.316 => multiple-cursors-20180913.1237}/mc-mark-more.el (85%) rename elpa/{multiple-cursors-20160513.316 => multiple-cursors-20180913.1237}/mc-mark-pop.el (100%) rename elpa/{multiple-cursors-20160513.316 => multiple-cursors-20180913.1237}/mc-separate-operations.el (87%) rename elpa/{multiple-cursors-20160513.316 => multiple-cursors-20180913.1237}/multiple-cursors-autoloads.el (71%) rename elpa/{multiple-cursors-20160513.316 => multiple-cursors-20180913.1237}/multiple-cursors-core.el (92%) create mode 100644 elpa/multiple-cursors-20180913.1237/multiple-cursors-pkg.el rename elpa/{multiple-cursors-20160513.316 => multiple-cursors-20180913.1237}/multiple-cursors.el (98%) rename elpa/{multiple-cursors-20160513.316 => multiple-cursors-20180913.1237}/rectangular-region-mode.el (99%) diff --git a/elpa/multiple-cursors-20160513.316/multiple-cursors-pkg.el b/elpa/multiple-cursors-20160513.316/multiple-cursors-pkg.el deleted file mode 100644 index 01d39eb1..00000000 --- a/elpa/multiple-cursors-20160513.316/multiple-cursors-pkg.el +++ /dev/null @@ -1,5 +0,0 @@ -(define-package "multiple-cursors" "20160513.316" "Multiple cursors for Emacs." - '((cl-lib "0.5"))) -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/elpa/multiple-cursors-20160513.316/mc-cycle-cursors.el b/elpa/multiple-cursors-20180913.1237/mc-cycle-cursors.el similarity index 99% rename from elpa/multiple-cursors-20160513.316/mc-cycle-cursors.el rename to elpa/multiple-cursors-20180913.1237/mc-cycle-cursors.el index 01597ac5..85af3529 100644 --- a/elpa/multiple-cursors-20160513.316/mc-cycle-cursors.el +++ b/elpa/multiple-cursors-20180913.1237/mc-cycle-cursors.el @@ -1,6 +1,6 @@ ;;; mc-cycle-cursors.el -;; Copyright (C) 2012 Magnar Sveen +;; Copyright (C) 2012-2016 Magnar Sveen ;; Author: Magnar Sveen ;; Keywords: editing cursors diff --git a/elpa/multiple-cursors-20160513.316/mc-edit-lines.el b/elpa/multiple-cursors-20180913.1237/mc-edit-lines.el similarity index 98% rename from elpa/multiple-cursors-20160513.316/mc-edit-lines.el rename to elpa/multiple-cursors-20180913.1237/mc-edit-lines.el index 20668cfa..e38d1c18 100644 --- a/elpa/multiple-cursors-20160513.316/mc-edit-lines.el +++ b/elpa/multiple-cursors-20180913.1237/mc-edit-lines.el @@ -1,6 +1,6 @@ ;;; mc-edit-lines.el -;; Copyright (C) 2012 Magnar Sveen +;; Copyright (C) 2012-2016 Magnar Sveen ;; Author: Magnar Sveen ;; Keywords: editing cursors diff --git a/elpa/multiple-cursors-20160513.316/mc-hide-unmatched-lines-mode.el b/elpa/multiple-cursors-20180913.1237/mc-hide-unmatched-lines-mode.el similarity index 100% rename from elpa/multiple-cursors-20160513.316/mc-hide-unmatched-lines-mode.el rename to elpa/multiple-cursors-20180913.1237/mc-hide-unmatched-lines-mode.el diff --git a/elpa/multiple-cursors-20160513.316/mc-mark-more.el b/elpa/multiple-cursors-20180913.1237/mc-mark-more.el similarity index 85% rename from elpa/multiple-cursors-20160513.316/mc-mark-more.el rename to elpa/multiple-cursors-20180913.1237/mc-mark-more.el index 9f31262a..da8cedf3 100644 --- a/elpa/multiple-cursors-20160513.316/mc-mark-more.el +++ b/elpa/multiple-cursors-20180913.1237/mc-mark-more.el @@ -1,6 +1,6 @@ ;;; mc-mark-more.el -;; Copyright (C) 2012 Magnar Sveen +;; Copyright (C) 2012-2016 Magnar Sveen ;; Author: Magnar Sveen ;; Keywords: editing cursors @@ -56,7 +56,7 @@ (defun mc/furthest-cursor-before-point () (let ((beg (if mark-active (min (mark) (point)) (point))) - furthest) + furthest) (mc/for-each-fake-cursor (when (< (mc/cursor-beg cursor) beg) (setq beg (mc/cursor-beg cursor)) @@ -65,7 +65,7 @@ (defun mc/furthest-cursor-after-point () (let ((end (if mark-active (max (mark) (point)) (point))) - furthest) + furthest) (mc/for-each-fake-cursor (when (> (mc/cursor-end cursor) end) (setq end (mc/cursor-end cursor)) @@ -131,7 +131,7 @@ Use like case-fold-search, don't recommend setting it globally.") (when point-out-of-order (exchange-point-and-mark)) (mc/create-fake-cursor-at-point)) - (error "no more matches found.")))))) + (user-error "no more matches found.")))))) ;;;###autoload (defun mc/mark-next-like-this (arg) @@ -142,9 +142,9 @@ With zero ARG, skip the last one and mark next." (interactive "p") (if (< arg 0) (let ((cursor (mc/furthest-cursor-after-point))) - (if cursor - (mc/remove-fake-cursor cursor) - (error "No cursors to be unmarked"))) + (if cursor + (mc/remove-fake-cursor cursor) + (error "No cursors to be unmarked"))) (if (region-active-p) (mc/mark-more-like-this (= arg 0) 'forwards) (mc/mark-lines arg 'forwards))) @@ -159,9 +159,9 @@ With zero ARG, skip the last one and mark next." (interactive "p") (if (< arg 0) (let ((cursor (mc/furthest-cursor-after-point))) - (if cursor - (mc/remove-fake-cursor cursor) - (error "No cursors to be unmarked"))) + (if cursor + (mc/remove-fake-cursor cursor) + (error "No cursors to be unmarked"))) (if (region-active-p) (mc/mark-more-like-this (= arg 0) 'forwards) (mc--select-thing-at-point 'word) @@ -176,9 +176,9 @@ With zero ARG, skip the last one and mark next." (interactive "p") (if (< arg 0) (let ((cursor (mc/furthest-cursor-after-point))) - (if cursor - (mc/remove-fake-cursor cursor) - (error "No cursors to be unmarked"))) + (if cursor + (mc/remove-fake-cursor cursor) + (error "No cursors to be unmarked"))) (if (region-active-p) (mc/mark-more-like-this (= arg 0) 'forwards) (mc--select-thing-at-point 'symbol) @@ -188,12 +188,22 @@ With zero ARG, skip the last one and mark next." ;;;###autoload (defun mc/mark-next-word-like-this (arg) + "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, mark the symbol 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." (interactive "p") (let ((mc/enclose-search-term 'words)) (mc/mark-next-like-this arg))) ;;;###autoload (defun mc/mark-next-symbol-like-this (arg) + "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, mark the symbol 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." (interactive "p") (let ((mc/enclose-search-term 'symbols)) (mc/mark-next-like-this arg))) @@ -201,27 +211,74 @@ With zero ARG, skip the last one and mark next." ;;;###autoload (defun mc/mark-previous-like-this (arg) "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 With negative ARG, delete the last one instead. With zero ARG, skip the last one and mark next." (interactive "p") (if (< arg 0) (let ((cursor (mc/furthest-cursor-before-point))) - (if cursor - (mc/remove-fake-cursor cursor) - (error "No cursors to be unmarked"))) + (if cursor + (mc/remove-fake-cursor cursor) + (error "No cursors to be unmarked"))) (if (region-active-p) (mc/mark-more-like-this (= arg 0) 'backwards) (mc/mark-lines arg 'backwards))) (mc/maybe-multiple-cursors-mode)) +;;;###autoload +(defun mc/mark-previous-like-this-word (arg) + "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 previous match +With negative ARG, delete the last one instead. +With zero ARG, skip the last one and mark previous." + (interactive "p") + (if (< arg 0) + (let ((cursor (mc/furthest-cursor-after-point))) + (if cursor + (mc/remove-fake-cursor cursor) + (error "No cursors to be unmarked"))) + (if (region-active-p) + (mc/mark-more-like-this (= arg 0) 'backwards) + (mc--select-thing-at-point 'word) + (mc/mark-more-like-this (= arg 0) 'backwards))) + (mc/maybe-multiple-cursors-mode)) + +(defun mc/mark-previous-like-this-symbol (arg) + "Find and mark the previous part of the buffer matching the currently active region +If no region is active, mark the symbol at the point and find the previous match +With negative ARG, delete the last one instead. +With zero ARG, skip the last one and mark previous." + (interactive "p") + (if (< arg 0) + (let ((cursor (mc/furthest-cursor-after-point))) + (if cursor + (mc/remove-fake-cursor cursor) + (error "No cursors to be unmarked"))) + (if (region-active-p) + (mc/mark-more-like-this (= arg 0) 'backwards) + (mc--select-thing-at-point 'symbol) + (mc/mark-more-like-this (= arg 0) 'backwards))) + (mc/maybe-multiple-cursors-mode)) + + ;;;###autoload (defun mc/mark-previous-word-like-this (arg) + "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 +If no region is active add a cursor on the previous line +With negative ARG, delete the last one instead. +With zero ARG, skip the last one and mark next." (interactive "p") (let ((mc/enclose-search-term 'words)) (mc/mark-previous-like-this arg))) ;;;###autoload (defun mc/mark-previous-symbol-like-this (arg) + "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 +If no region is active add a cursor on the previous line +With negative ARG, delete the last one instead. +With zero ARG, skip the last one and mark next." (interactive "p") (let ((mc/enclose-search-term 'symbols)) (mc/mark-previous-like-this arg))) @@ -230,8 +287,8 @@ With zero ARG, skip the last one and mark next." (dotimes (i (if (= num-lines 0) 1 num-lines)) (mc/save-excursion (let ((furthest-cursor (cl-ecase direction - (forwards (mc/furthest-cursor-after-point)) - (backwards (mc/furthest-cursor-before-point))))) + (forwards (mc/furthest-cursor-after-point)) + (backwards (mc/furthest-cursor-before-point))))) (when (overlayp furthest-cursor) (goto-char (overlay-get furthest-cursor 'point)) (when (= num-lines 0) @@ -366,16 +423,13 @@ With zero ARG, skip the last one and mark next." (setq lastmatch (point)) (when (= (point) (match-beginning 0)) (forward-char))) - (when lastmatch (goto-char lastmatch))) - (when (> (mc/num-cursors) 0) - (goto-char (match-end 0))) - (let ((first (mc/furthest-cursor-before-point))) - (if (not first) - (error "Search failed for %S" search) - (mc/pop-state-from-overlay first))) - (if (> (mc/num-cursors) 1) - (multiple-cursors-mode 1) - (multiple-cursors-mode 0)))))) + (unless lastmatch + (error "Search failed for %S" search))) + (goto-char (match-end 0)) + (if (< (mc/num-cursors) 3) + (multiple-cursors-mode 0) + (mc/pop-state-from-overlay (mc/furthest-cursor-before-point)) + (multiple-cursors-mode 1)))))) (when (not (fboundp 'set-temporary-overlay-map)) ;; Backport this function from newer emacs versions @@ -529,7 +583,7 @@ If the region is inactive or on a single line, it will behave like (line-number-at-pos (region-end))))) (if arg (call-interactively 'mc/edit-lines) - (call-interactively 'mc/mark-all-in-region)) + (call-interactively 'mc/mark-all-in-region)) (progn (setq this-command 'mc/mark-all-like-this-dwim) (mc/mark-all-like-this-dwim arg)))) diff --git a/elpa/multiple-cursors-20160513.316/mc-mark-pop.el b/elpa/multiple-cursors-20180913.1237/mc-mark-pop.el similarity index 100% rename from elpa/multiple-cursors-20160513.316/mc-mark-pop.el rename to elpa/multiple-cursors-20180913.1237/mc-mark-pop.el diff --git a/elpa/multiple-cursors-20160513.316/mc-separate-operations.el b/elpa/multiple-cursors-20180913.1237/mc-separate-operations.el similarity index 87% rename from elpa/multiple-cursors-20160513.316/mc-separate-operations.el rename to elpa/multiple-cursors-20180913.1237/mc-separate-operations.el index 487a6506..07ce9285 100644 --- a/elpa/multiple-cursors-20160513.316/mc-separate-operations.el +++ b/elpa/multiple-cursors-20180913.1237/mc-separate-operations.el @@ -1,6 +1,6 @@ ;;; mc-separate-operations.el - functions that work differently on each cursor -;; Copyright (C) 2012 Magnar Sveen +;; Copyright (C) 2012-2016 Magnar Sveen ;; Author: Magnar Sveen ;; Keywords: editing cursors @@ -29,17 +29,24 @@ (require 'multiple-cursors-core) +(defcustom mc/insert-numbers-default 0 + "The default number at which to start counting for +`mc/insert-numbers'" + :type 'integer + :group 'multiple-cursors) + +(defvar mc--insert-numbers-number 0) + ;;;###autoload (defun mc/insert-numbers (arg) - "Insert increasing numbers for each cursor, starting at 0 or ARG." + "Insert increasing numbers for each cursor, starting at +`mc/insert-numbers-default' or ARG." (interactive "P") (setq mc--insert-numbers-number (or (and arg (prefix-numeric-value arg)) - 0)) + mc/insert-numbers-default)) (mc/for-each-cursor-ordered (mc/execute-command-for-fake-cursor 'mc--insert-number-and-increase cursor))) -(defvar mc--insert-numbers-number 0) - (defun mc--insert-number-and-increase () (interactive) (insert (number-to-string mc--insert-numbers-number)) @@ -54,6 +61,8 @@ (mc/cursor-end cursor)) strings)))) (nreverse strings))) +(defvar mc--insert-letters-number 0) + ;;;###autoload (defun mc/insert-letters (arg) "Insert increasing letters for each cursor, starting at 0 or ARG. @@ -66,15 +75,13 @@ (defun mc--number-to-letters (number) (let ((letter - (char-to-string - (+ (mod number 26) ?a))) - (number2 (/ number 26))) + (char-to-string + (+ (mod number 26) ?a))) + (number2 (/ number 26))) (if (> number2 0) - (concat (mc--number-to-letters (- number2 1)) letter) + (concat (mc--number-to-letters (- number2 1)) letter) letter))) -(defvar mc--insert-letters-number 0) - (defun mc--insert-letter-and-increase () (interactive) (insert (mc--number-to-letters mc--insert-letters-number)) @@ -130,19 +137,14 @@ Might not behave as intended if more than one cursors are on the same line." (lambda () (interactive) (let ((missing-spaces (- rightest-column (current-column)))) - (save-excursion (insert (make-string missing-spaces character))) - (forward-char missing-spaces) - ) - )) - ) - ) + (save-excursion (insert (make-string missing-spaces character))) + (forward-char missing-spaces)))))) ;;;###autoload (defun mc/vertical-align-with-space () "Aligns all cursors with whitespace like `mc/vertical-align' does" (interactive) - (mc/vertical-align 32) - ) + (mc/vertical-align 32)) (provide 'mc-separate-operations) ;;; mc-separate-operations.el ends here diff --git a/elpa/multiple-cursors-20160513.316/multiple-cursors-autoloads.el b/elpa/multiple-cursors-20180913.1237/multiple-cursors-autoloads.el similarity index 71% rename from elpa/multiple-cursors-20160513.316/multiple-cursors-autoloads.el rename to elpa/multiple-cursors-20180913.1237/multiple-cursors-autoloads.el index 9f1424c4..492b41a2 100644 --- a/elpa/multiple-cursors-20160513.316/multiple-cursors-autoloads.el +++ b/elpa/multiple-cursors-20180913.1237/multiple-cursors-autoloads.el @@ -1,10 +1,20 @@ ;;; multiple-cursors-autoloads.el --- automatically extracted autoloads ;; ;;; Code: -(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) + +(add-to-list 'load-path (directory-file-name + (or (file-name-directory #$) (car load-path)))) + + +;;;### (autoloads nil "mc-cycle-cursors" "mc-cycle-cursors.el" (0 +;;;;;; 0 0 0)) +;;; Generated autoloads from mc-cycle-cursors.el + +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "mc-cycle-cursors" '("mc/"))) + +;;;*** -;;;### (autoloads nil "mc-edit-lines" "mc-edit-lines.el" (22332 35667 -;;;;;; 0 0)) +;;;### (autoloads nil "mc-edit-lines" "mc-edit-lines.el" (0 0 0 0)) ;;; Generated autoloads from mc-edit-lines.el (autoload 'mc/edit-lines "mc-edit-lines" "\ @@ -31,10 +41,12 @@ Add one cursor to the beginning of each line in the active region. \(fn)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "mc-edit-lines" '("mc/edit-lines-empty-lines"))) + ;;;*** ;;;### (autoloads nil "mc-hide-unmatched-lines-mode" "mc-hide-unmatched-lines-mode.el" -;;;;;; (22332 35667 0 0)) +;;;;;; (0 0 0 0)) ;;; Generated autoloads from mc-hide-unmatched-lines-mode.el (autoload 'mc-hide-unmatched-lines-mode "mc-hide-unmatched-lines-mode" "\ @@ -46,10 +58,11 @@ mode. To leave this mode press or \"C-g\" \(fn &optional ARG)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "mc-hide-unmatched-lines-mode" '("hum/"))) + ;;;*** -;;;### (autoloads nil "mc-mark-more" "mc-mark-more.el" (22332 35667 -;;;;;; 0 0)) +;;;### (autoloads nil "mc-mark-more" "mc-mark-more.el" (0 0 0 0)) ;;; Generated autoloads from mc-mark-more.el (autoload 'mc/mark-next-like-this "mc-mark-more" "\ @@ -69,29 +82,54 @@ With zero ARG, skip the last one and mark next. \(fn ARG)" t nil) (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, mark the symbol 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 nil) (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, mark the symbol 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 nil) (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 With negative ARG, delete the last one instead. With zero ARG, skip the last one and mark next. \(fn ARG)" t nil) -(autoload 'mc/mark-previous-word-like-this "mc-mark-more" "\ +(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 previous match +With negative ARG, delete the last one instead. +With zero ARG, skip the last one and mark previous. + +\(fn ARG)" t nil) +(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 +If no region is active add a cursor on the previous line +With negative ARG, delete the last one instead. +With zero ARG, skip the last one and mark next. \(fn ARG)" t nil) (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 +If no region is active add a cursor on the previous line +With negative ARG, delete the last one instead. +With zero ARG, skip the last one and mark next. \(fn ARG)" t nil) @@ -219,10 +257,11 @@ Mark the tag we're in and its pair for renaming. \(fn)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "mc-mark-more" '("mc/" "mc--"))) + ;;;*** -;;;### (autoloads nil "mc-mark-pop" "mc-mark-pop.el" (22332 35667 -;;;;;; 0 0)) +;;;### (autoloads nil "mc-mark-pop" "mc-mark-pop.el" (0 0 0 0)) ;;; Generated autoloads from mc-mark-pop.el (autoload 'mc/mark-pop "mc-mark-pop" "\ @@ -234,11 +273,12 @@ to the popped mark. ;;;*** ;;;### (autoloads nil "mc-separate-operations" "mc-separate-operations.el" -;;;;;; (22332 35667 0 0)) +;;;;;; (0 0 0 0)) ;;; Generated autoloads from mc-separate-operations.el (autoload 'mc/insert-numbers "mc-separate-operations" "\ -Insert increasing numbers for each cursor, starting at 0 or ARG. +Insert increasing numbers for each cursor, starting at +`mc/insert-numbers-default' or ARG. \(fn ARG)" t nil) @@ -270,10 +310,12 @@ Aligns all cursors with whitespace like `mc/vertical-align' does \(fn)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "mc-separate-operations" '("mc/insert-numbers-default" "mc--"))) + ;;;*** ;;;### (autoloads nil "multiple-cursors-core" "multiple-cursors-core.el" -;;;;;; (22332 35667 0 0)) +;;;;;; (0 0 0 0)) ;;; Generated autoloads from multiple-cursors-core.el (autoload 'multiple-cursors-mode "multiple-cursors-core" "\ @@ -281,10 +323,12 @@ Mode while multiple cursors are active. \(fn &optional ARG)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "multiple-cursors-core" '("multiple-cursors-mode" "unsupported-cmd" "deactivate-cursor-after-undo" "activate-cursor-for-undo"))) + ;;;*** ;;;### (autoloads nil "rectangular-region-mode" "rectangular-region-mode.el" -;;;;;; (22332 35667 0 0)) +;;;;;; (0 0 0 0)) ;;; Generated autoloads from rectangular-region-mode.el (autoload 'set-rectangular-region-anchor "rectangular-region-mode" "\ @@ -300,10 +344,12 @@ A mode for creating a rectangular region to edit \(fn &optional ARG)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "rectangular-region-mode" '("rectangular-region-mode" "rrm/"))) + ;;;*** -;;;### (autoloads nil nil ("mc-cycle-cursors.el" "multiple-cursors-pkg.el" -;;;;;; "multiple-cursors.el") (22332 35667 400935 0)) +;;;### (autoloads nil nil ("multiple-cursors-pkg.el" "multiple-cursors.el") +;;;;;; (0 0 0 0)) ;;;*** @@ -311,5 +357,6 @@ A mode for creating a rectangular region to edit ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t +;; coding: utf-8 ;; End: ;;; multiple-cursors-autoloads.el ends here diff --git a/elpa/multiple-cursors-20160513.316/multiple-cursors-core.el b/elpa/multiple-cursors-20180913.1237/multiple-cursors-core.el similarity index 92% rename from elpa/multiple-cursors-20160513.316/multiple-cursors-core.el rename to elpa/multiple-cursors-20180913.1237/multiple-cursors-core.el index 09b1b018..4ca8e757 100644 --- a/elpa/multiple-cursors-20160513.316/multiple-cursors-core.el +++ b/elpa/multiple-cursors-20180913.1237/multiple-cursors-core.el @@ -1,6 +1,6 @@ ;;; multiple-cursors-core.el --- An experiment in multiple cursors for emacs. -;; Copyright (C) 2012 Magnar Sveen +;; Copyright (C) 2012-2016 Magnar Sveen ;; Author: Magnar Sveen ;; Keywords: editing cursors @@ -35,6 +35,11 @@ "The face used for fake cursors" :group 'multiple-cursors) +(defface mc/cursor-bar-face + `((t (:height 1 :background ,(face-attribute 'cursor :background)))) + "The face used for fake cursors if the cursor-type is bar" + :group 'multiple-cursors) + (defface mc/region-face '((t :inherit region)) "The face used for fake regions" @@ -98,16 +103,26 @@ (set-marker ,p nil) (set-marker ,s nil)))) +(defun mc/cursor-is-bar () + "Return non-nil if the cursor is a bar." + (or (eq cursor-type 'bar) + (and (listp cursor-type) + (eq (car cursor-type) 'bar)))) + (defun mc/make-cursor-overlay-at-eol (pos) "Create overlay to look like cursor at end of line." (let ((overlay (make-overlay pos pos nil nil nil))) - (overlay-put overlay 'after-string (propertize " " 'face 'mc/cursor-face)) + (if (mc/cursor-is-bar) + (overlay-put overlay 'before-string (propertize "|" 'face 'mc/cursor-bar-face)) + (overlay-put overlay 'after-string (propertize " " 'face 'mc/cursor-face))) overlay)) (defun mc/make-cursor-overlay-inline (pos) "Create overlay to look like cursor inside text." (let ((overlay (make-overlay pos (1+ pos) nil nil nil))) - (overlay-put overlay 'face 'mc/cursor-face) + (if (mc/cursor-is-bar) + (overlay-put overlay 'before-string (propertize "|" 'face 'mc/cursor-bar-face)) + (overlay-put overlay 'face 'mc/cursor-face)) overlay)) (defun mc/make-cursor-overlay-at-point () @@ -133,13 +148,16 @@ highlights the entire width of the window." yank-undo-function autopair-action autopair-wrap-action + temporary-goal-column er/history) "A list of vars that need to be tracked on a per-cursor basis.") (defun mc/store-current-state-in-overlay (o) "Store relevant info about point and mark in the given overlay." (overlay-put o 'point (set-marker (make-marker) (point))) - (overlay-put o 'mark (set-marker (make-marker) (mark))) + (overlay-put o 'mark (set-marker (make-marker) + (let ((mark-even-if-inactive t)) + (mark)))) (dolist (var mc/cursor-specific-vars) (when (boundp var) (overlay-put o var (symbol-value var)))) o) @@ -310,6 +328,16 @@ cursor with updated info." (mc/pop-state-from-overlay mc--stored-state-for-undo) (setq mc--stored-state-for-undo nil))) +(defcustom mc/always-run-for-all nil + "Disables whitelisting and always executes commands for every fake cursor." + :type '(boolean) + :group 'multiple-cursors) + +(defcustom mc/always-repeat-command nil + "Disables confirmation for `mc/repeat-command' command." + :type '(boolean) + :group 'multiple-cursors) + (defun mc/prompt-for-inclusion-in-whitelist (original-command) "Asks the user, then adds the command either to the once-list or the all-list." (let ((all-p (y-or-n-p (format "Do %S for all cursors?" original-command)))) @@ -399,7 +427,8 @@ the original cursor, to inform about the lack of support." (when (and original-command (not (memq original-command mc--default-cmds-to-run-once)) (not (memq original-command mc/cmds-to-run-once)) - (or (memq original-command mc--default-cmds-to-run-for-all) + (or mc/always-run-for-all + (memq original-command mc--default-cmds-to-run-for-all) (memq original-command mc/cmds-to-run-for-all) (mc/prompt-for-inclusion-in-whitelist original-command))) (mc/execute-command-for-all-fake-cursors original-command)))))))))) @@ -421,6 +450,17 @@ you should disable multiple-cursors-mode." (multiple-cursors-mode 0) (deactivate-mark))) +(defun mc/repeat-command () + "Run last command from `command-history' for every fake cursor." + (interactive) + (when (or mc/always-repeat-command + (y-or-n-p (format "[mc] repeat complex command: %s? " (caar command-history)))) + (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)))) + (repeat-complex-command 0)))))) + (defvar mc/keymap nil "Keymap while multiple cursors are active. Main goal of the keymap is to rebind C-g and to conclude @@ -429,6 +469,7 @@ multiple cursors editing.") (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) (when (fboundp 'phi-search) (define-key mc/keymap (kbd "C-s") 'phi-search)) (when (fboundp 'phi-search-backward) @@ -530,7 +571,8 @@ from being executed if in multiple-cursors-mode." (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 activate) +(defadvice current-kill (before interprogram-paste-for-all-cursors + (n &optional do-not-move) activate) (let ((interprogram-paste (and (= n 0) interprogram-paste-function (funcall interprogram-paste-function)))) @@ -554,9 +596,11 @@ from being executed if in multiple-cursors-mode." (overlay-put cursor 'kill-ring kill-ring) (overlay-put cursor 'kill-ring-yank-pointer kill-ring-yank-pointer))))))) -(defvar mc/list-file (locate-user-emacs-file ".mc-lists.el") +(defcustom mc/list-file (locate-user-emacs-file ".mc-lists.el") "The position of the file that keeps track of your preferences -for running commands with multiple cursors.") +for running commands with multiple cursors." + :type 'file + :group 'multiple-cursors) (defun mc/dump-list (list-symbol) "Insert (setq 'LIST-SYMBOL LIST-VALUE) to current buffer." @@ -600,6 +644,8 @@ for running commands with multiple cursors.") mc/mark-next-word-like-this mc/mark-next-symbol-like-this mc/mark-previous-like-this + mc/mark-previous-like-this-word + mc/mark-previous-like-this-symbol mc/mark-previous-word-like-this mc/mark-previous-symbol-like-this mc/mark-all-like-this @@ -631,13 +677,16 @@ for running commands with multiple cursors.") mc/skip-to-previous-like-this rrm/switch-to-multiple-cursors mc-hide-unmatched-lines-mode + mc/repeat-command hum/keyboard-quit hum/unhide-invisible-overlays save-buffer ido-exit-minibuffer + ivy-done exit-minibuffer minibuffer-complete-and-exit execute-extended-command + eval-expression undo redo undo-tree-undo @@ -671,7 +720,8 @@ for running commands with multiple cursors.") windmove-left windmove-right windmove-up - windmove-down)) + windmove-down + repeat-complex-command)) (defvar mc--default-cmds-to-run-for-all nil "Default set of commands that should be mirrored by all cursors") @@ -756,7 +806,9 @@ for running commands with multiple cursors.") (defvar mc/cmds-to-run-for-all nil "Commands to run for all cursors in multiple-cursors-mode") -(load mc/list-file t) ;; load, but no errors if it does not exist yet please +;; load, but no errors if it does not exist yet please, and no message +;; while loading +(load mc/list-file 'noerror 'nomessage) (provide 'multiple-cursors-core) diff --git a/elpa/multiple-cursors-20180913.1237/multiple-cursors-pkg.el b/elpa/multiple-cursors-20180913.1237/multiple-cursors-pkg.el new file mode 100644 index 00000000..af9fd61f --- /dev/null +++ b/elpa/multiple-cursors-20180913.1237/multiple-cursors-pkg.el @@ -0,0 +1,5 @@ +(define-package "multiple-cursors" "20180913.1237" "Multiple cursors for Emacs." + '((cl-lib "0.5"))) +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/multiple-cursors-20160513.316/multiple-cursors.el b/elpa/multiple-cursors-20180913.1237/multiple-cursors.el similarity index 98% rename from elpa/multiple-cursors-20160513.316/multiple-cursors.el rename to elpa/multiple-cursors-20180913.1237/multiple-cursors.el index 675cf38e..92e8f5bf 100644 --- a/elpa/multiple-cursors-20160513.316/multiple-cursors.el +++ b/elpa/multiple-cursors-20180913.1237/multiple-cursors.el @@ -1,9 +1,9 @@ ;;; multiple-cursors.el --- Multiple cursors for emacs. -;; Copyright (C) 2012-2013 Magnar Sveen +;; Copyright (C) 2012-2016 Magnar Sveen ;; Author: Magnar Sveen -;; Version: 1.2.2 +;; Version: 1.4.0 ;; Keywords: editing cursors ;; This program is free software; you can redistribute it and/or modify @@ -186,6 +186,10 @@ ;;; Code: +(defgroup multiple-cursors nil + "Multiple cursors for emacs." + :group 'editing) + (require 'mc-edit-lines) (require 'mc-cycle-cursors) (require 'mc-mark-more) diff --git a/elpa/multiple-cursors-20160513.316/rectangular-region-mode.el b/elpa/multiple-cursors-20180913.1237/rectangular-region-mode.el similarity index 99% rename from elpa/multiple-cursors-20160513.316/rectangular-region-mode.el rename to elpa/multiple-cursors-20180913.1237/rectangular-region-mode.el index 8cbe1ded..01a078d1 100644 --- a/elpa/multiple-cursors-20160513.316/rectangular-region-mode.el +++ b/elpa/multiple-cursors-20180913.1237/rectangular-region-mode.el @@ -1,6 +1,6 @@ ;;; rectangular-region-mode.el -;; Copyright (C) 2012 Magnar Sveen +;; Copyright (C) 2012-2016 Magnar Sveen ;; Author: Magnar Sveen ;; Keywords: editing cursors -- 2.47.3