From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Permanent shift-select-mode (was: delete-selection-mode) Date: Sun, 21 Mar 2010 01:51:39 +0200 Organization: JURTA Message-ID: <87aau2ppxg.fsf_-_@mail.jurta.org> References: <87ocitw2dl.fsf@stupidchicken.com> <201003130001.o2D01FFQ003489@godzilla.ics.uci.edu> <87vdd1yqe4.fsf@stupidchicken.com> <87eijjzrkd.fsf_-_@mail.jurta.org> <8BDB38B3CCBC481CB014CB3DA9FA1948@us.oracle.com> <87y6hq39rk.fsf_-_@mail.jurta.org> <9B30E5E474524F4092443C23D37B92CC@us.oracle.com> <87mxy5fhzk.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1269132096 2332 80.91.229.12 (21 Mar 2010 00:41:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 21 Mar 2010 00:41:36 +0000 (UTC) Cc: 'Chong Yidong' , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 21 01:41:32 2010 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.69) (envelope-from ) id 1Nt9ES-0001q5-86 for ged-emacs-devel@m.gmane.org; Sun, 21 Mar 2010 01:41:32 +0100 Original-Received: from localhost ([127.0.0.1]:46365 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nt9ER-0007bo-MV for ged-emacs-devel@m.gmane.org; Sat, 20 Mar 2010 20:41:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nt9Db-0007Bw-As for emacs-devel@gnu.org; Sat, 20 Mar 2010 20:40:39 -0400 Original-Received: from [140.186.70.92] (port=34311 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nt9DU-0007AK-M2 for emacs-devel@gnu.org; Sat, 20 Mar 2010 20:40:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nt9DK-000158-Vg for emacs-devel@gnu.org; Sat, 20 Mar 2010 20:40:32 -0400 Original-Received: from smtp-out2.starman.ee ([85.253.0.4]:58174 helo=mx2.starman.ee) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nt9DK-00014h-M8 for emacs-devel@gnu.org; Sat, 20 Mar 2010 20:40:22 -0400 X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Original-Received: from mail.starman.ee (62.65.209.96.cable.starman.ee [62.65.209.96]) by mx2.starman.ee (Postfix) with ESMTP id B090D3F410E; Sun, 21 Mar 2010 02:40:14 +0200 (EET) In-Reply-To: <87mxy5fhzk.fsf@mail.jurta.org> (Juri Linkov's message of "Thu, 18 Mar 2010 23:06:23 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/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:122392 Archived-At: > There is also lisp/s-region.el that could be marked obsolete. s-region.el is now obsolete. But unfortunately, `shift-select-mode' is not an exact replacement. There is an significant difference: `shift-select-mode' deactivates the mark when a next key is not shift-translated. The following patch adds a new option `permanent' to `shift-select-mode' that doesn't deactivate the mark: === modified file 'lisp/simple.el' --- lisp/simple.el 2010-03-05 12:01:10 +0000 +++ lisp/simple.el 2010-03-20 23:47:55 +0000 @@ -3956,9 +3956,15 @@ (defcustom shift-select-mode t by any subsequent point motion key that was not shift-translated, or by any action that normally deactivates the mark in Transient Mark mode. +When the value is `permanent', the mark will not be deactivated +by any subsequent point motion key that was not shift-translated. + See `this-command-keys-shift-translated' for the meaning of shift-translation." - :type 'boolean + :type '(choice (const :tag "Off" nil) + (const :tag "Permanent" permanent) + (other :tag "On" t)) + :version "23.1" :group 'editing-basics) (defun handle-shift-selection () @@ -3978,11 +3984,15 @@ (defun handle-shift-selection () its earlier value." (cond ((and shift-select-mode this-command-keys-shift-translated) (unless (and mark-active - (eq (car-safe transient-mark-mode) 'only)) - (setq transient-mark-mode - (cons 'only - (unless (eq transient-mark-mode 'lambda) - transient-mark-mode))) + (or (eq (car-safe transient-mark-mode) 'only) + (eq shift-select-mode 'permanent))) + (setq transient-mark-mode + (if (eq shift-select-mode 'permanent) + (unless (eq transient-mark-mode 'lambda) + transient-mark-mode) + (cons 'only + (unless (eq transient-mark-mode 'lambda) + transient-mark-mode)))) (push-mark nil nil t))) ((eq (car-safe transient-mark-mode) 'only) (setq transient-mark-mode (cdr transient-mark-mode)) -- Juri Linkov http://www.jurta.org/emacs/