all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* copy key binding to another key WITHOUT knowing the function behind it.
@ 2003-12-12  8:38 leo
  2003-12-12 15:24 ` Ian Zimmerman
  2003-12-12 15:28 ` Ian Zimmerman
  0 siblings, 2 replies; 3+ messages in thread
From: leo @ 2003-12-12  8:38 UTC (permalink / raw)


hi there

due to using cua-lite i have key bindings like:

    (lambda (prefix) "Deactivate mark and call `previous-line'
     interactively." (interactive "p") (cua-lite-ensure-mark nil)
     (call-interactively (quote previous-line)) (when t (setq
     this-command (quote previous-line))))

now i want to move this key binding to another key (ctrl-up) without
repeating this long function definition.

is there a way to say "key1's binding should be bound to key2"?

thanks, leo

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

* Re: copy key binding to another key WITHOUT knowing the function behind it.
  2003-12-12  8:38 copy key binding to another key WITHOUT knowing the function behind it leo
@ 2003-12-12 15:24 ` Ian Zimmerman
  2003-12-12 15:28 ` Ian Zimmerman
  1 sibling, 0 replies; 3+ messages in thread
From: Ian Zimmerman @ 2003-12-12 15:24 UTC (permalink / raw)



leo> is there a way to say "key1's binding should be bound to key2"?

Yes: substitute-key-definition

-- 
Nothing can be explained to a stone.
Or to a stoned person, either.

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

* Re: copy key binding to another key WITHOUT knowing the function behind it.
  2003-12-12  8:38 copy key binding to another key WITHOUT knowing the function behind it leo
  2003-12-12 15:24 ` Ian Zimmerman
@ 2003-12-12 15:28 ` Ian Zimmerman
  1 sibling, 0 replies; 3+ messages in thread
From: Ian Zimmerman @ 2003-12-12 15:28 UTC (permalink / raw)



leo> is there a way to say "key1's binding should be bound to key2"?

Please ignore my previous post which doesn't answer your question.

You could do this:

(let ((k my-keymap))
  (define-key k key2 (lookup-key k key1)))

-- 
Nothing can be explained to a stone.
Or to a stoned person, either.

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

end of thread, other threads:[~2003-12-12 15:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-12  8:38 copy key binding to another key WITHOUT knowing the function behind it leo
2003-12-12 15:24 ` Ian Zimmerman
2003-12-12 15:28 ` Ian Zimmerman

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.