From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: position on changing defaults? Date: Thu, 06 Mar 2008 08:46:16 +0900 Message-ID: <8763w0n393.fsf@catnip.gol.com> References: <200803050637.m256bXL3008361@sallyv1.ics.uci.edu> <87hcfkdhqk.fsf@stupidchicken.com> <87d4q8sq9c.fsf@jurta.org> Reply-To: Miles Bader NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1204760843 30373 80.91.229.12 (5 Mar 2008 23:47:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Mar 2008 23:47:23 +0000 (UTC) Cc: Chong Yidong , emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 06 00:47:49 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 1JX3Ks-0000KA-JA for ged-emacs-devel@m.gmane.org; Thu, 06 Mar 2008 00:47:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JX3KL-0001lG-Hv for ged-emacs-devel@m.gmane.org; Wed, 05 Mar 2008 18:47:13 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JX3Jc-0001Ft-34 for emacs-devel@gnu.org; Wed, 05 Mar 2008 18:46:28 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JX3Ja-0001Ey-8N for emacs-devel@gnu.org; Wed, 05 Mar 2008 18:46:27 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JX3Ja-0001Er-0F for emacs-devel@gnu.org; Wed, 05 Mar 2008 18:46:26 -0500 Original-Received: from smtp11.dentaku.gol.com ([203.216.5.73]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JX3JU-0007xt-SV; Wed, 05 Mar 2008 18:46:21 -0500 Original-Received: from 203-216-102-071.dsl.gol.ne.jp ([203.216.102.71] helo=catnip.gol.com) by smtp11.dentaku.gol.com with esmtpa (Dentaku) id 1JX3JS-00075D-60; Thu, 06 Mar 2008 08:46:18 +0900 Original-Received: by catnip.gol.com (Postfix, from userid 1000) id 0E0582FF7; Thu, 6 Mar 2008 08:46:17 +0900 (JST) System-Type: i686-pc-linux-gnu In-Reply-To: <87d4q8sq9c.fsf@jurta.org> (Juri Linkov's message of "Thu, 06 Mar 2008 01:30:23 +0200") Original-Lines: 37 X-Virus-Scanned: ClamAV GOL (outbound) X-Abuse-Complaints: abuse@gol.com X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) 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:91438 Archived-At: Juri Linkov writes: >>> - selection with Shift-arrow keys >> >> I think this would be a good default. If someone is willing to make a >> patch that refactors this code from cua-mode into simple.el, it would >> be worth considering. > > Unfortunately, I see no way of implementing this in simple.el without > using pre-command-hook and post-command-hook. It seems this can be > implemented only in C in the function that reads characters. I was thinking about we might do this in a better and more general way (in C, obviously). How about adding a new type of binding, a "modifier binding", which could serve to implement CUA movement, and replace the current automatic S-foo => foo remapping. Basically, these would be bindings that represent event-modifiers only. If normal key lookup fails, the keymapping mechanism would then look up and invoke the modifier binding corresponding to the modifiers on the key, and invoke it instead; the invoked function could then, if it wished (e.g. for CUA), set some variables or frob some state and re-invoke the event with the modifiers removed. [Presumably there would be some fallback mechanism for dealing with multiple modifiers where there was no binding for the entire modifier set; e.g., if the event was "S-M-x", and there was no "S-M-x" binding, nor a "S-M-" binding, it would then lookup say "S-" and "M-" in turn, and invoke the first one found.] Whadaya think? -Miles -- Bride, n. A woman with a fine prospect of happiness behind her.