unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
[parent not found: <mailman.3878.1195637702.18990.help-gnu-emacs@gnu.org>]
* HELP:  One Bindkey for Two Different Commands
@ 2007-11-21  1:41 Edward
  2007-11-21  3:20 ` Drew Adams
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Edward @ 2007-11-21  1:41 UTC (permalink / raw)
  To: help-gnu-emacs


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

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

end of thread, other threads:[~2007-11-30 16:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.3868.1195615322.18990.help-gnu-emacs@gnu.org>
2007-11-21  7:46 ` HELP: One Bindkey for Two Different Commands David Kastrup
2007-11-21  9:33   ` Drew Adams
     [not found] <mailman.3878.1195637702.18990.help-gnu-emacs@gnu.org>
2007-11-21 12:46 ` Edward
2007-11-21 15:57   ` Mathias Dahl
2007-11-21  1:41 Edward
2007-11-21  3:20 ` Drew Adams
2007-11-21 13:03 ` Johan Bockgård
2007-11-30 16:39 ` Stefan Monnier
2007-11-30 16:55   ` Drew Adams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).