On Mon, Jan 23, 2012 at 01:26, Thomas Dickey <dickey@his.com> wrote:
It's clear as long as mouse is the only event beginning with \e[< that's processed by Emacs. As soon as there's a second, completely independent escape also beginning with \e[< which another module would like to process, problems begin. Same happens with apparently many other applications.
That being said, we can say that we stick to 1006, apps that are only interested in mouse-related \e[< codes can do the easy way of parsing, and apps that need to check for other \e[< codes need to do refactor more to implement a more correct parser.
egmont
I'd assume that one would start by doing a
(define-key input-decode-map "\e[<" 'xterm-extended-mouse-translate))
...along with a suitable new function. It's been a while since I
programmed in lisp, but it's usually readable. Aside from cut/paste/massage
of text already in the file, there's not much to lookup.
It's clear as long as mouse is the only event beginning with \e[< that's processed by Emacs. As soon as there's a second, completely independent escape also beginning with \e[< which another module would like to process, problems begin. Same happens with apparently many other applications.
That being said, we can say that we stick to 1006, apps that are only interested in mouse-related \e[< codes can do the easy way of parsing, and apps that need to check for other \e[< codes need to do refactor more to implement a more correct parser.
egmont
That's the preferred method for emacs (changes to the C code are done
> too, and the whole business of mouse coordinate parsing solved locally in
> lisp, which I guess even I would be able to do despite knowing nothing
only to provide ways for the lisp code to do more).
It doesn't have to be unique - the reader simply has to check that the
> about lisp. If there's no unique prefix, i.e. if \e[< can mean mouse
> coordinate but can mean something else as well, then adding support would
> require much more complex architecture changes from someone who much more
> deeply understands emacs' structure.
>
> I'm not asking you to come up with a patch to emacs or anything like that,
> but please take a very quick look at the source and estimate how much work
> it'd be to add support in one case or in the other. I hope you'll agree
> that it's much more work to add proper support if there is no unique prefix.
input is in the expected format.
For someone who knows their way around emacs, this would be a couple of
hours work. If I had to do it, hmm - perhaps a day or two.
there are a lot of applications :-(
> I personally think it's important that extended mouse support should be
> easy to add into applications, and should not require architecture
> redesign. I think it's a key to getting the feature deployed quickly and
> widely across apps.
> thanks,
> egmont
>
>
>
> >
> > (Correctly parsing 1015 also would involve checking the final character,
> > of course).
> >
> > > I think anything as simple as a fixed letter following the '<' sign, if
> > > it's not used anywhere else right now, would do it. Or alternatively
> > \e[M
> > > followed by a single fixed letter that is currently out of use would also
> > > do it.
> > >
> > > Also, I'm not sure about the purpose of "private" mode, but shouldn't we
> > > aim to provide something that will quickly become a new standard, not
> > > something "private"?
> >
> > "private" in this regard means that it's not part of ECMA-48.
> >
> > Take a look at the various "CSI ?" and "CSI >" listed in ctlseqs to see
> > how xterm (and DEC) use private modes. The existing mouse controls are
> > for instance private modes.
> >
> > CSI ? 1 0 0 1 h
> > Ps = 1 0 0 1 -> Use Hilite Mouse Tracking.
> >
> > > > The first three are used in various ways in different terminals. The
> > last
> > > > seems to be rarely used, so I chose to use that.
> > > >
> > > > Conceivably some other escape sequence could be implemented (I don't
> > have
> > > > any plans for that). I'm assuming that vim will check the final
> > character.
> > > >
> > >
> > >
> > > Thanks a lot,
> > > egmont
> > >
> > >
> > >
> > >
> > >
> > > >
> > > > > Once this is done, it'll be okay to add 1006 support to Vim. (In the
> > > > mean
> > > > > time I guess 1015 support could be dropped; this would make extended
> > > > mouse
> > > > > coords stop working in some versions of some terminals, but would
> > > > probably
> > > > > also simplify Vim's code. But it's okay to keep 1015 too.)
> > > > >
> > > > > thanks,
> > > > > egmont
> > > > >
> > > > >
> > > > >
> > > > > >
> > > > > > Note that in ctlseqs.html in the DECSET list 1006 and 1015 are not
> > > > > > documented.
> > > > > >
> > > > > > --
> > > > > > CRONE: Who sent you?
> > > > > > ARTHUR: The Knights Who Say GNU!
> > > > > > CRONE: Aaaagh! (she looks around in rear) No! We have no
> > licenses
> > > > here.
> > > > > > "Monty Python and the Holy editor wars" PYTHON (MONTY)
> > > > SOFTWARE
> > > > > > LTD
> > > > > >
> > > > > > /// Bram Moolenaar -- Bram@Moolenaar.net --
> > http://www.Moolenaar.net
> > > > > > \\\
> > > > > > /// sponsor Vim, vote for features --
> > > > http://www.Vim.org/sponsor/\\\
> > > > > > \\\ an exciting new programming language -- http://www.Zimbu.org
> > > > > > ///
> > > > > > \\\ help me help AIDS victims --
> > http://ICCF-Holland.org
> > > > > > ///
> > > > > >
> > > > > > --
> > > > > > You received this message from the "vim_use" maillist.
> > > > > > Do not top-post! Type your reply below the text you are replying
> > to.
> > > > > > For more information, visit http://www.vim.org/maillist.php
> > > > > >
> > > >
> > > > --
> > > > Thomas E. Dickey <dickey@invisible-island.net>
> > > > http://invisible-island.net
> > > > ftp://invisible-island.net
> > > >
> > > > -----BEGIN PGP SIGNATURE-----
> > > > Version: GnuPG v1.4.9 (GNU/Linux)
> > > >
> > > > iEYEARECAAYFAk8cG2IACgkQcCNT4PfkjtucogCfdZesPECwenLZNHe6xx/oc5s7
> > > > tiMAn2n1zVIgYEMMoZyl/RUwWkVJ1gtZ
> > > > =DJIQ
> > > > -----END PGP SIGNATURE-----
> > > >
> > > >
> >
> > --
> > Thomas E. Dickey <dickey@invisible-island.net>
> > http://invisible-island.net
> > ftp://invisible-island.net
> >
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.9 (GNU/Linux)
> >
> > iEYEARECAAYFAk8cJDoACgkQcCNT4PfkjttF+ACeP3kEskL7sUExPndJIKSfgIBs
> > n0gAoJ7VGKBTLJJjIdn40t3hTNw6qeSC
> > =JCNQ
> > -----END PGP SIGNATURE-----
> >
> >
--
Thomas E. Dickey <dickey@invisible-island.net>
http://invisible-island.net
ftp://invisible-island.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAk8cqUYACgkQcCNT4Pfkjtt1iQCdE1o40QOZS69dIIJNkVHJLuZZ
B7EAn0Qr1RJaZgvy9uyy/7xJ3j5A76mu
=eQCD
-----END PGP SIGNATURE-----
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
No comments:
Post a Comment