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


From: Daniel Jensen
Subject: Re: How to rebind keys "C-j" to join-line
Date: Fri, 03 Aug 2007 13:57:49 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (gnu/linux)

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

> I add the following lines into my .emacs file, but it dosen't work, How can I
> rebind the key "C-j" to join-line ?
>  
> (global-set-key (kbd "C-j") 'join-line)

There's nothing wrong with this line. Why doesn't it work for you? It
binds a key in the global map. Did you expect a different result?

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

You can delete this line. It's fine in a hook function, not stand-alone
like this. To bind the key for a specific mode, use something like this:

(add-hook 'foo-mode-hook
          (lambda ()
            (local-set-key (kbd "C-j") 'join-line)))


reply via email to

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