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

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

Re: Remap DEL and Shift-Up to kill to end of line


From: Kevin Rodgers
Subject: Re: Remap DEL and Shift-Up to kill to end of line
Date: Wed, 30 Apr 2008 00:05:45 -0600
User-agent: Thunderbird 2.0.0.12 (Macintosh/20080213)

plus852@gmail.com wrote:
But (global-set-key (kbd "<delete>") 'kill-line) still doesn't work -
all I get is a forward character delete (I'm running Emacs 22.1 on Mac
OS X)

Hmmm, works for me: GNU Emacs 22.2.1 (i386-apple-darwin8.11.1, Carbon Version 1.6.0)

Also, how would I bind Shift-Up Shift-Up to kill-paragraph (and Del-
Del if I can get Del working)? (global-set-key (kbd "<S-up><S-up>")
'kill-paragraph) doesn't do the job.

That will be tricky: binding <foo><bar> to a command implies that <foo>
is a prefix key i.e. bound to a keymap (see "prefix key" and "prefix
keymap" in the Emacs and Emacs Lisp manuals).

But you want <foo> bound to a command `bar' and <foo><foo> bound to a
different command `baz'.  I think the way around that is to bind <foo>
to a new custom command that checks whether the last command was `bar'
invoked by <foo>: if so, undo its changes and run `baz'.

--
Kevin Rodgers
Denver, Colorado, USA





reply via email to

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