unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Alex Wei" <swei@arrayinc.com>
To: "Dieter Wilhelm" <dieter@duenenhof-wilhelm.de>
Cc: help-gnu-emacs@gnu.org
Subject: Re: How to rebind keys "C-j" to join-line -- SOLVED!
Date: Tue, 7 Aug 2007 16:03:17 +0800	[thread overview]
Message-ID: <C13CCCFC941D4D7481AF32A92E908C8F@array8f42e753d> (raw)
In-Reply-To: 87ejigjs46.fsf@debby.local.net


[-- Attachment #1.1: Type: text/plain, Size: 1692 bytes --]

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)
  (local-set-key (kbd "C--") 'kill-whole-line)
  (local-set-key (kbd "C-=") 'copy-whole-line)
  (local-set-key (kbd "C-o") 'open-newline)
  (local-set-key (kbd "C-j") 'join-line)
 )

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

Thanks anyway!

Best Regards

Alex Wei 
Sierra Atlantic
  ----- Original Message ----- 
  From: Dieter Wilhelm 
  To: Alex Wei 
  Cc: help-gnu-emacs@gnu.org 
  Sent: Tuesday, August 07, 2007 5:00 AM
  Subject: Re: How to rebind keys "C-j" to join-line


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

  > Thanks    H. Dieter Wilhelm
  >  
  > I don't need the original C-j keybinding, the "M-^" needs to press 3 keys at

  I see, (I, personally, count M+SHIFT as one key, pressed at the same time ;-)

  > same time, so I want to rebind the C-j to join-line. I am just wondering how to
  > rebind the key or how can I find the hook.
  >  
  > After opening the Emacs, I type  (local-set-key (kbd "C-j") 'join-line)  and
  > then Cx Ce, It works!!

  Have you tried (global-set-key)?  Maybe local-set-key works only in
  the *scratch* buffer at start-up?  Sorry I'm not sure.

  -- 
      Best wishes

      H. Dieter Wilhelm
      Darmstadt, Germany

[-- Attachment #1.2: Type: text/html, Size: 3726 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

  parent reply	other threads:[~2007-08-07  8:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-03  5:18 How to rebind keys "C-j" to join-line Alex Wei
2007-08-04  2:59 ` Dieter Wilhelm
2007-08-06  2:17   ` Alex Wei
2007-08-06 14:37     ` Nikolaj Schumacher
2007-08-07  2:15       ` Alex Wei
2007-08-08  4:46         ` Kevin Rodgers
2007-08-06 21:00     ` Dieter Wilhelm
2007-08-07  2:25       ` Alex Wei
2007-08-07  8:03       ` Alex Wei [this message]
2007-08-07 20:36         ` How to rebind keys "C-j" to join-line -- SOLVED! Dieter Wilhelm
2007-08-08  2:27           ` Alex Wei
     [not found]       ` <mailman.4479.1186473818.32220.help-gnu-emacs@gnu.org>
2007-08-07 11:30         ` Daniel Jensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C13CCCFC941D4D7481AF32A92E908C8F@array8f42e753d \
    --to=swei@arrayinc.com \
    --cc=dieter@duenenhof-wilhelm.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).