M-x not working for 2 days in Emacs - emacs

I do use Emacs for years, and in particular the Cygwin Emacs version (under Windows 10) for months.
Since 2 days, M-x combo key is not working anymore, well ESC x but I don't want to be forced to use Emacs à la Vi ;-)
First, I thought that the keyboard of my laptop could have a trouble, but the same effect is observed with an external keyboard connected by USB.
Second, I though it could be due to some changes I did in my own Emacs init file, or changes inherited from MELPA. To test that, I came back into time with Git, but that wasn't it: problem still observed; to test for MELPA packages, I used a minimal Emacs (emacs -q) and, once again, the problem still persists.
(And ESC x displays that M-x, translated from <escape> x, runs the command
execute-extended-command -- which is expected.)
Finally, what's weird, is that the key x alone is working, and so does C-x. On the other hand, M (meta) is working: M-c, M-w do work like expected.
So, to sum up, only the particular combination M-x is not working, and I really have no idea why.
Any smart test I could do to debug this (on Win 10)?

To sum up the answer in the comments:
If your key combination does not do what you expect - use C-h k to find out if it's a wrong mapping inside emacs, or something is grabbing this combination before emacs has a chance. If C-h k doesn't do anything in response to Alt-X - then you can be certain emacs doesn't see it at all.
If you want to confirm a key combination has been hijacked try to use some other application with it. Alt-X isn't used by regular Windows applications, but if you happen to have anything else that can have customized key bindings then try to map Alt-X to anything inside it. Eclipse, IntelliJ, Visual Studio, gvim. But seeing what happens with C-h k is a sufficient proof.
To find out what is stealing your Alt-X check what was installed or reconfigured lately. Disable startup programs if you can't recall. Additionally, from my experience a couple of nasty offenders: Intel video driver, and Windows language bar. (Not with Alt-X, with other key combinations.) Windows language bar is especially annoying when it steals C-S-) which I use for slurp.
Last thing. If you are running in a VM, your key combination may be stolen at either host or guest level (or both, as I've seen with the language bar.) So you may need to look around in both places.

I encountered the same problem. But I found that the problem was come up with the conflict of hotkey. On my Win10 OS, M-w is conflicted with the Tencent QQ software. So when I closed the QQ or changed the QQ's hotkey, the Emacs worked well.

I don't know why, but the problem is with Growl for windows v2.0.8. Close it and emacs will run normally.
Anyways, any new program setup could create conflicts. Stop all new (since the bug) process and check it.
(I don't want to change the keys configuration)

Related

emacs key commands different in Windows and Linux?

I'm trying to finally bite the bullet and learn emacs. Mainly so that I am comfortable editing files on a server through ssh. So I installed emacs on Windows in order practice. Right away I noticed this difference: when I press ctrl - rightarrow on windows, the cursor jumps to the next work. When I do this in emacs on the server, the cursor moves to the next character only. I believe the latter is the "normal" behaviour (M - rightarrow will jump to the next word in both versions). How can I get my windows emacs to behave exactly like the one on the server? I don't want to learn habits on windows that won't carry over to the server.
You mention server, I assume you are connecting to it over SSH? It is very likely that something over the route steals modifiers off your C-arrow movements.
If this is the case, try to edit your files locally. Here's how: How can I use Emacs tramp to ssh to a remote host and edit a file as another user on an ad-hoc basis?

Emacs indentation screwed up

I recently upgraded to emacs 24.3.1 in order to use a new mode for programming in D. I seem to have introduced some problem with my other modes now (Java, C++ C I'm just using whatever comes with emacs). When I scroll up/down in a buffer, the text displayed is totally messed up. As in lines mixed together, indentation screwy, cursor not modifying where it looks like it is. If I hit ctrl-l the screen refreshes and all is good. I noticed this problem every once in a while with my previous version when editing C .h files. But now it's happening on every single buffer. I can't work with it. Every time I move up/down I have to refresh the screen. I can't find anything similar to my problem with a google search. Might end up being an issue with some incompatible version of a dependency. Here's my system stats.
CentOS release 5.4 (Final)
linux 2.6.18-164.el5
emacs 24.3.1
I don't even know what other libs emacs might depend on. I'll be happy to post versions of anything that might be relevant.
Thanks
Since you say that this happens also with emacs -Q, i.e., without your init file, consider filing a bug report: M-x report-emacs-bug. For that, try to give a short, reprocible recipe, starting with emacs -Q. Emacs Dev will take a look and let you know whether they think there is a bug.
Using report-emacs-bug also automatically gathers info about your Emacs version etc., and includes it with your bug description.

Editing a lisp file in emacs with SBCL

Ok so i am trying to get started with lisp and slime and i am running into some problems. I have correctly installed emacs and slime and SBCL but i run into problems when trying to edit files. I am doing this all on mac osx lion though i dont think that makes a difference. So this maybe stupid but when i first enter the terminal i enter
$ emacs <myfile.lisp>
and then it opens up my file but then slime is not running so i do..
M-x: slime
but when i do that is now gone and all i see is the "REPL" (i think) anyway it just shows me
*
and then i can enter things like
*15
15
but now i can't get back to my file so that i can compile it. Could somone please hlep me through this? Thank you!
Try C-x← and C-x→, that switches the current window's buffer to the previous or next buffer.
For a more interactive approach, split the screen vertically C-x2 (or horizontally C-x3), so you may see your code and try something out on the REPL. You may switch windows with C-xo (remember, O as in Other). You may close a window (not the buffer) with C-x0.
However, you'd better search for an Emacs tutorial, as all of this is very basic. I also recommend you start with a graphical Emacs, such as Emacs for Mac OS X. Some people prefer other versions, which integrate better with Mac OS X but also have lots of different keybindings and come with extra packages. I personally prefer having similar installations and keybindings in whatever OS I'm using.

Emacs (Multi)Term vs Xterm vs Console & TMUX

I'm an Emacs user trying to learn a software tool that is best run from a terminal. The default set-up to get the most out of that tool is to use xterm for interaction and call Vim for editing. One could simply replace Vim with Emacs in this setup, but then one would spend most of the time working outside of Emacs in an Xterm.
I figured out there is (Multi)Term-mode in Emacs, but it is really hard to find out about its pros and cons. So I have the following questions:
[Without X11]: Why or when would anybody use Emacs (Mutli)Term instead of Console & TMUX (or GNU Screen)?
[With X11] How does Emacs (Multi)Term compare to Xterm?
Obviously speed is one criteria for comparison, but I'm sure there are other.
You'd use Emacs term over tmux/screen if you're more familiar with Emacs and already use it for many other things and/or if you spend more time in Emacs than in the terminal.
Emacs's Term is much less sophisticated and much less reliable than xterm. But it works within Emacs so if you live in Emacs, it might be a good option.
Note that you may also prefer to use Emacs's M-x shell functionality, which gives you a command line without giving you an actual terminal emulator. That means that the commands are edited in Emacs before being sent to the underlying command-line program, so all the usual Emacs editing can be used there (and the history manipulation as well as command completion is performed by Emacs as well, which can be great, or can be disappointing (e.g. if the completion needs info which Emacs does not have)).

How to change emacs config in Lisp In A Box

I have been a programmer for a decade now, but I believe this is the first time I've ever asked a question on a forum. I just can't figure this out and can't find the answer already online.
I am trying to turn on CUA mode so that emacs is more bearable for a windows user (normal copy paste functions). I am running Windows 7 and installed emacs through the Lisp In A Box package. I understand that I need to add a line to my .emacs file or init.el file. I'm not sure which, but I can't find either in my Lip In A Box install directory. The emacs package install also did not come with any tutorials or help files, so its really hard to pick this up.
I am stuck, any help is greatly appreciated!
The .emacs can be found by looking at the answers to this similar question.
Regarding documentation and tutorials, it looks like the link you provided for "Lisp in a Box" says:
If you are new to Emacs, it is
recommended that you read the Emacs
Tutorial which you can access from
with Emacs by going to the Help menu,
or by typing Control-h, letting go,
and hitting t. A more extensive manual
is also available from the Help menu,
or on the web at
http://www.gnu.org/software/emacs/manual/.
Which makes it sound like the manual is there, and certainly the tutorial (I made bold the directions to get to the tutorial).
As far as other places to get information, there is a collection of screencasts on the wiki.
Your question doesn't specify whether or not you what to add to your .emacs to activate CUA mode. You can check out the CUA mode documentation on the wiki (which has links to the manual). The minimal installation is just adding this to your .emacs: (cua-mode t).
For GNU/Emacs, you can choose to use any one of the following three file names as the start-up configuration file:
${HOME}/.emacs
${HOME}/.emacs.el
${HOME}/.emacs.d/init.el
It would probably be a good idea to decide on one of the three options and then stick to it - the first one seems to be the most widely used one. In any case, ${HOME} stands for your home directory -- which is likely to be different from the Lisp In A Box install directory!
Coming from a Unix tradition, Emacs understands ~ (tilde) as an abbreviation for your home directory, so you can visit the .emacs file by typing:
C-x C-f ~/.emacs [ENTER]
(Note that the capital C is Emacs standard notation for a combination of the CTRL key and a second key, i.e. here you press CTRL-x CTRL-f which stands for "find-file" and will then ask you for a file name in the bottom part of the Frame (aka mini-buffer).)
If these are your first customizations, you will just see an empty buffer. Enter
;; start CUA mode every time Emacs starts
(cua-mode t)
and save the buffer with C-x C-s.
Next time you start Emacs, CUA mode should be turned on automatically.
What the others have told you is true: Simply adding (cua-mode t) to your dotfile would be sufficient. HOWEVER: Lisp in a box' Emacs doesn't load this file by default.
Therefore, be sure to edit the shortcut so that it does load the dotfile. This is important, because otherwise you would get weird behavior, where you would add the correct line to the dotfile, start emacs, and then not get cua mode. That would suck.
The reason it does this is to ensure that it starts a vanilla emacs everytime, instead of finding, say C:/_emacs and loading that instead, giving you another user's customizations and confusing you.
The flag for not loading an init file is -q or --no-init-file. Also make sure that --no-site-file is not there.
(I realize that this is an old post, but I found this while looking for something related, and I don't want people walking away frustrated over something that doesn't work.)