[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug#22873: Can we support multiple Cursors?

From: Magnar Sveen
Subject: Re: bug#22873: Can we support multiple Cursors?
Date: Fri, 04 Mar 2016 22:18:48 +0000

I'm pretty sure you don't want my multiple-cursors.el as an official package. It's a major hack, basically trying to emulate the emacs command loop in a post-command hook. After quite a lot of work, it now functions properly for most commands - but it doesn't play so well in the presence of other major hacks (like Evil).

I would say multiple cursors should be done properly if official.

Things that would help the multiple-cursors package, and also be a step towards real support:

- allowing rendering of faux cursors. Right now I'm using inverted overlays to create a block cursor (only).
- introduce the concept of cursor-local vars, much like buffer-local vars. Right now I'm keeping track of a curated list of these in the package.
- document the inner workings of the command loop somewhere. This is what I have right now:

(defun mc/execute-command (cmd)
  "Run command, simulating the parts of the command loop that makes sense for fake cursors."
  (setq this-command cmd)
  (run-hooks 'pre-command-hook)
  (unless (eq this-command 'ignore)
    (call-interactively cmd))
  (run-hooks 'post-command-hook)
  (when deactivate-mark (deactivate-mark)))

I'm sure there's some nuance I'm missing, since there are still the odd command that interacts oddly with it. 

- Magnar

On Fri, Mar 4, 2016 at 3:59 PM Stefan Monnier <address@hidden> wrote:
>> I understand all this.  (In fact, I wanted to write Elpa, only to
>> discover - to my surprise - that Magnar's multiple-cursors package is
>> actually on Melpa.  It is GPL'd, however.)

> Would he / can he contribute it so we can put it in ELPA?

He already signed all the needed paperwork.  But there are probably
other contributors who haven't.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]