[Top][All Lists]

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

Re: [multi-tty] xt-mouse.el does not work in emacsclient frames

From: David Kastrup
Subject: Re: [multi-tty] xt-mouse.el does not work in emacsclient frames
Date: Mon, 21 May 2007 15:02:09 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.51 (gnu/linux)

Stefan Monnier <address@hidden> 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

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

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

David Kastrup

reply via email to

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