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

From: Keith David Bershatsky <[email-masked]>
Date: Thu, 10 Mar 2016 23:18:41 -0800

Attached is the third draft, multiple_cursors_003.diff, which applies to the master branch as of commit "ea626c72e590aa7a45fd26df42240854e4225cef" on March 10, 2015.

Different colors for each fake cursor are now supported on Emacs for Windows (XP SP-3) and OSX (10.6.8).

The next phase will be to separate the custom feature called `window-start-end-hook` from this new fake cursor feature 22873.  Currently, I am using the existence of a definitive window-start and window-end derived from the `window-start-end-hook` as a guide and condition precedent to placing the fake cursors.  Given that fake cursors are placed late in the stage of the redisplay process, I suspect that I can rely on other methods to extract the correct window-start and window-end.

The other unrelated features that were present in my first couple of drafts have been removed from this third draft.  The fake cursors feature works as follows -- to erase everything or change anything, just modify the `mc-list':

(defun mc-test (&optional list)
"Draw fake cursors at all POS defined in the `mc-list'.
Color vector is LSL (The Linden Scripting Language), rather than standard RGB.
`nsterm.m' uses `NSColor', which works well with LSL.  `w32term.c' uses
`PALETTERGB' or `RGB', and the conversion from LSL is done internally by
multiplying each element of the LSL color vector by 255."
(interactive)
  (setq mc-list '(
    (3 "hbar" [1.0 0.0 0.0])
    (4 "bar" [0.0 1.0 0.0])
    (5 "box" [0.0 0.0 1.0])
    (6 "hollow" [0.8 0.4 0.2])
    (7 ("hbar" 3) [1.0 0.0 1.0])
    (8 ("bar" 3) [0.0 1.0 1.0]))))

(global-set-key [f1] 'mc-test)