0

I've recently run into complications regarding elpy and setting up virtual environments (see other questions) which have brought me back to a more fundamental issue that I must resolve before I continue integrating python functionality into emacs.

Details:

  1. My HOME environment variable is located in c:\users\robby parliament
  2. My root emacs install folder is located in c:\users\robby parliament\documents
  3. The .emacs and .emacs~ files are also located in c:\users\robby parliament
  4. The .emacs.d folder is also located in c:\users\robby parliament and contains the following items:
> - c:\users\robby parliament
> --- .emacs.d
> ----- auto-save-list
> ----- elpa
> ----- elpy
> ----- snippets
> ----- url

Questions:

  1. When I move the .emacs and .emacs~ files into the .emacs.d folder I lose my theme (dracula), why is this so?
  2. In response to the above question I figured I must change the HOME environment variable to `c:\users\robby parliament.emacs.d, so when I do that I get the following warning/error:
Warning (initialization): An error occurred while loading ‘c:/Users/Robby Parliament/.emacs.d/.emacs’:

Symbol's function definition is void: elpy-enable

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace.
  1. Then when I move the .emacs and .emacs~ files into the .emacs.d subfolder within c:\users\robby parliament\.emacs.d the warning is now gone yet the theme is still gone. I've watched LigerLearn's tutorial on setting up emacs and the customization of the file paths several times but I feel like I'm still not understanding a fundamental concept which is bringing me all these warnings and errors. What am I doing wrong?

Also, this is within my .emacs file:


;; Added by Package.el.  This must come before configurations of
;; installed packages.  Don't delete this line.  If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(ansi-color-faces-vector
   [default default default italic underline success warning error])
 '(ansi-color-names-vector
   ["black" "red3" "ForestGreen" "yellow3" "blue" "magenta3" "DeepSkyBlue" "gray50"])
 '(custom-enabled-themes (quote (dracula)))
 '(custom-safe-themes
   (quote
    ("b46ee2c193e350d07529fcd50948ca54ad3b38446dcbd9b28d0378792db5c088" default)))
 '(display-line-numbers t)
 '(package-archives
   (quote
    (("gnu" . "https://elpa.gnu.org/packages/")
     ("melpa" . "http://stable.melpa.org/packages/"))))
 '(package-selected-packages (quote (flymake elpy dracula-theme)))
 '(ring-bell-function (quote ignore))
 '(visible-bell nil))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )
'(setq visible-bell 1)
(elpy-enable)
(define-key yas-minor-mode-map (kbd "C-c k") 'yas-expand)
(define-key global-map (kbd "C-c o") 'iedit-mode)

1 Answer 1

0
  1. When you move .emacs to emacs.d, Emacs just can't find it. It must reside in the HOME directory. You can move it to emacs.d but you have to rename it. You can see the pertinent Emacs manual section "The Emacs Initialization File".

  2. When you change the HOME directory, Emacs can't find the emacs.d directory, which is referenced by the variable user-emacs-directory, with a default value of "~/.emacs.d/".

  3. I don't know. But you should not be doing that anyway.

Why are you moving .emacs into .emacs.d? It doesn't belong there, but in your HOME. When you point HOME to emacs.d, your are messing the setup of your packages.

If you really need to move .emacs into emacs.d you can do so by renaming it to init.el. It is in the manual section "The Emacs Initialization File".

3
  • The only question that stands now is that since i have both a .emacs and .emacs~ file, which one do I rename and which one do I get rid of?
    – katsoop
    Aug 6, 2020 at 19:50
  • @katsoop: The ~ is a backup file that automatically gets created when you save a file in emacs. So you only need the .emacs file. Get rid of the one with the ~. Aug 6, 2020 at 19:55
  • @minibuffer Awesome - now I understand. Got rid of the one with the ~ and changed the name to init.el and moved it to the .emacs.d folder and everything as far as theme and elpy work for the most part. I just have one issue left regarding why the flymake syntax checker isn't working anymore. Should I post another question?
    – katsoop
    Aug 6, 2020 at 19:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.