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 selection using interactive spec Date: Tue, 18 Mar 2008 10:45:07 -0700 Message-ID: <47DFFFA3.7090709@emf.net> 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> <8763vndi0r.fsf@kfs-lx.rd.rdm> <87hcf6ratt.fsf@stupidchicken.com> <878x0if9ul.fsf@stupidchicken.com> <87od9e9gnx.fsf@stupidchicken.com> <87skyo5bvk.fsf@stupidchicken.com> 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 1205861162 17704 80.91.229.12 (18 Mar 2008 17:26:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 18 Mar 2008 17:26:02 +0000 (UTC) Cc: Dan Nicolaescu , Stefan Monnier , "Kim F. Storm" , emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 18 18:26:30 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 1JbfZu-00033L-4D for ged-emacs-devel@m.gmane.org; Tue, 18 Mar 2008 18:26:22 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JbfZK-00025G-56 for ged-emacs-devel@m.gmane.org; Tue, 18 Mar 2008 13:25:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JbfZG-000251-7x for emacs-devel@gnu.org; Tue, 18 Mar 2008 13:25:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JbfZD-00024m-OJ for emacs-devel@gnu.org; Tue, 18 Mar 2008 13:25:41 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JbfZD-00024j-KY for emacs-devel@gnu.org; Tue, 18 Mar 2008 13:25:39 -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 1JbfZC-0003xm-7l for emacs-devel@gnu.org; Tue, 18 Mar 2008 13:25:39 -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 25805970; Tue, 18 Mar 2008 10:06:05 -0700 User-Agent: Thunderbird 1.5.0.5 (X11/20060808) In-Reply-To: <87skyo5bvk.fsf@stupidchicken.com> 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:92906 Archived-At: Chong Yidong wrote: > After playing around with an implementation of this, I feel that it is > very problematic. > Have you looked at the other recent messages about scrolling the selection outside of the visible region? There's a related problem, too. Not many GUIs give you Emacs' ability to display the same "buffer" in two windows *but* it is the case that the selections in two windows are always independent of one another. Yet in Emacs, because the buffer-local mark stack is used instead of a window-local tentative mark, all windows on the same buffer share one end point of the selection in common. I can't see any user benefit to that restriction at all. I think it is a symptom of a design mistake in the first place. (The mark stack is a fine and powerful thing. It just isn't suitable as a tentative mark.) That suggests a simple model where a window-local tentative-mark, if not nil, makes the cursor fat. In turn, that leaves the question of how to arrange that most commands turn it off by default yet commands can treat it specially. I don't know of any simpler way to do that than with the two variables that relate to command phases: maybe-preserved-tentative-mark so that commands know what tentative mark the user last saw. preserved-tentative-mark so that commands can assert what tentative mark the user should next see. The concept is probably useful in low-level elisp, too. Less need to write code like: (let ((start (point))) (forward-word) (delete-region start (point)) (insert "bar")) if there's an available short-hand, something like: (with-tentative-mark (point) (forward-word) (insert "bar")) Programs can usefully "shift select" on their own, behind the user's back, just as a handy way to express the common pattern of having to operate on some region that is being measured out on-the-fly. -t