-2

this is easily the most frustrating program ive ever used. ive installed it 4x, ive created a .emacs RET a .emacs.d a .emacs.d/init.el a .init.el etc. none of them work, the directories are write protected and i cant save them etc. the list goes on.

so basically i have no idea how to get a VERY VERY simple .emacs init file to work with rails. and it has turned into a 8+ hour mess that has resulted in a ton of worthless files. any idea what the issue is? ive toggled read mode etc. ive ran under sudo. seems like a fairly simple task so am not sure what magic thing im missing. any ideas?

ive checked both the usr bin directory and created there. ive also created in the lisp directory within the app directory itself. the best ive gotten was the buffer to preload, but of course without actually evaluating the buffer like it should.

thanks for help, would be great to have a useful program to code with vs argue with emacs lisp for 300 hours

edit: yes my mx customize works and loads fine. yet i cant find that file and all that seems to work is that it can preload a change in theme, which isnt very useful. Ive read the walk through and can locate my home path etc., but none of it works. Vim/sublime each took maybe 5 min to configure to rails

  • First thing first. Did you download the latest nightly build from http://emacsformacosx.com/builds -- i.e., http://emacsformacosx.com/builds -- i.e., Emacs-2014-07-25_01-40-00-117570-universal.dmg ? Or, did you at least try an older public release from March 11, 2013 -- http://emacsformacosx.com/ ? If not, back up your configurations and remove the existing installations and try the latest nightly build from yesterday! Then report back. After you get things working with the July 25, 2014 nightly build from emacsformacosx , then you can play around with other builds. – lawlist Jul 26 '14 at 21:51
  • 1
    After you have backed up your existing configurations and programs, go ahead and remove the folder `.emacs.d` (and everything inside it) before running the new installation from emacsformacosx Do keep in mind that OSX comes with an older Emacs installation in `/usr/bin`, so if you are calling Emacs or emacsclient from the command line, that will cause problems for you if you expect the newer installation. – lawlist Jul 26 '14 at 21:57
  • 2
    I don't think pointing newcomers at *nightly builds* is sensible. 24.3 is the latest stable release, and that's what they should be using. (They can, of course, get stable releases from the same site.) – phils Jul 26 '14 at 23:04
  • You should also check `M-x emacs-version RET` after starting Emacs to confirm the version. If you've installed 24.3 but that command gives you a completely different result, then you're not actually running the version you thought you were running. I know there are other answers on S.O. about multiple versions of Emacs on OSX causing confusion, so you might want to look them up. – phils Jul 26 '14 at 23:32
  • @phils -- There have been lots of OSX specific bug fixes for Emacs since the last stable release, so that was the rationale behind the nightly build suggestion. Plus, I've been using Emacs Trunk for OSX (building regularly) for the past year and have been very happy with it. – lawlist Jul 26 '14 at 23:47

2 Answers2

1

When you start emacs, check what the abbreviated-home-dir variable is set to.

meta-x apropos home-dir

That's the directory where emacs thinks you should put your .emacs file and any associated scripts.

This should normally be the same as your HOME environment variable, unless your setup is running some kind of script to override it.

  • 1
    `C-h v user-init-file` (the exact path to the init file), and `C-h v user-emacs-directory` (the `.emacs.d` directory) are more readable than that. – phils Jul 26 '14 at 23:09
  • Thanks, should I change the answer to recommend that instead? – Jeff-Inventor ChromeOS Jul 26 '14 at 23:14
  • Up to you. I ended up writing an answer myself with the same information. I'm up-voting your answer because I'd never noticed the `directory-abbrev-alist` feature before, and I have a use for it :) so you might want to retain the mention of `abbreviated-home-dir` even if you do edit things. – phils Jul 26 '14 at 23:39
  • hey so i found user-emacs-directory is a variable defined in `subr.el'. Its value is "~/.emacs.d/" this area is what is giving me issues. even if i open it in emacs the files inside i can't edit them even if i create a new init file or use one on there – user3525571 Jul 27 '14 at 03:50
  • also for some reason the apropos home dir command did not work. however i was able to find the init file, thank you – user3525571 Jul 27 '14 at 04:01
  • Oh - you are running in sudo... that's definitely the source of the permissions problems. You should exit emacs, rm ~/.emacs.d/ and restart emacs without using sudo. – Jeff-Inventor ChromeOS Jul 27 '14 at 07:58
  • Interesting problem created by using `sudo`. – Brady Trainor Jul 28 '14 at 04:22
1

Reading https://stackoverflow.com/a/10545955/324105 should be useful.

I would suggest that you remove all of your attempts at configuration (if they're wrong, or they have bad file permissions, they'll just cause more confusion), then run Emacs, and use M-: (find-file user-init-file) RET to open your init file.

Typing M-: should give you an Eval: prompt to enter that code at. You can use M-x eval-expression RET instead if necessary.

Edit the file and save it, and of course take note of where it is.

You can check the location with C-hv user-init-file RET

Emacs will create the .emacs.d directory as required, and you can similarly check that location with C-hv user-emacs-directory RET, or eval (find-file user-emacs-directory) to open it in Emacs.

Please note that you shouldn't be using sudo for any of this; that will just lead to incorrect permissions. All of your Emacs configuration should be owned by your regular user. Again, I suggest deleting the files and directories you've created thus far to ensure that you won't have problems with permissions.

Community
  • 1
  • 1
phils
  • 71,335
  • 11
  • 153
  • 198
  • THANK YOU. such a good answer lol. I read all the init file helps and none of them said the eval style that helped a lot. thank you! – user3525571 Jul 27 '14 at 04:00