emacs-devel
[Top][All Lists]
Advanced

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

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


From: Stefan Monnier
Subject: Re: bug#22873: Can we support multiple Cursors?
Date: Fri, 04 Mar 2016 21:16:16 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

> I'm pretty sure you don't want my multiple-cursors.el as an official
> package.

Being in GNU ELPA doesn't mean it's "official".  It does grant some kind
of respectability, but the main things it does is:
- make sure the code has a reliable license (usually, not a bug deal
  for the end user).
- make sure it can be installed out of the box without any extra customization.
- gets to be seen (and can be fixed) by Emacs's maintainers, so tends to
  follow the conventions a bit better.
- gets to be seen by whoever watches elpa-diffs, so might be ever so
  slightly less at risk of malware.
- gets to be seen by Emacs's maintainers so they may become aware of
  some issues that might require changes to the core.
...

> - allowing rendering of faux cursors. Right now I'm using inverted overlays
> to create a block cursor (only).

Seems like a good solution.  If this bumps into problems, we should
probably try and improve overlay support rather than try to add
specific "multi-cursor" support in the redisplay engine.

> (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)))

FWIW, we could/should work to move execute-command as well as the
read-eval loop from C to Elisp.

Note that the above is "wrong" also in the sense that execute-command does
not run pre/post command hooks (this is done by the read-eval loop
instead, around the call to command-execute).


        Stefan



reply via email to

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