From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Of keyboards and terminals Date: Sat, 23 Feb 2008 20:30:56 -0500 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1203816674 20619 80.91.229.12 (24 Feb 2008 01:31:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 Feb 2008 01:31:14 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 24 02:31:39 2008 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 1JT5iK-0007wk-G3 for ged-emacs-devel@m.gmane.org; Sun, 24 Feb 2008 02:31:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JT5hp-0007Bs-HJ for ged-emacs-devel@m.gmane.org; Sat, 23 Feb 2008 20:31:05 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JT5hm-0007Bm-2S for emacs-devel@gnu.org; Sat, 23 Feb 2008 20:31:02 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JT5hj-0007Ba-LW for emacs-devel@gnu.org; Sat, 23 Feb 2008 20:31:00 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JT5hj-0007BX-FQ for emacs-devel@gnu.org; Sat, 23 Feb 2008 20:30:59 -0500 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JT5hi-000480-Rl for emacs-devel@gnu.org; Sat, 23 Feb 2008 20:30:59 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAGZXwEdMCpz5Wmdsb2JhbACQUQEggTSZQYEA X-IronPort-AV: E=Sophos;i="4.25,396,1199682000"; d="scan'208";a="14891410" Original-Received: from smtp.pppoe.ca ([65.39.196.238]) by ironport2-out.pppoe.ca with ESMTP; 23 Feb 2008 20:30:56 -0500 Original-Received: from pastel.home ([76.10.156.249]) by smtp.pppoe.ca (Internet Mail Server v1.0) with ESMTP id EDC68356; Sat, 23 Feb 2008 20:30:56 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 624DA8A41; Sat, 23 Feb 2008 20:30:56 -0500 (EST) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. 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:90195 Archived-At: We currently have a slightly odd situation: In 99% of the cases, each keyboard object has a single terminal object and each terminal has a single keyboard. But in some rare cases, several terminals can share a single keyboard. See the same_x_server function in xterm.c. This can be the case when you have different connections to the same X server. This can happen if you make a frame on unix:0 and then another frame on localhost:0 and yet another on :0. This is not very common, tho. A more significant situation is when you have a multi-screen setup such that you can make a frame on :0.0 and another on :0.1 and yet another on :0.2. These *require* separate terminal objects (and separate X connections). So in those particular cases, Emacs shares a single keyboard object between those different terminal objects. The intent of sharing a single keyboard has mostly to do with the fact that once a command is started, Emacs is put into "single-keyboard" mode so that all the input coming from other keyboards is temporarily delayed. As far as I can tell, this is the only benefit. The problem is that variables like function-key-map are not terminal-local (as people often think) but keyboard-local instead. OTOH they're initialized per-terminal, and there is generally some confusion between pr-keyboard and per-terminal objects and actions. So I'm thinking of eliminating the special case that shares the keyboard among different X11 connections to the same underlying server: the sharing does make sense, but its benefit doesn't seem to justify the resulting complexity. Stefan