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: Sun, 16 Mar 2008 17:46:15 -0700 Message-ID: <47DDBF57.3080908@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> <47DC3AB2.9070502@emf.net> <87ejabv7gg.fsf@stupidchicken.com> <47DC79DE.1000201@emf.net> <47DD8A53.8090902@emf.net> <47DDA79A.6010706@gmail.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 1205712470 32075 80.91.229.12 (17 Mar 2008 00:07:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 17 Mar 2008 00:07:50 +0000 (UTC) Cc: Chong Yidong , Dan Nicolaescu , emacs-devel@gnu.org, Stefan Monnier , "Kim F. Storm" To: "Lennart Borgman (gmail)" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 17 01:08:18 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 1Jb2tk-0004aU-Qn for ged-emacs-devel@m.gmane.org; Mon, 17 Mar 2008 01:08:17 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jb2tB-0000mK-9r for ged-emacs-devel@m.gmane.org; Sun, 16 Mar 2008 20:07:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jb2t5-0000m8-Tw for emacs-devel@gnu.org; Sun, 16 Mar 2008 20:07:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jb2t3-0000jk-Bm for emacs-devel@gnu.org; Sun, 16 Mar 2008 20:07:34 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jb2t2-0000jW-Bu for emacs-devel@gnu.org; Sun, 16 Mar 2008 20:07:32 -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 1Jb2t1-0008Ih-TS for emacs-devel@gnu.org; Sun, 16 Mar 2008 20:07:32 -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 25655080; Sun, 16 Mar 2008 17:07:18 -0700 User-Agent: Thunderbird 1.5.0.5 (X11/20060808) In-Reply-To: <47DDA79A.6010706@gmail.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:92788 Archived-At: Lennart Borgman (gmail) wrote: > > I translate it to something like this in elisp code: > > ;;;; pre-pre > ... There's no need for a pre-pre hook or for a test of whether the last sequence was shifted. You're using the "three variables" correctly, but there are simpler ways to use them to achieve the same effect. > ;;;; post-post > ;; > (if buffer-was-changed > (setq preserved-tm nil) > (unless preserved-tm > (when user-wants-it > (setq preserved-tm maybe-preserved-tm)))) > (setq tm preserved-tm) > > No. "buffer-was-changed" has nothing to do with anything here. Sorry. Nor is there any need for a "post-post" hook. The command loop can simply, unconditionally, copy tentative-mark to maybe-preserved-... before running a command, and preserved-... to tentative-mark before returning control to the user -- two unconditional "setq"s in the loop. None of this "buffer-was-changed" stuff. Those distinctions happen elsewhere in this scheme, and on a different basis. -t -t