all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Keybindings for () and kill-region
@ 2007-02-19  4:28 Noah Tye
  2007-02-21  3:29 ` Kevin Rodgers
  2007-02-24 14:36 ` collger
  0 siblings, 2 replies; 3+ messages in thread
From: Noah Tye @ 2007-02-19  4:28 UTC (permalink / raw
  To: help-gnu-emacs

I've rebound C-w to backward-kill-word.  What's a good replacement
binding for kill-region?  (I've tried C-c C-k, but that's used by the
Python major mode.)

Also, I'd like to bind C-J and C-K to '(' and ')'.  Is there a way to
do this?

Thanks in advance.

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

* Re: Keybindings for () and kill-region
  2007-02-19  4:28 Keybindings for () and kill-region Noah Tye
@ 2007-02-21  3:29 ` Kevin Rodgers
  2007-02-24 14:36 ` collger
  1 sibling, 0 replies; 3+ messages in thread
From: Kevin Rodgers @ 2007-02-21  3:29 UTC (permalink / raw
  To: help-gnu-emacs

Noah Tye wrote:
> I've rebound C-w to backward-kill-word.  What's a good replacement
> binding for kill-region?  (I've tried C-c C-k, but that's used by the
> Python major mode.)

So what?  C-w is used by all major modes, via global-map, and you
overwrote that binding.

I have to admit, I don't see how is C-w better than the default binding
(M-DEL), but I don't suppose any C-c LETTER binding (which are reserved
for users) will be to your liking.

Why not bind the key that was originally bound to backward-kill-word
(M-DEL) to kill-region?

> Also, I'd like to bind C-J and C-K to '(' and ')'.  Is there a way to
> do this?

Sure:

(global-set-key "\C-j" "(") ; or [?\C-j] or (kbd "C-j") or ...
(global-set-key "\C-k" ")") ; or [?\C-k] or (kbd "C-k") or ...

-- 
Kevin Rodgers
Denver, Colorado, USA

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

* Re: Keybindings for () and kill-region
  2007-02-19  4:28 Keybindings for () and kill-region Noah Tye
  2007-02-21  3:29 ` Kevin Rodgers
@ 2007-02-24 14:36 ` collger
  1 sibling, 0 replies; 3+ messages in thread
From: collger @ 2007-02-24 14:36 UTC (permalink / raw
  To: help-gnu-emacs

On Feb 19, 12:28 pm, "Noah Tye" <n...@tyes.us> wrote:
> I've rebound C-w to backward-kill-word.  What's a good replacement
> binding for kill-region?  (I've tried C-c C-k, but that's used by the
> Python major mode.)
>
> Also, I'd like to bind C-J and C-K to '(' and ')'.  Is there a way to
> do this?
>
> Thanks in advance.

In fact. You don't need to rebind the key sequence.
Because c-w is a no-op when region selection is not activated.

so.. we can...

(defun backward-delete-word-if-not-in-region ()
  "hooker, backward-kill-word when nothing in selection"
  (interactive)
  (if (equal mark-active nil)
      (backward-kill-word 1)
    (kill-region (point) (mark-marker))))
(global-set-key "\C-w" 'backward-delete-word-if-not-in-region)

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

end of thread, other threads:[~2007-02-24 14:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-19  4:28 Keybindings for () and kill-region Noah Tye
2007-02-21  3:29 ` Kevin Rodgers
2007-02-24 14:36 ` collger

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.