all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* CUA-mode and conflicts with C-x commands
@ 2010-04-16 12:50 LanX
  2010-04-16 13:16 ` LanX
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: LanX @ 2010-04-16 12:50 UTC (permalink / raw)
  To: help-gnu-emacs

Hi

Shortcut conflict or another clash of civilizations ...

In CUA-mode I regularly get bitten by unwanted deletes of regions with
C-x when trying to save or alike...

There different (intelligent) approaches I can think of are:

a) moving CUA's kill to C-x C-x
b) undoing the kill if C-x is followed by C-x
c) automatically undoing the kill if C-x is followed by C-s and alike
d) shifting the most frequent C-x mode-map commands to other bindings

what do you suggest?

cheers
  rolf


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: CUA-mode and conflicts with C-x commands
  2010-04-16 12:50 CUA-mode and conflicts with C-x commands LanX
@ 2010-04-16 13:16 ` LanX
  2010-05-04 21:17 ` Lennart Borgman
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: LanX @ 2010-04-16 13:16 UTC (permalink / raw)
  To: help-gnu-emacs

UPDATE:

I found this in the docs:

-------------
If you really need to perform a command which starts with one of
the prefix keys even when the region is active, you have three
options:
- press the prefix key twice very quickly (within 0.2 seconds),
- press the prefix key and the following key within 0.2 seconds, or
- use the SHIFT key with the prefix key, i.e. C-X or C-C

This behavior can be customized via the
cua-prefix-override-inhibit-delay variable.
------------

well I'm experimenting with the delay but it either to long or
produces unwanted actions :(

I think mapping CUA's cut (cua--prefix-cut-handle) to C-x C-x fit's me
the most ...

 I can easily learn to type x twice when holding down Control and a
second C-x  will cause no damage when used in FF or other
applications.

But how to I modify cua-base.el accordingly are there any maintainers
here to ask?


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: CUA-mode and conflicts with C-x commands
  2010-04-16 12:50 CUA-mode and conflicts with C-x commands LanX
  2010-04-16 13:16 ` LanX
@ 2010-05-04 21:17 ` Lennart Borgman
       [not found] ` <mailman.39.1273007891.29092.help-gnu-emacs@gnu.org>
  2010-05-06  9:38 ` Xah Lee
  3 siblings, 0 replies; 10+ messages in thread
From: Lennart Borgman @ 2010-05-04 21:17 UTC (permalink / raw)
  To: LanX; +Cc: help-gnu-emacs

On Fri, Apr 16, 2010 at 2:50 PM, LanX <lanx.perl@googlemail.com> wrote:
> Hi
>
> Shortcut conflict or another clash of civilizations ...
>
> In CUA-mode I regularly get bitten by unwanted deletes of regions with
> C-x when trying to save or alike...
>
> There different (intelligent) approaches I can think of are:
>
> a) moving CUA's kill to C-x C-x
> b) undoing the kill if C-x is followed by C-x
> c) automatically undoing the kill if C-x is followed by C-s and alike
> d) shifting the most frequent C-x mode-map commands to other bindings
>
> what do you suggest?

I am always using S-C-x when I don't want to delete the region. It
took some days to get used to it, but it is not very difficult since I
actually have a visual clue there (since the region is visually
marked).

But this is easier to do if you are using sticky keys (see EmacsWiki).

> cheers
>  rolf
>




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: CUA-mode and conflicts with C-x commands
       [not found] ` <mailman.39.1273007891.29092.help-gnu-emacs@gnu.org>
@ 2010-05-05 20:04   ` LanX
  2010-05-06  0:02     ` Lennart Borgman
  0 siblings, 1 reply; 10+ messages in thread
From: LanX @ 2010-05-05 20:04 UTC (permalink / raw)
  To: help-gnu-emacs

Hi Lennart,

> I am always using S-C-x when I don't want to delete the region. It
> took some days to get used to it, but it is not very difficult since I
> actually have a visual clue there (since the region is visually
> marked).

Thanks, but I'm looking for keybindings that are somehow compatible
when I leave emacs....

E.g. S-C-x does a toggle of the writing direction in my Firefox ...
8-|

But C-x C-x has no further effect in FF.

(for instance I bound C-a to eginning-of-line and C-a C-a to mark-
whole-buffer, works fine! 8)

I think I'm gonna try to enlarge the time-spam cua-mode waits for the
second key if a region is marked (default is something like 0.2 secs)
and try to bind the second C-x to cut the region right away.

Like this I can rapidly hit the x again without leaving the C-key.

And I can't think of a situation where I need  exchange-point-and-mark
with C-x C-x when a region is already marked...

cheers
  Rolf



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: CUA-mode and conflicts with C-x commands
  2010-05-05 20:04   ` LanX
@ 2010-05-06  0:02     ` Lennart Borgman
  2010-05-06  0:31       ` LanX
  0 siblings, 1 reply; 10+ messages in thread
From: Lennart Borgman @ 2010-05-06  0:02 UTC (permalink / raw)
  To: LanX; +Cc: help-gnu-emacs

On Wed, May 5, 2010 at 10:04 PM, LanX <lanx.perl@googlemail.com> wrote:
> Hi Lennart,
>
>> I am always using S-C-x when I don't want to delete the region. It
>> took some days to get used to it, but it is not very difficult since I
>> actually have a visual clue there (since the region is visually
>> marked).
>
> Thanks, but I'm looking for keybindings that are somehow compatible
> when I leave emacs....
>
> E.g. S-C-x does a toggle of the writing direction in my Firefox ...
> 8-|


Why do you do S-C-x in Firefox? Are you using some add-on that gives
you Emacs bindings there, or?

In that case wouldn't it be good to ask the maintainers of that add-on
to support S-C-x the way cua-mode does it?




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: CUA-mode and conflicts with C-x commands
  2010-05-06  0:02     ` Lennart Borgman
@ 2010-05-06  0:31       ` LanX
  2010-05-06 10:06         ` Lennart Borgman
       [not found]         ` <mailman.21.1273140408.10435.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 10+ messages in thread
From: LanX @ 2010-05-06  0:31 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 552 bytes --]

>
> Why do you do S-C-x in Firefox? Are you using some add-on that gives
> you Emacs bindings there, or?
>
>
no you misunderstood me, I want to avoid to learn any new emacs keybindings
that have a very different meaning in other applications.

e.g C-w closes a tab in FF, thats why I want to restrict me to always use
C-x for cutting, otherwise I have restore FF-Windows 10 times per day.

Actually emacs keybindings are mentioned in the FF docs - something about
activating them in Gnome would also activate them in FF. But I couldn't
figure out how.

[-- Attachment #2: Type: text/html, Size: 760 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: CUA-mode and conflicts with C-x commands
  2010-04-16 12:50 CUA-mode and conflicts with C-x commands LanX
                   ` (2 preceding siblings ...)
       [not found] ` <mailman.39.1273007891.29092.help-gnu-emacs@gnu.org>
@ 2010-05-06  9:38 ` Xah Lee
  3 siblings, 0 replies; 10+ messages in thread
From: Xah Lee @ 2010-05-06  9:38 UTC (permalink / raw)
  To: help-gnu-emacs

On Apr 16, 5:50 am, LanX <lanx.p...@googlemail.com> wrote:
> Hi
>
> Shortcut conflict or another clash of civilizations ...
>
> In CUA-mode I regularly get bitten by unwanted deletes of regions with
> C-x when trying to save or alike...
>
> There different (intelligent) approaches I can think of are:
>
> a) moving CUA's kill to C-x C-x
> b) undoing the kill if C-x is followed by C-x
> c) automatically undoing the kill if C-x is followed by C-s and alike
> d) shifting the most frequent C-x mode-map commands to other bindings
>
> what do you suggest?

personally, i use a new keybinding set. So, save is Ctrl+s, copy and
paste is the familiar Ctrl+ x c v. (don't even need cua mode on) So
there's no conflict. You might try it here:

  http://xahlee.org/emacs/ergonomic_emacs_keybinding.html

  Xah
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: CUA-mode and conflicts with C-x commands
  2010-05-06  0:31       ` LanX
@ 2010-05-06 10:06         ` Lennart Borgman
       [not found]         ` <mailman.21.1273140408.10435.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 10+ messages in thread
From: Lennart Borgman @ 2010-05-06 10:06 UTC (permalink / raw)
  To: LanX; +Cc: help-gnu-emacs

On Thu, May 6, 2010 at 2:31 AM, LanX <lanx.perl@googlemail.com> wrote:
>> Why do you do S-C-x in Firefox? Are you using some add-on that gives
>> you Emacs bindings there, or?
>>
>
> no you misunderstood me, I want to avoid to learn any new emacs keybindings
> that have a very different meaning in other applications.


I understand that. What meaning have you found for S-C-x in other applications?

What meaning have you found in other applications for C-x when there
is no selection?


> e.g C-w closes a tab in FF, thats why I want to restrict me to always use
> C-x for cutting, otherwise I have restore FF-Windows 10 times per day.
> Actually emacs keybindings are mentioned in the FF docs - something about
> activating them in Gnome would also activate them in FF. But I couldn't
> figure out how.
>




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: CUA-mode and conflicts with C-x commands
       [not found]         ` <mailman.21.1273140408.10435.help-gnu-emacs@gnu.org>
@ 2010-05-06 12:04           ` LanX
  2010-05-06 21:49             ` Lennart Borgman
  0 siblings, 1 reply; 10+ messages in thread
From: LanX @ 2010-05-06 12:04 UTC (permalink / raw)
  To: help-gnu-emacs

I told you already:

> E.g. S-C-x does a toggle of the writing direction in my Firefox ...

go into a textarea and see yourself how it looks like to write like in
Hebrew or Arabic.

I tried this yesterday:

-------------------------------------
(defun cua-cut-region-xx (arg)
  "do cua-cut-region only if there is a region"
  (interactive "P")
  (if mark-active
      (cua-cut-region arg)
    (cua-exchange-point-and-mark arg)
    )
  )
(local-set-key (kbd "C-x C-x") 'cua-cut-region-xx)
-------------------------------------

but it's not really working, seems like I have to dive deeper into the
mechanisms of cua.

ahh now I see why:

------------------------------------------
from "cua-prefix-override-inhibit-delay"
...
As a special case, if the prefix keys repeated within this time, the
first prefix key is discarded, so typing a prefix key twice in quick
succession will also inhibit overriding the prefix key.
------------------------------------------

so quickly C-x C-x has the same meaning like your S-C-x.

well better ... but still not ergonomic...


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: CUA-mode and conflicts with C-x commands
  2010-05-06 12:04           ` LanX
@ 2010-05-06 21:49             ` Lennart Borgman
  0 siblings, 0 replies; 10+ messages in thread
From: Lennart Borgman @ 2010-05-06 21:49 UTC (permalink / raw)
  To: LanX; +Cc: help-gnu-emacs

On Thu, May 6, 2010 at 2:04 PM, LanX <lanx.perl@googlemail.com> wrote:
> I told you already:
>
>> E.g. S-C-x does a toggle of the writing direction in my Firefox ...
>
> go into a textarea and see yourself how it looks like to write like in
> Hebrew or Arabic.


I see. If you need to toggle that in Firefox then it might of course
be a problem to use S-C-x in Emacs too. If you don't neeed to toggle
that I can't see the problem.

But even if you need that toggling still the use in Firefox and that
in Emacs of S-C-x looks so far apart (ie different situations) to me
so it looks easy to learn to distinguish them. I do not think I have
ever tried S-C-x outside of Emacs. Still I use it inside Emacs quite a
bit in some specific situations. (Those are so specific so I could
have come up with new key bindings for them, but for me it is not
worth the effort even if it would not take me many minutes. The reason
is partly that I would just as quickly forget them ... ;-)




^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-05-06 21:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-16 12:50 CUA-mode and conflicts with C-x commands LanX
2010-04-16 13:16 ` LanX
2010-05-04 21:17 ` Lennart Borgman
     [not found] ` <mailman.39.1273007891.29092.help-gnu-emacs@gnu.org>
2010-05-05 20:04   ` LanX
2010-05-06  0:02     ` Lennart Borgman
2010-05-06  0:31       ` LanX
2010-05-06 10:06         ` Lennart Borgman
     [not found]         ` <mailman.21.1273140408.10435.help-gnu-emacs@gnu.org>
2010-05-06 12:04           ` LanX
2010-05-06 21:49             ` Lennart Borgman
2010-05-06  9:38 ` Xah Lee

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.