windows key in emacs in -nw mode - emacs

I add the following line to my ~/.emacs
(global-set-key (kbd "") 'other-window)
It works on emacs GUI mode. But if I open emacs in terminal (Ubuntu 10.04) with the option
-nw, then Win + Right just give right. I tried many key
combinations with the windows key, it seems that windows key doesn't function in the
terminal. I guess that the default terminal in Ubuntu doesn't recognize teh Win
key at all. If I want to use Win key in the terminal, I have modify the source
code of termianl. Is this right?

The win key under ubuntu becomes the modifier Super, I don't think that the terminal recognizes this as a key modifier. You could switch the windows key to something else or just use ctrl or meta keys.

Related

How do I exit Emacs from the terminal?

I just installed Emacs 26.3 on Ubuntu 20.04. I opened a buffer in the terminal, and I cannot close it. C-x C-c does nothing. f10 to activate the menu does not activate the menu.
I'm using a .emacs file that maps cut/copy/paste commands to the normal C-x/C-c/C-v. I don't think that this can affect the issue, however, because I have the exact same setup (including the same .emacs file) on by Emacs 24.5/Ubuntu 16.04 laptop, and it has no problem exiting with C-x C-c. Also, I had the exact same problem before I installed the .emacs file on the new system.
How do I kill Emacs?
This question exists, but it has no useful answers.
ESC x save-buffers-kill-terminal
OFC binding C-x will affect C-x C-c. You don't need to know anything about Emacs to realize the problem. Just think twice.

Make cmd the meta key in emacs running in iTerm

I run Mac OSX 10.9 (Mavricks) and use EmacsMac installed via macports package emacs-app-mac (emacs version 24.3.1). The GUI uses cmd as the meta key, which is what I want. But I also run the same binary (emacs points to Emacs -nw) in my iTerm2 terminal (Build 1.0.0.20131116), where meta-key is alt instead of cmd.
In iTerm preferences i've tried the different settings for "left option key acts as ..." but no joy there. Is there a way I can get emacs in iTerm to recognise cmd as my meta key?
Preferences -> Profiles -> Keys has what you want.
Mine is set to +Esc. I know, meta looks like what you want but it is not it.

Emacs and chord translation

I'm having some issues with emacs, in particular when using SLIME. It's not reading the slime-eval-defun command (bound to C-M-x) but will read C-M-S-x... same issue with the indent function C-X-q, I have to add a shift to make it work.
When looking into the key bindings I get this
C-M-x (translated from C-M-S-x) runs the command slime-eval-defun,
which is an interactive Lisp function in `slime.el'.
So it picks up C-M-S-x and assumes that I want C-M-x, which is true, but I'm not getting why it's not picking up C-M-x in the first place!
I'm running emacs on Arch as a guest OS, host OS is OS X.
So I found out that the KDE default shortcut for activating clipboard actions is C-M-x. I removed that and the SLIME shortcut works now.

In emacs, query-replace-regexp keyboard shortcut doesn't work in the terminal (e.g., emacs -nw)

Is it expected that C-M-% and ESC C-% do not run the command query-replace-regexp when running emacs in a terminal window (for example, emacs -nw)?
According to describe-function the binding exists, but emacs runs query-replace instead (which has the binding M-%). This has happened on several machines I've tried it on, and does not happen when I run emacs in a window.
The problem is that C-% simply can't be typed in a terminal. The only control sequences available are those that corresponds to ascii-code 0-31, mainly C-letter.
I have created a new shortcut in my .emacs file.
(global-set-key "\M-q" 'query-replace-regexp)
Control-Alt-Shift-% all together works on Windows and Fedora Linux. Does your keyboard have all those keys?

How do I get to the menu in Emacs in console mode?

If you launch Emacs using the -nw flag to force a console session (rather than an X session if you have X windows running), how do you get to the menu?
There are some items held in the menus that are infrequently-enough used on my part that I don't recall the escape or control sequence to do them.
M-x menu-bar-open, which is usually bound to F10. This works with and without menu-bar-mode (which just shows the names of the menus at the top of the screen).
On my computer (with openSUSE), it is not F10 but M-` which allows to access menu items. More information is available here:
http://linux.about.com/od/emacs_doc/a/emacsdoc317.htm
The F10 key will access the menus for me in both Windows versions and a console version in Red Hat Linux (RHEL) 4.
F10 is inaccessible for ssh to a remote host over a Mac terminal.
How to get to the menu:
C-h b to get all the key bindings.
Use C-s to incrementally search on "menu" in the key
bindings help. Hit C-s to find next and next occurrences.
See the ESC `?
Type ESC ` on the Mac and it will work.
La Carte (library lacarte.el) --------
It lets you execute menu commands from the keyboard, using completion:
ESC M-x
Menu command:
Menu command: t [TAB]
Menu command: Tools >
Menu command: Tools > Compa [TAB]
Menu command: Tools > Compare (Ediff) > Two F [TAB]
Menu command: Tools > Compare (Ediff) > Two Files... [RET]
For my Emacs and Mac setup, I found that Command + Fn + F10 creates a buffer showing Emacs menu-content selectable by a further keystroke.
M-x menu-bar-mode