0

There's a huge literature on the topic, but, nevertheless, I cannot get this done. My ultimate goal is to work with fstar on Microsoft Windows.

C-x C-f resolves ~ as C:/Users/myname which is in line with my HOME environment variable in the Environmental variables Windows section.

(expand-file-name user-emacs-directory), as described here yields, C:/Users/myname/.emacs.d/

In C:/Users/myname/.emacs.d/ I have placed .emacs.el and init.el with the suggested script:

(require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t) (package-initialize)

However M-x returns undefined, no matter if I start Emacs with or without the -q flag (see here). My "Messages" buffer is empty".

NoIdeaHowToFixThis
  • 4,484
  • 2
  • 34
  • 69
  • 1
    What do you mean "M returns undefined" ?? – phils Jun 03 '19 at 12:39
  • Emacs loads only *one* init file. You don't need (or want) to have both `.emacs.el` *and* `init.el`. – phils Jun 03 '19 at 12:40
  • I try "M-x" for example and all I see is a "M-x is undefined". Re the `.el`, I tried both alternatives – NoIdeaHowToFixThis Jun 03 '19 at 12:43
  • 1
    It's difficult to believe this would happen (certainly under `emacs -q`), so I wonder if there's confusion over what `M-x` means. Can you describe in detail exactly which keys on your keyboard you are typing? I would expect on Windows that you would hold the left `Alt` key and press `x`. Failing that, does `ESC` then `x` behave differently? – phils Jun 03 '19 at 13:23
  • Well, I type `Alt` and then `x`. In the meanwhile, I tried the very same installation steps on a different machine and everything works. I think I will close this question - it's just too much of a hard work to get this fixed and have no idea how to move forward. – NoIdeaHowToFixThis Jun 03 '19 at 13:31
  • It's certainly a bit bewildering. Hopefully someone else can provide insight into what's going on there. – phils Jun 03 '19 at 13:36
  • It looks like this is solved in the Reddit thread. @NoIdeaHowToFixThis could you post a resolution yourself and then mark it as the answer? –  Jun 30 '19 at 20:29

1 Answers1

2

A couple of things you could try:

  • Check the value of the variable user-init-file (use C-h v). That should tell you if Emacs loads the file you want it to load. If you started Emacs with the -q option, the value of this variable should be nil.
  • The error M-x is undefined can be caused by rebinding the Escape key. (That's because pressing a key while holding down the "Meta" key is equivalent to first pressing Escape and then the key in question.) Is there something in the init file that might cause this to happen?
  • Try starting Emacs with -Q instead of -q. This makes Emacs skip "site-wide" init files. I can't really think of a reason why your system would have any of those, but it might be worth ruling this out.

You could edit your question and include your entire init file (surround it with ``` on a line by itself), so we could have a look.

legoscia
  • 39,593
  • 22
  • 116
  • 167