From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.devel Subject: Re: position on changing defaults? Date: Mon, 10 Mar 2008 00:17:50 +0100 Message-ID: <47D4701E.3080907@gmail.com> 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> <87wsob5wxa.fsf@kfs-lx.rd.rdm> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1205104710 27287 80.91.229.12 (9 Mar 2008 23:18:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Mar 2008 23:18:30 +0000 (UTC) Cc: rms@gnu.org, cyd@stupidchicken.com, emacs-devel@gnu.org, juri@jurta.org, Stefan Monnier , miles@gnu.org To: "Kim F. Storm" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 10 00:18:57 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 1JYUnA-0002BI-Gf for ged-emacs-devel@m.gmane.org; Mon, 10 Mar 2008 00:18:56 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYUmc-0004r0-4J for ged-emacs-devel@m.gmane.org; Sun, 09 Mar 2008 19:18:22 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JYUmY-0004qu-9J for emacs-devel@gnu.org; Sun, 09 Mar 2008 19:18:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JYUmV-0004qZ-Oq for emacs-devel@gnu.org; Sun, 09 Mar 2008 19:18:16 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYUmV-0004qW-Jf for emacs-devel@gnu.org; Sun, 09 Mar 2008 19:18:15 -0400 Original-Received: from ch-smtp01.sth.basefarm.net ([80.76.149.212]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JYUmO-0006OF-GF; Sun, 09 Mar 2008 19:18:08 -0400 Original-Received: from c83-254-148-228.bredband.comhem.se ([83.254.148.228]:62159 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1JYUmM-0007n6-5D; Mon, 10 Mar 2008 00:18:06 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: <87wsob5wxa.fsf@kfs-lx.rd.rdm> X-Antivirus: avast! (VPS 080309-0, 2008-03-09), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.148.228 X-Scan-Result: No virus found in message 1JYUmM-0007n6-5D. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1JYUmM-0007n6-5D f417bfa7978dc49dc3e93060cc2b8449 X-detected-kernel: by monty-python.gnu.org: Linux 2.6? (barebone, rare!) 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:91951 Archived-At: Kim F. Storm wrote: > 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... Maybe this could be done using a pre-emulation-command-hook run before pre-command-hook? (Compare emulation-mode-maps.) Then some code similar to the code Stefan just sent could be used. That code could look for the CUA property. Maybe it also could look in a table when deciding whether to deactivate the mark.