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: Shift selection using interactive spec Date: Sat, 15 Mar 2008 18:16:52 +0100 Message-ID: <8763vndi0r.fsf@kfs-lx.rd.rdm> References: <87k5k69p92.fsf@stupidchicken.com> <200803140408.m2E47hPU014494@sallyv1.ics.uci.edu> <87prtxpekk.fsf@kfs-lx.rd.rdm> <87abl11ilo.fsf@stupidchicken.com> <874pb9koyw.fsf@stupidchicken.com> <87od9gzqv9.fsf@stupidchicken.com> <87bq5gytbi.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1205601446 29960 80.91.229.12 (15 Mar 2008 17:17:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 15 Mar 2008 17:17:26 +0000 (UTC) Cc: Dan Nicolaescu , Stefan Monnier , emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 15 18:17: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 1Jaa12-0000hi-CN for ged-emacs-devel@m.gmane.org; Sat, 15 Mar 2008 18:17:52 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jaa0S-0000bB-Rf for ged-emacs-devel@m.gmane.org; Sat, 15 Mar 2008 13:17:16 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jaa0O-0000aS-D5 for emacs-devel@gnu.org; Sat, 15 Mar 2008 13:17:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jaa0I-0000ZM-Kf for emacs-devel@gnu.org; Sat, 15 Mar 2008 13:17:11 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jaa0I-0000Z7-F2 for emacs-devel@gnu.org; Sat, 15 Mar 2008 13:17:06 -0400 Original-Received: from mail-relay.sonofon.dk ([212.88.64.25]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1Jaa0I-000518-Bq for emacs-devel@gnu.org; Sat, 15 Mar 2008 13:17:06 -0400 Original-Received: (qmail 97107 invoked from network); 15 Mar 2008 17:16:53 -0000 Original-Received: from unknown (HELO kfs-lx.rd.rdm.cua.dk) (213.83.150.21) by 0 with SMTP; 15 Mar 2008 17:16:53 -0000 In-Reply-To: <87bq5gytbi.fsf@stupidchicken.com> (Chong Yidong's message of "Sat\, 15 Mar 2008 10\:07\:13 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.92 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.9 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:92687 Archived-At: Chong Yidong writes: > Stefan Monnier writes: > >>> So we define (i) an elisp function called, say, >>> shift-translation-handler, and (ii) a new interactive code that says >>> to call shift-translation-handler when a command is activated through >>> a shift translated keybinding. >> >> No: the function is called every time. *All* the work is done by the >> elisp function. > > I think it would be more elegant to split this up into two pieces: a > variable this-single-command-shift-translated that says whether shift > translation occurred, and a function shift-translation-handler that > temporarily sets transient mark mode. Both would be available to > elisp programs. > > The new interactive spec code ^ would then call > shift-translation-handler if this-single-command-shift-translated is > non-nil, but elisp programs could accomplish this just as easily via > (if this-single-command-shift-translated ...). > > This could also make it easier to handle the possibility that certain > commands might want to accomodate shift selection, but need to handle > it differently than the default. I like this approach. Now, before you settle on a solution, maybe you should also consider how to handle the delete-selection-mode in a sensible way without using the current pre-command-hook + command property approach. Of course, since shift-select is promoted to a standard feature by modifying the relevant commands, we can just take the same approach with delete-selection-mode, i.e. modify the relevant commands to simply honour delsel mode. -- Kim F. Storm http://www.cua.dk