From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: [multi-tty] xt-mouse.el does not work in emacsclient frames Date: Mon, 21 May 2007 15:02:09 +0200 Message-ID: <86abvyib3i.fsf@lola.quinscape.zz> References: <200705170044.l4H0i46s007856@oogie-boogie.ics.uci.edu> <200705182017.l4IKHnqa025118@oogie-boogie.ics.uci.edu> <200705182055.l4IKt3iQ025860@oogie-boogie.ics.uci.edu> <200705190212.l4J2CCiP003153@oogie-boogie.ics.uci.edu> <85mz00sl4p.fsf@lola.goethe.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1179752675 12672 80.91.229.12 (21 May 2007 13:04:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 21 May 2007 13:04:35 +0000 (UTC) Cc: bob@rattlesnake.com, Dan Nicolaescu , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 21 15:04:34 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hq7Yv-0003ZH-Sf for ged-emacs-devel@m.gmane.org; Mon, 21 May 2007 15:04:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hq7Yv-0003f3-IK for ged-emacs-devel@m.gmane.org; Mon, 21 May 2007 09:04:33 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hq7Wd-0001A1-UL for emacs-devel@gnu.org; Mon, 21 May 2007 09:02:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hq7Wd-00018L-AE for emacs-devel@gnu.org; Mon, 21 May 2007 09:02:11 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hq7Wc-00017u-Pn for emacs-devel@gnu.org; Mon, 21 May 2007 09:02:10 -0400 Original-Received: from pc3.berlin.powerweb.de ([62.67.228.11]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Hq7Wc-0001qC-3L for emacs-devel@gnu.org; Mon, 21 May 2007 09:02:10 -0400 Original-Received: from quinscape.de (dslnet.212-29-44.ip210.dokom.de [212.29.44.210] (may be forged)) by pc3.berlin.powerweb.de (8.9.3p3/8.9.3) with ESMTP id PAA13107 for ; Mon, 21 May 2007 15:02:03 +0200 X-Delivered-To: Original-Received: (qmail 24273 invoked from network); 21 May 2007 13:02:09 -0000 Original-Received: from unknown (HELO lola.quinscape.zz) ([10.0.3.43]) (envelope-sender ) by ns.quinscape.de (qmail-ldap-1.03) with SMTP for ; 21 May 2007 13:02:09 -0000 Original-Received: by lola.quinscape.zz (Postfix, from userid 1001) id 2CC2D8F832; Mon, 21 May 2007 15:02:09 +0200 (CEST) In-Reply-To: (Stefan Monnier's message of "Mon\, 21 May 2007 08\:39\:58 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.51 (gnu/linux) X-detected-kernel: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:71496 Archived-At: Stefan Monnier 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