all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* 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
[parent not found: <mailman.3868.1195615322.18990.help-gnu-emacs@gnu.org>]
[parent not found: <mailman.3878.1195637702.18990.help-gnu-emacs@gnu.org>]

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 --
2007-11-21  1:41 HELP: One Bindkey for Two Different Commands 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
     [not found] <mailman.3868.1195615322.18990.help-gnu-emacs@gnu.org>
2007-11-21  7:46 ` 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

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.