unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#8551: making Emacs remember a key binding to 'other-window
@ 2011-04-25 17:28 Kevin Michael Simonson
  2011-04-25 18:50 ` Drew Adams
  2011-04-25 19:39 ` Stefan Monnier
  0 siblings, 2 replies; 4+ messages in thread
From: Kevin Michael Simonson @ 2011-04-25 17:28 UTC (permalink / raw)
  To: 8551

[-- Attachment #1: Type: text/plain, Size: 755 bytes --]

I am often running Emacs with multiple windows.  In my opinion the "C-x o" key-combination is too cumbersome, and I never use the "open-line" function "C-o" is bound to, so I'm always using "global-set-key" to bind "C-o" to "other-window".  How can I put that key binding in my ".emacs" file so that this key binding is remembered and I don't have to keep executing "global-set-key" manually?

Kevin Simonson


 NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.



[-- Attachment #2: Type: text/html, Size: 2750 bytes --]

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

* bug#8551: making Emacs remember a key binding to 'other-window
  2011-04-25 17:28 bug#8551: making Emacs remember a key binding to 'other-window Kevin Michael Simonson
@ 2011-04-25 18:50 ` Drew Adams
  2011-04-25 19:39 ` Stefan Monnier
  1 sibling, 0 replies; 4+ messages in thread
From: Drew Adams @ 2011-04-25 18:50 UTC (permalink / raw)
  To: 'Kevin Michael Simonson', 8551; +Cc: help-gnu-emacs

> I am often running Emacs with multiple windows.  In my opinion
> the "C-x o" key-combination is too cumbersome, and I never use
> the "open-line" function "C-o" is bound to, so I'm always using
> "global-set-key" to bind "C-o" to "other-window".  How can I put
> that key binding in my ".emacs" file so that this key binding is
> remembered and I don't have to keep executing "global-set-key"
> manually?   Kevin Simonson

A couple of administrative things, FYI:
* The best mailing list for questions like this is
  `help-gnu-emacs@gnu.org' (cc'd).
* Please use plain-text, not HTML formatting, when sending mail
  to either the bug list or the help list.

---

Wrt your question, here's what I would suggest:

In Emacs 22+, where (fboundp 'command-remapping) is non-nil:

 (global-set-key [remap open-line] 'other-window) 

In Emacs before 22 (no command remapping):

 (substitute-key-definition 'open-line 'other-window global-map)






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

* bug#8551: making Emacs remember a key binding to 'other-window
  2011-04-25 17:28 bug#8551: making Emacs remember a key binding to 'other-window Kevin Michael Simonson
  2011-04-25 18:50 ` Drew Adams
@ 2011-04-25 19:39 ` Stefan Monnier
  2011-04-25 23:58   ` Deniz Dogan
  1 sibling, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2011-04-25 19:39 UTC (permalink / raw)
  To: Kevin Michael Simonson; +Cc: 8551-done

> I am often running Emacs with multiple windows.  In my opinion the "C-x o"
> key-combination is too cumbersome, and I never use the "open-line" function
> "C-o" is bound to, so I'm always using "global-set-key" to bind "C-o" to
> "other-window".  How can I put that key binding in my ".emacs" file so that
> this key binding is remembered and I don't have to keep executing
> "global-set-key" manually?

I'd recommend you post such questions to gnu.emacs.help, since it's
neither a bug report, nor a feature request, but just a question.

As for answers, the Emacs manual (reachable via the Help menu, for
example) is a good way to figure it out.  It has a whole section "53.4.6
Rebinding Keys in Your Init File" with examples.

So for your case, you'd do:

   (global-set-key [?\C-o] 'other-window)


-- Stefan





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

* bug#8551: making Emacs remember a key binding to 'other-window
  2011-04-25 19:39 ` Stefan Monnier
@ 2011-04-25 23:58   ` Deniz Dogan
  0 siblings, 0 replies; 4+ messages in thread
From: Deniz Dogan @ 2011-04-25 23:58 UTC (permalink / raw)
  To: 8551, monnier; +Cc: Kevin Michael Simonson, 8551-done

2011/4/25 Stefan Monnier <monnier@iro.umontreal.ca>:
>   (global-set-key [?\C-o] 'other-window)
>

Or:

(global-set-key (kbd "C-o") 'other-window)





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

end of thread, other threads:[~2011-04-25 23:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-25 17:28 bug#8551: making Emacs remember a key binding to 'other-window Kevin Michael Simonson
2011-04-25 18:50 ` Drew Adams
2011-04-25 19:39 ` Stefan Monnier
2011-04-25 23:58   ` Deniz Dogan

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).