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)
NickD
  • 27,023
  • 3
  • 23
  • 42
  • 4
    Welcome to Emacs.SE! You need to tell Emacs about the [load path](https://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Libraries.html) 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](https://www.emacswiki.org/emacs/InstallingPackages). – Dan Oct 18 '21 at 14:27
  • Thanks Dan. I will check out the links you provided. They're appreciated. – mark leeds Oct 19 '21 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 Oct 19 '21 at 20:25
  • I edited your question substantially but only because you are a new user: as a rule, you should *never* change your question - ask a different question instead. That applies with double force when the question has an answer: it is not nice at all to have somebody spend time on an answer and then you pull the rug from under them by changing the question. At least, there was no answer here, but you should heed the rule. Second, before you add a large amount of code to your question, you should make a conscious effort to limit it to the minimum possible: nobody wants to read three pages of ... – NickD Oct 20 '21 at 02:48
  • ... code in order to find an error somewhere. You should do what's necessary to localize the problem as much as possible (in the process you might be able to find the problem yourself and not have to ask a question at all). For some useful techniques, see [How do I troubleshoot Emacs problems](https://emacs.stackexchange.com/questions/28429/how-do-i-troubleshoot-emacs-problems). In this case, all you have to do is read the error message carefully: it says the error was encountered at buffer position 526.... – NickD Oct 20 '21 at 03:07
  • ... If you go to that position in the buffer (e.g. by putting the cursor at the top of the buffer and then saying `(C-u 525 C-f` i.e. move forward one character 525 times), you'll see that your cursor falls on the closing paren of `(require 'auto-complete')` and if you stare at that a bit you'll see that the problem is that single quote before the closing paren: emacs told you *exactly* where to look. Hope this helps and that you take the lessons to heart. Welcome to Emacs SE! – NickD Oct 20 '21 at 03:13
  • I should clarify: when I say you should *never* change your question, I do not mean that you should not e.g. add clarifying information: you should definitely do that. What I mean is that you should not ask a *different* question by changing your question: do not ask how to say "Good morning" in French and then change it to ask how to say "Good morning" in German - that's a different question and you should ask it separately. In this case, you asked a question about an error you got and then you changed tthe question to ask about a *different* error. That should be a *different* question. – NickD Oct 20 '21 at 03:20
  • 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 Oct 20 '21 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 Oct 20 '21 at 18:33
  • Welcome to the club! We've all been there :-) – NickD Oct 21 '21 at 02:17

1 Answers1

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)
nega
  • 3,091
  • 15
  • 21