From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.devel Subject: Re: marking using shifted arrow keys (CUA mode) Date: Sat, 21 Jul 2007 16:25:19 +0200 Message-ID: References: Reply-To: Reiner Steib NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1185027996 9150 80.91.229.12 (21 Jul 2007 14:26:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 21 Jul 2007 14:26:36 +0000 (UTC) To: storm@cua.dk (Kim F. Storm), emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 21 16:26:34 2007 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 1ICFug-0000d4-Hh for ged-emacs-devel@m.gmane.org; Sat, 21 Jul 2007 16:26:30 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ICFug-0005g9-2t for ged-emacs-devel@m.gmane.org; Sat, 21 Jul 2007 10:26:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ICFub-0005fI-Gx for emacs-devel@gnu.org; Sat, 21 Jul 2007 10:26:25 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ICFua-0005f4-Je for emacs-devel@gnu.org; Sat, 21 Jul 2007 10:26:24 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ICFua-0005f1-E9 for emacs-devel@gnu.org; Sat, 21 Jul 2007 10:26:24 -0400 Original-Received: from mail.uni-ulm.de ([134.60.1.11]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1ICFuZ-0006se-R0 for emacs-devel@gnu.org; Sat, 21 Jul 2007 10:26:24 -0400 Original-Received: from bridgekeeper.physik.uni-ulm.de (bridgekeeper.physik.uni-ulm.de [134.60.10.123]) by mail.uni-ulm.de (8.14.1/8.14.1) with ESMTP id l6LEQ4NV005579; Sat, 21 Jul 2007 16:26:04 +0200 (MEST) Original-Received: from localhost (bridgekeeper.physik.uni-ulm.de [134.60.10.123]) by bridgekeeper.physik.uni-ulm.de (Postfix) with ESMTP id 1158E12BE4; Sat, 21 Jul 2007 16:26:04 +0200 (CEST) X-Face: mtjf/D:es1T0wHO:&CJ'ZXe"l; 3C--rw\z!{`eFwL){|]RpI+4{u25L=5C /0>KuGeTsk<~<&NE-AKV1560e!+RJeyWmSskkrJm?[vUV#66{T_m|Ae<||Ku#Mk5`y&O`n~z2; n8eP J5#2h@2eQgV@E70IY_0WlEx!"&giy{+\%h1LJox$zv@/l%ZmU4^tZA>xQpnkUBVC5.jpg#0'(+2?Rs )NAr:>3<=WxHE$ktbLysDIM5TbmHu*3 (Reiner Steib's message of "Mon, 16 Jul 2007 20:45:34 +0200") User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux) X-DCC-dcc.uncw.edu-Metrics: poseidon 1201; Body=2 Fuz1=2 Fuz2=2 X-Virus-Scanned: by amavisd-new X-detected-kernel: Genre and OS details not recognized. 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:75230 Archived-At: On Mon, Jul 16 2007, Reiner Steib wrote: > - add index entry > - add hint and a cross reference in (info "(emacs)Marking Objects") > - "movement keys" -> "arrow keys" ... plus: - Define cua-selection-mode using define-minor-mode. - Document cua-selection-mode in the manual Here's the patch. I'm not sure how much of the documentation should be in "Marking Objects" and how much in "CUA Bindings". --8<---------------cut here---------------start------------->8--- Index: lisp/ChangeLog =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/ChangeLog,v retrieving revision 1.11049.2.143 diff -u -r1.11049.2.143 ChangeLog --- lisp/ChangeLog 21 Jul 2007 09:06:17 -0000 1.11049.2.143 +++ lisp/ChangeLog 21 Jul 2007 14:11:19 -0000 @@ -1,3 +1,8 @@ +2007-07-21 Reiner Steib + + * emulation/cua-base.el (cua-selection-mode): Define using + cua-selection-mode to allow customization. + 2007-07-21 Thien-Thi Nguyen * emacs-lisp/lisp-mode.el (calculate-lisp-indent): In the Index: lisp/emulation/cua-base.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/emulation/cua-base.el,v retrieving revision 1.78 diff -u -r1.78 cua-base.el --- lisp/emulation/cua-base.el 24 Feb 2007 21:52:43 -0000 1.78 +++ lisp/emulation/cua-base.el 21 Jul 2007 14:11:20 -0000 @@ -1582,14 +1582,25 @@ (if (or (nth 1 cua--saved-state) (nth 2 cua--saved-state)) " enabled" ""))) (setq cua--saved-state nil)))) - ;;;###autoload -(defun cua-selection-mode (arg) - "Enable CUA selection mode without the C-z/C-x/C-c/C-v bindings." - (interactive "P") - (setq-default cua-enable-cua-keys nil) - (cua-mode arg)) - +(define-minor-mode cua-selection-mode + "Toggle CUA selection mode without the C-z/C-x/C-c/C-v bindings. +When enabled, using shifted movement keys will activate the +region (and highlight the region using `transient-mark-mode'), +and typed text replaces the active selection." + :global t + :group 'cua + :require 'cua-base + :lighter nil + :keymap nil + :link '(emacs-commentary-link "cua-base.el") + ;; nil nil nil + (if cua-selection-mode + (progn + (setq-default cua-enable-cua-keys nil) + (cua-mode 1)) + (setq-default cua-enable-cua-keys t) + (cua-mode -1))) (defun cua-debug () "Toggle CUA debugging." Index: man/ChangeLog =================================================================== RCS file: /cvsroot/emacs/emacs/man/ChangeLog,v retrieving revision 1.1267.2.23 diff -u -r1.1267.2.23 ChangeLog --- man/ChangeLog 13 Jul 2007 20:36:29 -0000 1.1267.2.23 +++ man/ChangeLog 21 Jul 2007 14:11:22 -0000 @@ -1,3 +1,11 @@ +2007-07-21 Reiner Steib + + * killing.texi (CUA Bindings): Add index entry for marking using + shifted arrow keys. Document cua-selection-mode. Reorder. + + * mark.texi (Marking Objects): Document cua-selection-mode. Add + refererence to CUA Bindings. + 2007-07-13 Eli Zaretskii * Makefile.in (../info/emacs-mime): Use --enable-encoding. Index: man/killing.texi =================================================================== RCS file: /cvsroot/emacs/emacs/man/killing.texi,v retrieving revision 1.60 diff -u -r1.60 killing.texi --- man/killing.texi 11 Apr 2007 20:57:52 -0000 1.60 +++ man/killing.texi 21 Jul 2007 14:11:23 -0000 @@ -647,19 +647,22 @@ paste (yank), and @kbd{C-z} undo. Standard Emacs commands like @kbd{C-x C-c} still work, because @kbd{C-x} and @kbd{C-c} only take effect when the mark is active (and the region is highlighted). -However, if you don't want to override these bindings in Emacs at all, -set @code{cua-enable-cua-keys} to @code{nil}. - In CUA mode, using @kbd{Shift} together with the movement keys -activates and highlights the region over which they move. The -standard (unshifted) movement keys deactivate the mark, and typed text -replaces the active region as in Delete-Selection mode -(@pxref{Mouse Commands}). - - To enter an Emacs command like @kbd{C-x C-f} while the mark is -active, use one of the following methods: either hold @kbd{Shift} -together with the prefix key, e.g. @kbd{S-C-x C-f}, or quickly type -the prefix key twice, e.g. @kbd{C-x C-x C-f}. + To enter an Emacs command like @kbd{C-x C-f} while the mark is active, +use one of the following methods: either hold @kbd{Shift} together with +the prefix key, e.g. @kbd{S-C-x C-f}, or quickly type the prefix key +twice, e.g. @kbd{C-x C-x C-f}. If you don't want to override these +bindings in Emacs at all, set @code{cua-enable-cua-keys} to @code{nil}. + +@cindex marking, using shifted arrow keys + In CUA mode, using @kbd{Shift} together with the movement keys (the +arrow keys, @kbd{C-f}, etc.) activates and highlights the region over +which they move. The standard (unshifted) movement keys deactivate the +mark, and typed text replaces the active region as in Delete-Selection +mode (@pxref{Mouse Commands}). If you only want to use marking using +shifted movement keys without the +@kbd{C-z}/@kbd{C-x}/@kbd{C-c}/@kbd{C-v} bindings, customize +@code{cua-selection-mode}. @cindex rectangle highlighting CUA mode provides enhanced rectangle support with visible Index: man/mark.texi =================================================================== RCS file: /cvsroot/emacs/emacs/man/mark.texi,v retrieving revision 1.39 diff -u -r1.39 mark.texi --- man/mark.texi 21 Jan 2007 04:41:10 -0000 1.39 +++ man/mark.texi 21 Jul 2007 14:11:23 -0000 @@ -373,6 +373,13 @@ In Transient Mark mode, all of these commands activate the mark. +@c @cindex marking, using shifted arrow keys +@findex cua-selection-mode +@vindex cua-selection-mode + With @code{cua-selection-mode}, @kbd{Shift} together with the movement +keys (the arrow keys, @kbd{C-f}, etc.) activates and highlights the +region over which they move. @xref{CUA Bindings}. + @node Mark Ring @section The Mark Ring --8<---------------cut here---------------end--------------->8--- Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/