From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: Shift-movement selection Date: Mon, 10 Mar 2008 08:00:35 +0900 Message-ID: <87skyzzeng.fsf@catnip.gol.com> 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> Reply-To: Miles Bader NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1205103663 24575 80.91.229.12 (9 Mar 2008 23:01:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Mar 2008 23:01:03 +0000 (UTC) Cc: juri@jurta.org, cyd@stupidchicken.com, storm@cua.dk, rms@gnu.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 10 00:01: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 1JYUWH-0005vN-EU for ged-emacs-devel@m.gmane.org; Mon, 10 Mar 2008 00:01:29 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYUVj-0001Eb-AJ for ged-emacs-devel@m.gmane.org; Sun, 09 Mar 2008 19:00:55 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JYUVf-0001EW-Sn for emacs-devel@gnu.org; Sun, 09 Mar 2008 19:00:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JYUVe-0001DE-Io for emacs-devel@gnu.org; Sun, 09 Mar 2008 19:00:51 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYUVe-0001DB-Br for emacs-devel@gnu.org; Sun, 09 Mar 2008 19:00:50 -0400 Original-Received: from smtp12.dentaku.gol.com ([203.216.5.74]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JYUVW-0003Gi-AK; Sun, 09 Mar 2008 19:00:43 -0400 Original-Received: from 203-216-96-086.dsl.gol.ne.jp ([203.216.96.86] helo=catnip.gol.com) by smtp12.dentaku.gol.com with esmtpa (Dentaku) id 1JYUVR-0002DC-87; Mon, 10 Mar 2008 08:00:37 +0900 Original-Received: by catnip.gol.com (Postfix, from userid 1000) id 24B3C2FF7; Mon, 10 Mar 2008 08:00:35 +0900 (JST) System-Type: i686-pc-linux-gnu In-Reply-To: (Stefan Monnier's message of "Sun, 09 Mar 2008 18:34:42 -0400") Original-Lines: 29 X-Virus-Scanned: ClamAV GOL (outbound) X-Abuse-Complaints: abuse@gol.com X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) 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:91946 Archived-At: Stefan Monnier writes: > (defun activate-on-shift-selecting-movement () > (if (this-command-keys-are-shifted-p) > (progn > (setq shift-selecting-movement t) > (unless mark-active (set-mark))) > (when shift-selecting-movement > (setq shift-selecting-movement nil) > (when mark-active (deactivate-mark))))) > > and then call it from wherever it's considered useful > (e.g. forward-char, next-line, ...). AFAICS, such an approach would make deselection much less likely to work consistently: the way it's _supposed_ to work is that any pretty much any command except for the special shifted versions should cause deactivation -- and in emacs that's pretty much _every command_. So to make it work "correctly", you need to modify all commands in emacs! [yikes!] The method I showed earlier seems almost as simple, and has the advantage that it's very unintrusive -- you only need to worry about the commands which implement the special behavior -- and seems to work pretty well. -Miles -- Brain, n. An apparatus with which we think we think.