Closed gabesoft closed 8 years ago
In magnars' multiple-cursors package one can do that like this:
(mc/for-each-cursor-ordered (mc/execute-command-for-fake-cursor 'insert-magic-number cursor))
(defun insert-magic-number () (interactive) (insert (number-to-string 42))
Or something like this:
(defun mc/sort-regions () (interactive) (unless (use-region-p) (mc/execute-command-for-all-cursors 'mark-sexp)) (setq mc--strings-to-replace (sort (mc--ordered-region-strings) 'string<)) (mc--replace-region-strings))
In magnars' multiple-cursors package one can do that like this:
(mc/for-each-cursor-ordered (mc/execute-command-for-fake-cursor 'insert-magic-number cursor))
(defun insert-magic-number () (interactive) (insert (number-to-string 42))
Or something like this:
(defun mc/sort-regions () (interactive) (unless (use-region-p) (mc/execute-command-for-all-cursors 'mark-sexp)) (setq mc--strings-to-replace (sort (mc--ordered-region-strings) 'string<)) (mc--replace-region-strings))