From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Shift-movement selection Date: Tue, 11 Mar 2008 22:33:35 +0000 Message-ID: <20080311223335.GA4420@muc.de> References: <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> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1205273996 4767 80.91.229.12 (11 Mar 2008 22:19:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Mar 2008 22:19:56 +0000 (UTC) Cc: rms@gnu.org, cyd@stupidchicken.com, emacs-devel@gnu.org, juri@jurta.org, storm@cua.dk, Miles Bader To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 11 23:20:23 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 1JZCpY-0002Wl-2j for ged-emacs-devel@m.gmane.org; Tue, 11 Mar 2008 23:20:20 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JZCoz-00070i-Dm for ged-emacs-devel@m.gmane.org; Tue, 11 Mar 2008 18:19:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JZCou-0006zv-7r for emacs-devel@gnu.org; Tue, 11 Mar 2008 18:19:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JZCop-0006zX-Fy for emacs-devel@gnu.org; Tue, 11 Mar 2008 18:19:39 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JZCop-0006zN-BQ for emacs-devel@gnu.org; Tue, 11 Mar 2008 18:19:35 -0400 Original-Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JZCoo-00050a-Mn for emacs-devel@gnu.org; Tue, 11 Mar 2008 18:19:35 -0400 Original-Received: (qmail 6484 invoked by uid 3782); 11 Mar 2008 22:19:27 -0000 Original-Received: from acm.muc.de (p57AF4A75.dip.t-dialin.net [87.175.74.117]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Tue, 11 Mar 2008 23:19:23 +0100 Original-Received: (qmail 4663 invoked by uid 1000); 11 Mar 2008 22:33:35 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de 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:92210 Archived-At: On Sun, Mar 09, 2008 at 11:37:27PM -0400, Stefan Monnier wrote: > >> (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!] > Most commands already deactivate the mark. So which ones would be left? Scrolling commands should not deactivate the mark; things like C-l, C-M-l, ..... After all, you're going to be wanting to shift point to the middle of the screen to see more of what you might want to put into the region. C-x 2 should not deactivate the mark, neither should commands which operate on the other window (such as scroll-other-window-down). In fact, more or less all commands with the 'isearch-scroll property could usefully have a 'no-demarkation property. > Do they matter? Yes, they matter very much. Well, they would for me if I were to start using shift-movement to extend a region. Two of the most inhibiting things for me whilst using a "lowest common denominator" editor are the fear of a painsteakingly created region vanishing in a puff of smoke at a careless keypress, and the annoyance of practically all the features of the editor being unavailable whenever I have a region I don't want to lose. It would be nice, at least for me, for these annoyances to be reduced as far as possible. > Stefan -- Alan Mackenzie (Nuremberg, Germany).