all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* C-mode blows away may Ctrl-C binding with a prefix -- how to remap  prefix?
@ 2008-04-18 18:18 lindahlb
  2008-04-18 21:30 ` lindahlb
  2008-04-19  7:17 ` David Hansen
  0 siblings, 2 replies; 7+ messages in thread
From: lindahlb @ 2008-04-18 18:18 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

I'm currently using Windows-esque key bindings for copy (Ctrl-c), cut
(Ctrl-x) and paste (Ctrl-v). They work fine, except when I open a C/C+
+ file. In the major mode, it remaps the (Ctrl-c) key to a keymap
prefix. I want to remap this keymap prefix to another key and return
the (Ctrl-c) mapping to my own copy command. How do I do this?

I currently have a c-mode customization hook, but couldn't figure out
how to do it there. Here is what I tried:
(define-key c-mode-base-map "\C-c" 'smart-copy)

Thanks,
Brian


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

* Re: C-mode blows away may Ctrl-C binding with a prefix -- how to  remap prefix?
  2008-04-18 18:18 C-mode blows away may Ctrl-C binding with a prefix -- how to remap prefix? lindahlb
@ 2008-04-18 21:30 ` lindahlb
  2008-04-18 21:37   ` lindahlb
  2008-04-19  7:17 ` David Hansen
  1 sibling, 1 reply; 7+ messages in thread
From: lindahlb @ 2008-04-18 21:30 UTC (permalink / raw)
  To: help-gnu-emacs

On Apr 18, 12:18 pm, linda...@hotmail.com wrote:
> Hi,
>
> I'm currently using Windows-esque key bindings for copy (Ctrl-c), cut
> (Ctrl-x) and paste (Ctrl-v). They work fine, except when I open a C/C+
> + file. In the major mode, it remaps the (Ctrl-c) key to a keymap
> prefix. I want to remap this keymap prefix to another key and return
> the (Ctrl-c) mapping to my own copy command. How do I do this?
>
> I currently have a c-mode customization hook, but couldn't figure out
> how to do it there. Here is what I tried:
> (define-key c-mode-base-map "\C-c" 'smart-copy)
>
> Thanks,
> Brian

Well, for now I don't use the \C-c prefix, so blowing that away with
'smart-copy is good enough for now. Took forever to find this but,
here it goes:

;; assure that the \C-c isn't a prefix and, instead, performs a smart-
copy
(setq overriding-local-map
  (let
	  ((map (make-sparse-keymap)))
		(suppress-keymap map)
		(define-key map "\C-c" 'smart-copy)
		map
	)
)

Pain in the butt, and it doesn't bother to remap the "\C-c" prefix,
but that can be done by those that really need it.


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

* Re: C-mode blows away may Ctrl-C binding with a prefix -- how to  remap prefix?
  2008-04-18 21:30 ` lindahlb
@ 2008-04-18 21:37   ` lindahlb
  0 siblings, 0 replies; 7+ messages in thread
From: lindahlb @ 2008-04-18 21:37 UTC (permalink / raw)
  To: help-gnu-emacs

On Apr 18, 3:30 pm, linda...@hotmail.com wrote:
> On Apr 18, 12:18 pm, linda...@hotmail.com wrote:
>
> > Hi,
>
> > I'm currently using Windows-esque key bindings for copy (Ctrl-c), cut
> > (Ctrl-x) and paste (Ctrl-v). They work fine, except when I open a C/C+
> > + file. In the major mode, it remaps the (Ctrl-c) key to a keymap
> > prefix. I want to remap this keymap prefix to another key and return
> > the (Ctrl-c) mapping to my own copy command. How do I do this?
>
> > I currently have a c-mode customization hook, but couldn't figure out
> > how to do it there. Here is what I tried:
> > (define-key c-mode-base-map "\C-c" 'smart-copy)
>
> > Thanks,
> > Brian
>
> Well, for now I don't use the \C-c prefix, so blowing that away with
> 'smart-copy is good enough for now. Took forever to find this but,
> here it goes:
>
> ;; assure that the \C-c isn't a prefix and, instead, performs a smart-
> copy
> (setq overriding-local-map
>   (let
>           ((map (make-sparse-keymap)))
>                 (suppress-keymap map)
>                 (define-key map "\C-c" 'smart-copy)
>                 map
>         )
> )
>
> Pain in the butt, and it doesn't bother to remap the "\C-c" prefix,
> but that can be done by those that really need it.

Oh, leave out the (suppress-keymap map) line (it was a copy and paste
artifact), otherwise you can't type anything. :D


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

* Re: C-mode blows away may Ctrl-C binding with a prefix -- how to remap prefix?
  2008-04-18 18:18 C-mode blows away may Ctrl-C binding with a prefix -- how to remap prefix? lindahlb
  2008-04-18 21:30 ` lindahlb
@ 2008-04-19  7:17 ` David Hansen
  2008-04-19  8:23   ` Lennart Borgman (gmail)
  1 sibling, 1 reply; 7+ messages in thread
From: David Hansen @ 2008-04-19  7:17 UTC (permalink / raw)
  To: help-gnu-emacs

On Fri, 18 Apr 2008 11:18:20 -0700 (PDT) lindahlb@hotmail.com wrote:

> I'm currently using Windows-esque key bindings for copy (Ctrl-c), cut
> (Ctrl-x) and paste (Ctrl-v). They work fine, except when I open a C/C+
> + file. In the major mode, it remaps the (Ctrl-c) key to a keymap
> prefix. I want to remap this keymap prefix to another key and return
> the (Ctrl-c) mapping to my own copy command. How do I do this?
>
> I currently have a c-mode customization hook, but couldn't figure out
> how to do it there. Here is what I tried:
> (define-key c-mode-base-map "\C-c" 'smart-copy)

Pretty all major modes use C-c as a prefix.  Better get used to the
`real' key bindings.

David





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

* Re: C-mode blows away may Ctrl-C binding with a prefix -- how to remap prefix?
  2008-04-19  7:17 ` David Hansen
@ 2008-04-19  8:23   ` Lennart Borgman (gmail)
  2008-04-19 10:36     ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Lennart Borgman (gmail) @ 2008-04-19  8:23 UTC (permalink / raw)
  To: help-gnu-emacs

David Hansen wrote:
> On Fri, 18 Apr 2008 11:18:20 -0700 (PDT) lindahlb@hotmail.com wrote:
> 
>> I'm currently using Windows-esque key bindings for copy (Ctrl-c), cut
>> (Ctrl-x) and paste (Ctrl-v). They work fine, except when I open a C/C+
>> + file. In the major mode, it remaps the (Ctrl-c) key to a keymap
>> prefix. I want to remap this keymap prefix to another key and return
>> the (Ctrl-c) mapping to my own copy command. How do I do this?
>>
>> I currently have a c-mode customization hook, but couldn't figure out
>> how to do it there. Here is what I tried:
>> (define-key c-mode-base-map "\C-c" 'smart-copy)
> 
> Pretty all major modes use C-c as a prefix.  Better get used to the
> `real' key bindings.


If cua-mode does not work as expected it is a bug in Emacs.




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

* Re: C-mode blows away may Ctrl-C binding with a prefix -- how to remap prefix?
  2008-04-19  8:23   ` Lennart Borgman (gmail)
@ 2008-04-19 10:36     ` Eli Zaretskii
  2008-04-19 10:57       ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2008-04-19 10:36 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Sat, 19 Apr 2008 10:23:43 +0200
> From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
> 
> David Hansen wrote:
> > On Fri, 18 Apr 2008 11:18:20 -0700 (PDT) lindahlb@hotmail.com wrote:
> > 
> >> I'm currently using Windows-esque key bindings for copy (Ctrl-c), cut
> >> (Ctrl-x) and paste (Ctrl-v). They work fine, except when I open a C/C+
> >> + file. In the major mode, it remaps the (Ctrl-c) key to a keymap
> >> prefix. I want to remap this keymap prefix to another key and return
> >> the (Ctrl-c) mapping to my own copy command. How do I do this?
> >>
> >> I currently have a c-mode customization hook, but couldn't figure out
> >> how to do it there. Here is what I tried:
> >> (define-key c-mode-base-map "\C-c" 'smart-copy)
> > 
> > Pretty all major modes use C-c as a prefix.  Better get used to the
> > `real' key bindings.
> 
> 
> If cua-mode does not work as expected it is a bug in Emacs.

But I don't think the OP uses CUA Mode.  I think he simply rebinds C-c,
C-v, C-x, etc. to the copy/cut/paste functions.




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

* Re: C-mode blows away may Ctrl-C binding with a prefix -- how to remap prefix?
  2008-04-19 10:36     ` Eli Zaretskii
@ 2008-04-19 10:57       ` Lennart Borgman (gmail)
  0 siblings, 0 replies; 7+ messages in thread
From: Lennart Borgman (gmail) @ 2008-04-19 10:57 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

Eli Zaretskii wrote:
>> Date: Sat, 19 Apr 2008 10:23:43 +0200
>> From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
>>
>> David Hansen wrote:
>>> On Fri, 18 Apr 2008 11:18:20 -0700 (PDT) lindahlb@hotmail.com wrote:
>>>
>>>> I'm currently using Windows-esque key bindings for copy (Ctrl-c), cut
>>>> (Ctrl-x) and paste (Ctrl-v). They work fine, except when I open a C/C+
>>>> + file. In the major mode, it remaps the (Ctrl-c) key to a keymap
>>>> prefix. I want to remap this keymap prefix to another key and return
>>>> the (Ctrl-c) mapping to my own copy command. How do I do this?
>>>>
>>>> I currently have a c-mode customization hook, but couldn't figure out
>>>> how to do it there. Here is what I tried:
>>>> (define-key c-mode-base-map "\C-c" 'smart-copy)
>>> Pretty all major modes use C-c as a prefix.  Better get used to the
>>> `real' key bindings.
>>
>> If cua-mode does not work as expected it is a bug in Emacs.
> 
> But I don't think the OP uses CUA Mode.  I think he simply rebinds C-c,
> C-v, C-x, etc. to the copy/cut/paste functions.

Yes, you are probably right. Then the solution might simply be to use 
cua-mode.




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

end of thread, other threads:[~2008-04-19 10:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-18 18:18 C-mode blows away may Ctrl-C binding with a prefix -- how to remap prefix? lindahlb
2008-04-18 21:30 ` lindahlb
2008-04-18 21:37   ` lindahlb
2008-04-19  7:17 ` David Hansen
2008-04-19  8:23   ` Lennart Borgman (gmail)
2008-04-19 10:36     ` Eli Zaretskii
2008-04-19 10:57       ` Lennart Borgman (gmail)

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.