help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to rebind keys "C-j" to join-line -- SOLVED!


From: Dieter Wilhelm
Subject: Re: How to rebind keys "C-j" to join-line -- SOLVED!
Date: Tue, 07 Aug 2007 22:36:11 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

"Alex Wei" <swei@arrayinc.com> writes:

> Hi all
>  
> I've figured out how to secure binding my keys :D , I found two hooks that 
> will
> guarantee my key-bindings will not be overrided.
>  
> (defun my-key-binding ()
>   "Customize my key bindings after Emacs startup."
>   (interactive)
>   ;; Key
> bindings                                                               
>   (local-set-key (kbd "<RET>") 'newline-and-indent)
>   (local-set-key (kbd "C-.") 'set-mark-command)

Why not the standard binding (C-SPC)?

>   (local-set-key (kbd "C--") 'kill-whole-line)

the same here C-S-backspace? (OK, I answer it myself: One needs three
keys.)  But you are restricting yourself to M-- and C-u- for negative
prefix arguments.

>   (local-set-key (kbd "C-=") 'copy-whole-line)

Yes, this is a function I'm also missing badly in Emacs.

>   (local-set-key (kbd "C-o") 'open-newline)

What is open-newline, something like C-e RET?

>   (local-set-key (kbd "C-j") 'join-line)

As I said M-^ is not so bad either ;-)

> (add-hook 'emacs-startup-hook 'my-key-binding)
> (add-hook 'change-major-mode-hook 'my-key-binding)

Sorry I do not know these hooks, but wouldn't for example:

(global-set-key "\C-o" 'open-newline)

in your .emacs have the same effect without adding hooks?

> Thanks anyway!

You are very welcome.

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany




reply via email to

[Prev in Thread] Current Thread [Next in Thread]