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

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

HELP: One Bindkey for Two Different Commands


From: Edward
Subject: HELP: One Bindkey for Two Different Commands
Date: Tue, 20 Nov 2007 17:41:43 -0800 (PST)
User-agent: G2/1.0

Why waste two bindkeys on two similar commands when you can simply
write a function to choose the between commands based on context?

Unfortunately,  this very simple idea doesn't seem to work for me.
Here's what I have in my .emacs so far:

(defun ya-ya ()
  (if (cdr (window-list))
      'other-window
    'switch-to-buffer))

(global-set-key "\M-o" (ya-ya))

Any ideas how this might be accomplished?

Edward


reply via email to

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