From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thomas Lord Newsgroups: gmane.emacs.devel Subject: Re: Shift-movement selection Date: Wed, 12 Mar 2008 16:59:35 -0700 Message-ID: <47D86E67.9090008@emf.net> References: <200803050637.m256bXL3008361@sallyv1.ics.uci.edu> <87hcfkdhqk.fsf@stupidchicken.com> <87d4q8sq9c.fsf@jurta.org> <8763w0n393.fsf@catnip.gol.com> <871w6ounk0.fsf@kfs-lx.rd.rdm> <87ablacdxt.fsf@catnip.gol.com> <87skyzzeng.fsf@catnip.gol.com> <87fxuyobxt.fsf@kfs-lx.rd.rdm> <47D56474.9000300@gmail.com> <87myp4p88k.fsf@kfs-lx.rd.rdm> <87bq5j1tsa.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 1205364085 1969 80.91.229.12 (12 Mar 2008 23:21:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Mar 2008 23:21:25 +0000 (UTC) Cc: rms@gnu.org, cyd@stupidchicken.com, lennart.borgman@gmail.com, emacs-devel@gnu.org, juri@jurta.org, monnier@iro.umontreal.ca, miles@gnu.org To: "Kim F. Storm" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 13 00:21:52 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 1JZaGe-0005GZ-6G for ged-emacs-devel@m.gmane.org; Thu, 13 Mar 2008 00:21:52 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JZaG5-0005zV-GR for ged-emacs-devel@m.gmane.org; Wed, 12 Mar 2008 19:21:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JZaG1-0005xi-Oq for emacs-devel@gnu.org; Wed, 12 Mar 2008 19:21:13 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JZaG0-0005vc-8Q for emacs-devel@gnu.org; Wed, 12 Mar 2008 19:21:13 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JZaG0-0005vW-0L for emacs-devel@gnu.org; Wed, 12 Mar 2008 19:21:12 -0400 Original-Received: from mail.42inc.com ([205.149.0.25]) by monty-python.gnu.org with esmtps (SSL 3.0:RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1JZaFs-00075e-Hn; Wed, 12 Mar 2008 19:21:04 -0400 X-TFF-CGPSA-Version: 1.5 X-TFF-CGPSA-Filter-42inc: Scanned X-42-Virus-Scanned: by 42 Antivirus -- Found to be clean. Original-Received: from [69.236.65.4] (account lord@emf.net HELO [192.168.1.64]) by mail.42inc.com (CommuniGate Pro SMTP 5.0.13) with ESMTPA id 25263384; Wed, 12 Mar 2008 16:21:00 -0700 User-Agent: Thunderbird 1.5.0.5 (X11/20060808) In-Reply-To: <87bq5j1tsa.fsf@kfs-lx.rd.rdm> 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:92335 Archived-At: Maybe it's even simpler than an i-search-like recursive edit: I'm not certain how CUA mode works in particular but "shift-mark mode" in the abstract is a very logical extension of Emacs' mark-stack model with the added benefit that it "works like Windows users expect": Emacs by default lets you push and pop marks on the stack. The shift-mark mode concept seems to me to be the idea of "tentatively" pushing a mark on the mark stack. It requires a two-phase commit from the user to turn that into a first-class mark and the default outcome is to abandon the tentative mark. To "enter shift-mark mode" is to push a tentative mark. From this point on, commands behave as if a mark was pushed -- but this is a tentative mark and could go away easily between any two commands. After pushing a tentative mark, the user edits as normal with that mark in effect -- but with a catch. There is a post-command hook installed that, unless some flag is flipped by the last command, will discard the tentative mark. By default, we want a shifted key-sequence to mean the same thing as the un-shifted sequence, except that the flag is flipped and so the tentative mark stays on the stack. A single command used as the default binding of many shifted keys can accomplish that. That same command can also arrange to implicitly push a tentative mark, if invoked when not already in shift-mode. This saves keystrokes even for hard-core emacs users: With tentative marks, the default is to discard the mark. That's very convenient when copying to the kill ring. Set a tentative mark at one end of what to copy. Shiftedly navigate to the other end. Copy to the kill ring discarding the tentative mark (or, S-M-w to copy but keep the tentative mark). You've added to the kill ring without needing to clear an item from your mark stack. Finally, use S-C-space to convert a tentative mark to a permanent one, when you want. Implementing this requires a strange function to serve as the default binding of relevant shifted keys, plus some hook functions and tweaks to the mark stack to manage "tentative marks". Not much else. -t