From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: position on changing defaults? Date: Sun, 09 Mar 2008 23:56:17 +0100 Message-ID: <87wsob5wxa.fsf@kfs-lx.rd.rdm> References: <200803050637.m256bXL3008361@sallyv1.ics.uci.edu> <87hcfkdhqk.fsf@stupidchicken.com> <87d4q8sq9c.fsf@jurta.org> <8763w0n393.fsf@catnip.gol.com> <87bq5p3x8y.fsf@kfs-lx.rd.rdm> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1205103567 24127 80.91.229.12 (9 Mar 2008 22:59:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Mar 2008 22:59:27 +0000 (UTC) Cc: juri@jurta.org, cyd@stupidchicken.com, emacs-devel@gnu.org, Stefan Monnier , miles@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 09 23:59:53 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 1JYUUa-0005On-Or for ged-emacs-devel@m.gmane.org; Sun, 09 Mar 2008 23:59:45 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYUU2-0000dU-Re for ged-emacs-devel@m.gmane.org; Sun, 09 Mar 2008 18:59:10 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JYUTz-0000dP-0x for emacs-devel@gnu.org; Sun, 09 Mar 2008 18:59:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JYUTw-0000dD-8N for emacs-devel@gnu.org; Sun, 09 Mar 2008 18:59:06 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYUTw-0000dA-6M for emacs-devel@gnu.org; Sun, 09 Mar 2008 18:59:04 -0400 Original-Received: from pfepa.post.tele.dk ([195.41.46.235]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JYUTo-0002un-Ha; Sun, 09 Mar 2008 18:58:56 -0400 Original-Received: from kfs-lx.rd.rdm.cua.dk (unknown [80.165.4.121]) by pfepa.post.tele.dk (Postfix) with SMTP id 629C0FAC039; Sun, 9 Mar 2008 23:56:18 +0100 (CET) In-Reply-To: (Richard Stallman's message of "Sun\, 09 Mar 2008 12\:40\:30 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.91 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:91945 Archived-At: Richard Stallman writes: > Binding some set of shifted keys to a command that says "run the > equivalent non-shifted character but do this other special thing" > seems better, because you could override that for individual shifted > keys if you wish. The problem is that running something based on the key - rather than on the command bound to that key is a bad road to take. CUA mode looks for a 'CUA property with value 'move to detect what keys are movements to which the shift modifier may apply. This has the advantage that unrelated modes simply set that property to make them "CUA aware". A generic solution could be to look for a non-nil 'shift property on the command and run a shifted-key-hook prior to running the command, i.e. something like this in the command loop just before running the command: if (!NILP (Vshifted_key_hook) && key_shifted_p && !NILP (Vthis_command) && SYMBOLP (Vthis_command) && !NILP (Fget (Vthis_command, Qshift)) && !NILP (Vrun_hooks)) safe_run_hooks (Qshifted_key_hook); This could be combined with the delayed deactivate-mark hack we discussed earlier to deactivate the mark on non-shifted movement... I can make a patch to do this... -- Kim F. Storm http://www.cua.dk