0

I was getting an error when I did a (require 'auto-complete) in my init file. A comment suggested I check my load-path or alternatively use the package manager if I didn't want to do that manually. So I put in the package manager call and now get another error. I have also included the whole dotemacs file code. The error is different but still not very helpful. Thanks for any ideas. Maybe I shouldn't have (package-initialize) anymore ?

ERROR WHEN I DO emacs --debug-init temp.R

Debugger entered--Lisp error: (invalid-read-syntax ")")
  eval-buffer(#<buffer  *load*> nil "/home/markleeds/.emacs" nil t)  ; Reading at buffer position 526
  load-with-code-conversion("/home/markleeds/.emacs" "/home/markleeds/.emacs" t t)
  load("~/.emacs" t t)
  #[0 "\205\262

My init file:

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

(package-initialize)

(set-background-color "blue")
(set-foreground-color "white")

(add-hook 'inferior-ess-mode-hook 'my-ess-mode-hook)

(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)

(put 'downcase-region 'disabled nil)

(put 'upcase-region 'disabled nil)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; auto-completion
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(require 'auto-complete')

(require 'auto-complete-config)

(ac-config-default)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ESS set
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(require 'ess-site)

(setq ess-use-auto-complete t)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;open hs-mode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(add-hook 'ess mode-hook 'hs-minor mode)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;smart parens
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(require 'smartparens-config)

(show-smartparens-global-mode t)

(smartparens-global-mode t)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;rainbow mode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(require 'rainbow-mode)

(dolist (hook '(ess-mode-hook inferior-ess-mode-hook))

(add-hook hook 'rainbow-turn-on))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;rainbow-delimiters
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(require 'rainbow-delimiters)

(add-hook 'prog-mode-hook 'rainbow-delimiters-mode)

(add-hook 'ess-mode-hook 'rainbow-delimiters-mode)
10
  • 4
    Welcome to Emacs.SE! You need to tell Emacs about the load path in which to find the libraries you are specifying. If you don't want to do all of this by hand, you might consider using the package manager.
    – Dan
    Commented Oct 18, 2021 at 14:27
  • Thanks Dan. I will check out the links you provided. They're appreciated.
    – mark leeds
    Commented Oct 19, 2021 at 17:50
  • Dan: I edited my question because now I get a different error. I've also included all the code in my dotemacs file. Thanks.
    – mark leeds
    Commented Oct 19, 2021 at 20:25
  • 1
    @NickD: Thanks for the pointers and I will take it to heart. I appreciate you explaining all that. Now I'll go back to my dotemacs file and frustrate myself some more. :). But, if I send another question, it will be a new posting and much shorter. I have been tying to debug errors myself but I'm definitely not used to the error messages. I do understand what you mean by not modifying the question. I just figured since I'm on the same problem, it might be okay but I get that it isn't. Thanks again. Your through explanation and the time that you took to do that is appreciated.
    – mark leeds
    Commented Oct 20, 2021 at 18:32
  • 1
    and thanks for troubleshooting link. If I can become better at troubleshooting myself, that would be wonderful. I'm just currently terrible at it. I can't even get what seems like a pretty basic dotemacs file to run !!!!!
    – mark leeds
    Commented Oct 20, 2021 at 18:33

1 Answer 1

1

If you look at your backtrace:

Debugger entered--Lisp error: (invalid-read-syntax ")")
  eval-buffer(#<buffer  *load*> nil "/home/markleeds/.emacs" nil t)  ; reading at buffer position 526
  load-with-code-conversion("/home/markleeds/.emacs" "/home/markleeds/.emacs" t t)
  load("~/.emacs" t t)
  #[0 "\205\262

You'll notice the comment on the second line ; reading at buffer position 526. This generally indicates that eval-buffer() failed at position 526 in your ~/.emacs. Open your ~/.emacs and jump there with M-x goto-char Return 526 Return. When you do, your cursor will move to (as indicated by the | character):

(require 'auto-complete'|)

You've quoted auto-complete incorrectly. That line should read (notice the single single-quote):

(require 'auto-complete)

Your Answer

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

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