all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: bob@rattlesnake.com, Dan Nicolaescu <dann@ics.uci.edu>,
	emacs-devel@gnu.org
Subject: Re: [multi-tty] xt-mouse.el does not work in emacsclient frames
Date: Mon, 21 May 2007 15:02:09 +0200	[thread overview]
Message-ID: <86abvyib3i.fsf@lola.quinscape.zz> (raw)
In-Reply-To: <jwvwsz29wvj.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Mon\, 21 May 2007 08\:39\:58 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>> Actually, I don't think that would be right either: when calling
>>> xterm-mouse-mode, the user implicitly tells Emacs "trust me, this is
>>> a terminal that understands the xterm-mouse protocol".
>
>> Hm.  Could we have something that says "try this with every (including
>> as to yet unopened) terminal that you know/can test to understand the
>> protocol"?
>
> We can probably try to have a "global-xterm-mouse-mode" which automatically
> sets up xterm-mouse-mode on every terminal whose TERM names matches
> a particular regexp.
>
> Same thing for t-mouse-mode. 
>
> And/or maybe we could check the TTY name itself (after all a /dev/ttyN is
> known not to be an xterm).

I am again at a loss concerning the client/session/terminal-local
distinction: implementing clients as having their own terminal-local
variable set seemed like a reasonable option (well, at least it is
feasible that when several clients are running in the same text tty
that their minibuffers/prefix keys reasonably can be considered
independent since only one of those clients at any time will not be
suspended).

But enabling something like xterm-mouse-mode is very likely intended
to work across a given tty.  On the other hand, if one connects from
multiple different ttys, there might be ttys that don't work using it.

Again, I think it would be best if such a mode, if global, would upon
opening any tty have the opportunity to check whether it wants to
impose on that tty (figuring out in some manner whether this tty can
actually support it), then record its state in a terminal-local
variable.

However, this implies several things:
a) Lisp code can declare terminal-local variables
b) Lisp code can fire upon terminal changes or iterate through terminals

Concretely, this would mean something like
(add-hook 'terminal-hook 'xxx)

And whenever the terminal is changed, all functions in the hook get
called unless they are also registered in a terminal-local
terminal-hook-fired variable.

In that manner, xterm-mouse-mode would work more or less globally.  If
we can't invent an automated procedure for checking whether a terminal
supports xterm-mouse-mode, then xterm-mouse-mode would only be allowed
to register terminal-locally.

Either strategy would appear to require terminal-local behavior.  This
requires either a way for Lisp code to declare terminal-local
variables, or access to the current terminal so that association lists
between terminal and variable values can be built.

I don't like either exposure of terminal-locality to Lisp, but I think
I'd prefer among the two the possibility for the Lisp declaration of
terminal-local variables, since that exposes less of the
implementation.

-- 
David Kastrup

  reply	other threads:[~2007-05-21 13:02 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-16 22:49 [multi-tty] Odd regression in vcursor mode in terminal csant
2007-05-16 22:58 ` David Kastrup
2007-05-17  0:44 ` Dan Nicolaescu
2007-05-17  7:01   ` csant
2007-05-18 17:27   ` [multi-tty] xt-mouse.el does not work in emacsclient frames (was Re: Odd regression in vcursor mode in terminal) csant
2007-05-18 20:17     ` Dan Nicolaescu
2007-05-18 20:43       ` [multi-tty] xt-mouse.el does not work in emacsclient frames csant
2007-05-18 20:55         ` Dan Nicolaescu
2007-05-18 21:13           ` csant
2007-05-18 21:21             ` Dan Nicolaescu
2007-05-18 21:41               ` csant
2007-05-18 21:57                 ` Dan Nicolaescu
2007-05-18 21:59                 ` csant
2007-05-19  1:04             ` Robert J. Chassell
2007-05-19  2:12               ` Dan Nicolaescu
2007-05-19  2:28                 ` Dan Nicolaescu
2007-05-19 14:03                 ` Stefan Monnier
2007-05-19 16:00                   ` csant
2007-05-19 18:50                   ` David Kastrup
2007-05-21 12:39                     ` Stefan Monnier
2007-05-21 13:02                       ` David Kastrup [this message]
2007-05-21 14:12                         ` Stefan Monnier
2007-05-20 17:31 ` [multi-tty] Odd regression in vcursor mode in terminal Karoly Lorentey
2007-05-20 17:31 ` Karoly Lorentey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86abvyib3i.fsf@lola.quinscape.zz \
    --to=dak@gnu.org \
    --cc=bob@rattlesnake.com \
    --cc=dann@ics.uci.edu \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.