[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Permanent shift-select-mode (was: delete-selection-mode)
From: |
Juri Linkov |
Subject: |
Permanent shift-select-mode (was: delete-selection-mode) |
Date: |
Sun, 21 Mar 2010 01:51:39 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) |
> 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/
- Re: delete-selection-mode, (continued)
- Re: delete-selection-mode, Johan Bockgård, 2010/03/18
- Re: delete-selection-mode, Juri Linkov, 2010/03/18
- scroll-top-bottom (was: delete-selection-mode), Juri Linkov, 2010/03/19
- Re: scroll-top-bottom, Stefan Monnier, 2010/03/20
- Re: scroll-top-bottom, Juri Linkov, 2010/03/20
- Scrolling commands (was: scroll-top-bottom), Juri Linkov, 2010/03/30
- Re: Scrolling commands (was: scroll-top-bottom), Juanma Barranquero, 2010/03/30
- Re: Scrolling commands, Juri Linkov, 2010/03/31
- Re: Scrolling commands, Juanma Barranquero, 2010/03/31
- Re: delete-selection-mode, Juri Linkov, 2010/03/18
- Permanent shift-select-mode (was: delete-selection-mode),
Juri Linkov <=
- Re: Permanent shift-select-mode, Stefan Monnier, 2010/03/21
- Re: delete-selection-mode, David Kastrup, 2010/03/17
- AW: delete-selection-mode, Berndl, Klaus, 2010/03/17
- Re: AW: delete-selection-mode, Andreas Roehler, 2010/03/17
- AW: AW: delete-selection-mode, Berndl, Klaus, 2010/03/17
- RE: AW: delete-selection-mode, Drew Adams, 2010/03/17
- Re: AW: delete-selection-mode, David Kastrup, 2010/03/17
- Re: AW: delete-selection-mode, David Kastrup, 2010/03/17
- RE: AW: delete-selection-mode, Drew Adams, 2010/03/17
- Re: AW: delete-selection-mode, David Kastrup, 2010/03/17