From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Magnar Sveen Newsgroups: gmane.emacs.devel Subject: Re: bug#22873: Can we support multiple Cursors? Date: Fri, 04 Mar 2016 22:18:48 +0000 Message-ID: References: <8760x49hly.fsf@mbork.pl> <87ziuf8uun.fsf@mbork.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114e3f64573345052d40807f X-Trace: ger.gmane.org 1457129948 13199 80.91.229.3 (4 Mar 2016 22:19:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Mar 2016 22:19:08 +0000 (UTC) To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 04 23:19:04 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aby3r-0001cY-Gw for ged-emacs-devel@m.gmane.org; Fri, 04 Mar 2016 23:19:03 +0100 Original-Received: from localhost ([::1]:43770 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aby3q-0005Qc-QH for ged-emacs-devel@m.gmane.org; Fri, 04 Mar 2016 17:19:02 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aby3n-0005Px-RV for emacs-devel@gnu.org; Fri, 04 Mar 2016 17:19:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aby3m-0006Y1-Ke for emacs-devel@gnu.org; Fri, 04 Mar 2016 17:18:59 -0500 Original-Received: from mail-yw0-x232.google.com ([2607:f8b0:4002:c05::232]:34768) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aby3m-0006Xx-EE for emacs-devel@gnu.org; Fri, 04 Mar 2016 17:18:58 -0500 Original-Received: by mail-yw0-x232.google.com with SMTP id h129so55696369ywb.1 for ; Fri, 04 Mar 2016 14:18:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kodemaker-no.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=t3WIktfa1fTHPB/d2W0OT4nrhxhhGgbiVyMyVwCCefo=; b=QEwzoc6eyevaWvQ6IfKr76+Rx47DwXKIZ7QqXQI7j8xTFKe9Hy5wAlUF30dlZdYC2f edLVDzWJoPccUAUv3eoMRx5NrENtRALqOIFRXkA7nVbBwnFFFmCuDhv6w6CDTrShl7Bd 6HU1YC/NTOq2ql52DZ8m92E7egxXk0N/l/BsUKl7mpD7jzXzSmsY3W8hq7xqlbZg2cte pxyT8Mriw1I/lMw31FBxrn1IA0kmudvyM/XeVGVtloIwUUgMNZjwDsCbnvr2TN3jBodb sj73hBozJISbmj8VXUnooX5+MTpSpXmzQg8RbMn0KCaWVHzecxOiFFNTLYzOd3tawROh 0NOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=t3WIktfa1fTHPB/d2W0OT4nrhxhhGgbiVyMyVwCCefo=; b=UJyZcbFcgixuYKnRWeyRsS6NqsOc1v0r/B+H37oGJ1DySSk05I9R/6TsNChZF6PWUK e2UwMdLhvie+Ar3ub5VJbjySJ02LVBJp2sIhhvLcD/IimpCdbOVjmnE3uaK1dkA5lkgl 19fgK+qBdpZlDNaIbFgv0y7PtbZOdDWrAXnjbgnKvRInvsLaVCgv1J9yTssQa0sVltPa VU9RjQW++8AR3Sqg3+mv3LIkqxrXOAWPCcwiJQtaEaOqluHqho/rXpfSWd/rw+LABPps 6qIE9HeUzqX957o+jWlrTae9tay/zr/E57vZSh8y3QhzVMbCBW12ngEGprSmaJMs2ewS V1cQ== X-Gm-Message-State: AD7BkJKFVI6bsXjuOm3OA4XU8gYQOb+p71Hs5WEtuP4eI/i5DTu9JcnjkKwNbK8pPGky6jM4ht7/nDS5xw6ixw== X-Received: by 10.13.209.193 with SMTP id t184mr5439158ywd.99.1457129937906; Fri, 04 Mar 2016 14:18:57 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4002:c05::232 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:200927 Archived-At: --001a114e3f64573345052d40807f Content-Type: text/plain; charset=UTF-8 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 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. > > > Stefan > > > --001a114e3f64573345052d40807f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I'm pretty sure you don't want my multiple-cursors= .el as an official package. It's a major hack, basically trying to emul= ate the emacs command loop in a post-command hook. After quite a lot of wor= k, 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 al= so be a step towards real support:

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

<= /div>
(defun mc/execute-command (cmd)
=C2=A0 "Run c= ommand, simulating the parts of the command loop that makes sense for fake = cursors."
=C2=A0 (setq this-command cmd)
=C2=A0 (r= un-hooks 'pre-command-hook)
=C2=A0 (unless (eq this-command &= #39;ignore)
=C2=A0 =C2=A0 (call-interactively cmd))
=C2= =A0 (run-hooks 'post-command-hook)
=C2=A0 (when deactivate-ma= rk (deactivate-mark)))

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

- Magnar


On Fri, Ma= r 4, 2016 at 3:59 PM Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> I understand all this.=C2=A0 (In fact, I wanted to w= rite Elpa, only to
>> discover - to my surprise - that Magnar's multiple-cursors pac= kage is
>> actually on Melpa.=C2=A0 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.=C2=A0 But there are probably other contributors who haven't.


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan


--001a114e3f64573345052d40807f--