From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: position on changing defaults? Date: Thu, 06 Mar 2008 02:21:38 +0200 Organization: JURTA Message-ID: <87ir00pur1.fsf@jurta.org> References: <200803050637.m256bXL3008361@sallyv1.ics.uci.edu> <87hcfkdhqk.fsf@stupidchicken.com> <87d4q8sq9c.fsf@jurta.org> <8763w0n393.fsf@catnip.gol.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1204762991 3999 80.91.229.12 (6 Mar 2008 00:23:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Mar 2008 00:23:11 +0000 (UTC) Cc: Chong Yidong , emacs-devel@gnu.org To: Miles Bader Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 06 01:23:38 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 1JX3tZ-0003Aj-0V for ged-emacs-devel@m.gmane.org; Thu, 06 Mar 2008 01:23:37 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JX3t1-0005Fh-Hk for ged-emacs-devel@m.gmane.org; Wed, 05 Mar 2008 19:23:03 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JX3sx-0005F4-0p for emacs-devel@gnu.org; Wed, 05 Mar 2008 19:22:59 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JX3sv-0005Er-GL for emacs-devel@gnu.org; Wed, 05 Mar 2008 19:22:58 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JX3sv-0005Eo-BR for emacs-devel@gnu.org; Wed, 05 Mar 2008 19:22:57 -0500 Original-Received: from relay01.kiev.sovam.com ([62.64.120.200]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JX3sr-0006ro-Ca; Wed, 05 Mar 2008 19:22:53 -0500 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay01.kiev.sovam.com with esmtp (Exim 4.67) (envelope-from ) id 1JX3sn-000Chp-04; Thu, 06 Mar 2008 02:22:51 +0200 In-Reply-To: <8763w0n393.fsf@catnip.gol.com> (Miles Bader's message of "Thu, 06 Mar 2008 08:46:16 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-unknown-linux-gnu) X-Scanner-Signature: bf674e48040b805769da4ba4af5b826b X-DrWeb-checked: yes X-SpamTest-Envelope-From: juri@jurta.org X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Not Detected X-SpamTest-Info: Profiles 2362 [Mar 5 2008] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {HEADERS: header Content-Type found without required header Content-Transfer-Encoding} X-SpamTest-Method: none X-SpamTest-Rate: 11 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0278], KAS30/Release X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.8-5.1 (or MacOS X 10.2-10.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:91449 Archived-At: >> 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? In general, I agree with the idea of exposing the translation of unbound event-modified keys to Lisp functions that can process untranslated keys. Maybe it would be possible to implement the following interface to define such bindings? (define-key global-map [(shift untranslated)] (lambda () (interactive) (when (and transient-mark-mode (not mark-active)) (push-mark-command nil nil)))) -- Juri Linkov http://www.jurta.org/emacs/