all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "collger" <collger@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Keybindings for () and kill-region
Date: 24 Feb 2007 06:36:39 -0800	[thread overview]
Message-ID: <1172327799.831257.170920@k78g2000cwa.googlegroups.com> (raw)
In-Reply-To: <1171859288.645586.231760@v45g2000cwv.googlegroups.com>

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)

      parent reply	other threads:[~2007-02-24 14:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

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

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

  git send-email \
    --in-reply-to=1172327799.831257.170920@k78g2000cwa.googlegroups.com \
    --to=collger@gmail.com \
    --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.
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.