From 8a52b1c84eb9a33caea4b87e23396e0ad4ac33c8 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Thu, 31 Oct 2019 16:56:11 +0100 Subject: [PATCH] update multiple-cursors --- .../multiple-cursors-pkg.el | 5 -- .../mc-cycle-cursors.el | 0 .../mc-edit-lines.el | 6 +-- .../mc-hide-unmatched-lines-mode.el | 0 .../mc-mark-more.el | 4 +- .../mc-mark-pop.el | 0 .../mc-separate-operations.el | 0 .../multiple-cursors-autoloads.el | 47 +++++-------------- .../multiple-cursors-core.el | 43 +++++++++++++++-- .../multiple-cursors-pkg.el | 5 ++ .../multiple-cursors.el | 0 .../rectangular-region-mode.el | 6 +-- 12 files changed, 64 insertions(+), 52 deletions(-) delete mode 100644 elpa/multiple-cursors-20180913.1237/multiple-cursors-pkg.el rename elpa/{multiple-cursors-20180913.1237 => multiple-cursors-20190820.749}/mc-cycle-cursors.el (100%) rename elpa/{multiple-cursors-20180913.1237 => multiple-cursors-20190820.749}/mc-edit-lines.el (95%) rename elpa/{multiple-cursors-20180913.1237 => multiple-cursors-20190820.749}/mc-hide-unmatched-lines-mode.el (100%) rename elpa/{multiple-cursors-20180913.1237 => multiple-cursors-20190820.749}/mc-mark-more.el (99%) rename elpa/{multiple-cursors-20180913.1237 => multiple-cursors-20190820.749}/mc-mark-pop.el (100%) rename elpa/{multiple-cursors-20180913.1237 => multiple-cursors-20190820.749}/mc-separate-operations.el (100%) rename elpa/{multiple-cursors-20180913.1237 => multiple-cursors-20190820.749}/multiple-cursors-autoloads.el (86%) rename elpa/{multiple-cursors-20180913.1237 => multiple-cursors-20190820.749}/multiple-cursors-core.el (95%) create mode 100644 elpa/multiple-cursors-20190820.749/multiple-cursors-pkg.el rename elpa/{multiple-cursors-20180913.1237 => multiple-cursors-20190820.749}/multiple-cursors.el (100%) rename elpa/{multiple-cursors-20180913.1237 => multiple-cursors-20190820.749}/rectangular-region-mode.el (97%) diff --git a/elpa/multiple-cursors-20180913.1237/multiple-cursors-pkg.el b/elpa/multiple-cursors-20180913.1237/multiple-cursors-pkg.el deleted file mode 100644 index af9fd61f..00000000 --- a/elpa/multiple-cursors-20180913.1237/multiple-cursors-pkg.el +++ /dev/null @@ -1,5 +0,0 @@ -(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-20180913.1237/mc-cycle-cursors.el b/elpa/multiple-cursors-20190820.749/mc-cycle-cursors.el similarity index 100% rename from elpa/multiple-cursors-20180913.1237/mc-cycle-cursors.el rename to elpa/multiple-cursors-20190820.749/mc-cycle-cursors.el diff --git a/elpa/multiple-cursors-20180913.1237/mc-edit-lines.el b/elpa/multiple-cursors-20190820.749/mc-edit-lines.el similarity index 95% rename from elpa/multiple-cursors-20180913.1237/mc-edit-lines.el rename to elpa/multiple-cursors-20190820.749/mc-edit-lines.el index e38d1c18..55772afa 100644 --- a/elpa/multiple-cursors-20180913.1237/mc-edit-lines.el +++ b/elpa/multiple-cursors-20190820.749/mc-edit-lines.el @@ -54,8 +54,8 @@ other non-nil value will cause short lines to be padded." (error "Mark a set of lines first")) (mc/remove-fake-cursors) (let* ((col (current-column)) - (point-line (line-number-at-pos)) - (mark-line (progn (exchange-point-and-mark) (line-number-at-pos))) + (point-line (mc/line-number-at-pos)) + (mark-line (progn (exchange-point-and-mark) (mc/line-number-at-pos))) (direction (if (< point-line mark-line) :up :down)) (style (cond ;; called from lisp @@ -71,7 +71,7 @@ other non-nil value will cause short lines to be padded." (previous-logical-line 1 nil) (move-to-column col)) ;; Add the cursors - (while (not (eq (line-number-at-pos) point-line)) + (while (not (eq (mc/line-number-at-pos) point-line)) ;; Pad the line (when (eq style 'pad) (while (< (current-column) col) diff --git a/elpa/multiple-cursors-20180913.1237/mc-hide-unmatched-lines-mode.el b/elpa/multiple-cursors-20190820.749/mc-hide-unmatched-lines-mode.el similarity index 100% rename from elpa/multiple-cursors-20180913.1237/mc-hide-unmatched-lines-mode.el rename to elpa/multiple-cursors-20190820.749/mc-hide-unmatched-lines-mode.el diff --git a/elpa/multiple-cursors-20180913.1237/mc-mark-more.el b/elpa/multiple-cursors-20190820.749/mc-mark-more.el similarity index 99% rename from elpa/multiple-cursors-20180913.1237/mc-mark-more.el rename to elpa/multiple-cursors-20190820.749/mc-mark-more.el index da8cedf3..2e631307 100644 --- a/elpa/multiple-cursors-20180913.1237/mc-mark-more.el +++ b/elpa/multiple-cursors-20190820.749/mc-mark-more.el @@ -579,8 +579,8 @@ If the region is inactive or on a single line, it will behave like (interactive "P") (if (and (use-region-p) (not (> (mc/num-cursors) 1)) - (not (= (line-number-at-pos (region-beginning)) - (line-number-at-pos (region-end))))) + (not (= (mc/line-number-at-pos (region-beginning)) + (mc/line-number-at-pos (region-end))))) (if arg (call-interactively 'mc/edit-lines) (call-interactively 'mc/mark-all-in-region)) diff --git a/elpa/multiple-cursors-20180913.1237/mc-mark-pop.el b/elpa/multiple-cursors-20190820.749/mc-mark-pop.el similarity index 100% rename from elpa/multiple-cursors-20180913.1237/mc-mark-pop.el rename to elpa/multiple-cursors-20190820.749/mc-mark-pop.el diff --git a/elpa/multiple-cursors-20180913.1237/mc-separate-operations.el b/elpa/multiple-cursors-20190820.749/mc-separate-operations.el similarity index 100% rename from elpa/multiple-cursors-20180913.1237/mc-separate-operations.el rename to elpa/multiple-cursors-20190820.749/mc-separate-operations.el diff --git a/elpa/multiple-cursors-20180913.1237/multiple-cursors-autoloads.el b/elpa/multiple-cursors-20190820.749/multiple-cursors-autoloads.el similarity index 86% rename from elpa/multiple-cursors-20180913.1237/multiple-cursors-autoloads.el rename to elpa/multiple-cursors-20190820.749/multiple-cursors-autoloads.el index 492b41a2..b83d7706 100644 --- a/elpa/multiple-cursors-20180913.1237/multiple-cursors-autoloads.el +++ b/elpa/multiple-cursors-20190820.749/multiple-cursors-autoloads.el @@ -1,20 +1,10 @@ ;;; multiple-cursors-autoloads.el --- automatically extracted autoloads ;; ;;; Code: - -(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/"))) - -;;;*** +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) -;;;### (autoloads nil "mc-edit-lines" "mc-edit-lines.el" (0 0 0 0)) +;;;### (autoloads nil "mc-edit-lines" "mc-edit-lines.el" (23994 46445 +;;;;;; 347438 217000)) ;;; Generated autoloads from mc-edit-lines.el (autoload 'mc/edit-lines "mc-edit-lines" "\ @@ -41,12 +31,10 @@ 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" -;;;;;; (0 0 0 0)) +;;;;;; (23994 46445 349662 44000)) ;;; Generated autoloads from mc-hide-unmatched-lines-mode.el (autoload 'mc-hide-unmatched-lines-mode "mc-hide-unmatched-lines-mode" "\ @@ -58,11 +46,10 @@ 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" (0 0 0 0)) +;;;### (autoloads nil "mc-mark-more" "mc-mark-more.el" (23994 46445 +;;;;;; 346280 298000)) ;;; Generated autoloads from mc-mark-more.el (autoload 'mc/mark-next-like-this "mc-mark-more" "\ @@ -257,11 +244,10 @@ 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" (0 0 0 0)) +;;;### (autoloads nil "mc-mark-pop" "mc-mark-pop.el" (23994 46445 +;;;;;; 351818 778000)) ;;; Generated autoloads from mc-mark-pop.el (autoload 'mc/mark-pop "mc-mark-pop" "\ @@ -273,7 +259,7 @@ to the popped mark. ;;;*** ;;;### (autoloads nil "mc-separate-operations" "mc-separate-operations.el" -;;;;;; (0 0 0 0)) +;;;;;; (23994 46445 348622 657000)) ;;; Generated autoloads from mc-separate-operations.el (autoload 'mc/insert-numbers "mc-separate-operations" "\ @@ -310,12 +296,10 @@ 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" -;;;;;; (0 0 0 0)) +;;;;;; (23994 46445 350704 595000)) ;;; Generated autoloads from multiple-cursors-core.el (autoload 'multiple-cursors-mode "multiple-cursors-core" "\ @@ -323,12 +307,10 @@ 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" -;;;;;; (0 0 0 0)) +;;;;;; (23994 46445 353812 605000)) ;;; Generated autoloads from rectangular-region-mode.el (autoload 'set-rectangular-region-anchor "rectangular-region-mode" "\ @@ -344,12 +326,10 @@ 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 ("multiple-cursors-pkg.el" "multiple-cursors.el") -;;;;;; (0 0 0 0)) +;;;### (autoloads nil nil ("mc-cycle-cursors.el" "multiple-cursors-pkg.el" +;;;;;; "multiple-cursors.el") (23994 46445 354802 338000)) ;;;*** @@ -357,6 +337,5 @@ 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-20180913.1237/multiple-cursors-core.el b/elpa/multiple-cursors-20190820.749/multiple-cursors-core.el similarity index 95% rename from elpa/multiple-cursors-20180913.1237/multiple-cursors-core.el rename to elpa/multiple-cursors-20190820.749/multiple-cursors-core.el index 4ca8e757..d93ace9a 100644 --- a/elpa/multiple-cursors-20180913.1237/multiple-cursors-core.el +++ b/elpa/multiple-cursors-20190820.749/multiple-cursors-core.el @@ -109,6 +109,19 @@ (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")))) + (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))) @@ -149,7 +162,18 @@ highlights the entire width of the window." autopair-action autopair-wrap-action temporary-goal-column - er/history) + er/history + dabbrev--abbrev-char-regexp + dabbrev--check-other-buffers + dabbrev--friend-buffer-list + dabbrev--last-abbrev-location + dabbrev--last-abbreviation + dabbrev--last-buffer + dabbrev--last-buffer-found + dabbrev--last-direction + dabbrev--last-expansion + dabbrev--last-expansion-location + dabbrev--last-table) "A list of vars that need to be tracked on a per-cursor basis.") (defun mc/store-current-state-in-overlay (o) @@ -424,6 +448,10 @@ the original cursor, to inform about the lack of support." (message "%S is not supported with multiple cursors%s" original-command (get original-command 'mc--unsupported)) + + ;; lazy-load the user's list file + (mc/load-lists) + (when (and original-command (not (memq original-command mc--default-cmds-to-run-once)) (not (memq original-command mc/cmds-to-run-once)) @@ -602,6 +630,15 @@ for running commands with multiple cursors." :type 'file :group 'multiple-cursors) +(defvar mc--list-file-loaded nil + "Whether the list file has already been loaded.") + +(defun mc/load-lists () + "Loads preferences for running commands with multiple cursors from `mc/list-file'" + (unless mc--list-file-loaded + (load mc/list-file 'noerror 'nomessage) + (setq mc--list-file-loaded t))) + (defun mc/dump-list (list-symbol) "Insert (setq 'LIST-SYMBOL LIST-VALUE) to current buffer." (cl-symbol-macrolet ((value (symbol-value list-symbol))) @@ -806,10 +843,6 @@ 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, 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) ;; Local Variables: diff --git a/elpa/multiple-cursors-20190820.749/multiple-cursors-pkg.el b/elpa/multiple-cursors-20190820.749/multiple-cursors-pkg.el new file mode 100644 index 00000000..4c7583ef --- /dev/null +++ b/elpa/multiple-cursors-20190820.749/multiple-cursors-pkg.el @@ -0,0 +1,5 @@ +(define-package "multiple-cursors" "20190820.749" "Multiple cursors for Emacs." + '((cl-lib "0.5"))) +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/multiple-cursors-20180913.1237/multiple-cursors.el b/elpa/multiple-cursors-20190820.749/multiple-cursors.el similarity index 100% rename from elpa/multiple-cursors-20180913.1237/multiple-cursors.el rename to elpa/multiple-cursors-20190820.749/multiple-cursors.el diff --git a/elpa/multiple-cursors-20180913.1237/rectangular-region-mode.el b/elpa/multiple-cursors-20190820.749/rectangular-region-mode.el similarity index 97% rename from elpa/multiple-cursors-20180913.1237/rectangular-region-mode.el rename to elpa/multiple-cursors-20190820.749/rectangular-region-mode.el index 01a078d1..d8051cca 100644 --- a/elpa/multiple-cursors-20180913.1237/rectangular-region-mode.el +++ b/elpa/multiple-cursors-20190820.749/rectangular-region-mode.el @@ -75,9 +75,9 @@ an exceedingly quick way of adding multiple cursors to multiple lines." (rrm/remove-rectangular-region-overlays) (let* ((annoying-arrows-mode nil) (point-column (current-column)) - (point-line (line-number-at-pos)) + (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) (line-number-at-pos))) + (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)) (navigation-step (if (< point-line anchor-line) 1 -1))) @@ -85,7 +85,7 @@ an exceedingly quick way of adding multiple cursors to multiple lines." (set-mark (point)) (move-to-column point-column) (mc/save-excursion - (while (not (= anchor-line (line-number-at-pos))) + (while (not (= anchor-line (mc/line-number-at-pos))) (forward-line navigation-step) (move-to-column anchor-column) (when (= anchor-column (current-column)) -- 2.47.3