I am using GNU Emacs 24.4.1 (x86_64-apple-darwin14.0.0)
I installed auto-complete from Melpa, and have the following line in init.el:
(global-auto-complete-mode 1)
When I open up emacs, it fires up an warning:
Warning (initialization): An error occurred while loading `/Users/lita/.emacs.d/init.elc':
Symbol's function definition is void: global-auto-complete-mode
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.
And the auto-complete-mode wasn't start. After I changed the line in init.el into:
(eval-after-load 'auto-complete (global-auto-complete-mode 1))
It still came up with the same warning. But if I `eval-buffer, it turns on the auto-complete.
What's the problem with that??
In your init file, you should call (package-initialize) before referring to packages.
In addition, you have a typo in your eval-after-load statement. You need to quote the form, otherwise it's evaluated immediately, which is the reason why you get the warning. In other words:
(eval-after-load 'auto-complete '(global-auto-complete-mode 1))
Alternatively, you can use the new macro with-eval-after-load.
Related
I decided to give emacs another try, but configuring it can be quite a pain. I wanted something to simple auto complete html tags and php functions, then I find the auto-complete mode.
I installed it through the packages interface in emacs through elpa. I followed the instructions(http://cx4a.org/software/auto-complete/manual.html) for installing the dictionaries, editing the .emacs file with:
(add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
(require 'auto-complete-config)
(ac-config-default)
but when I start emacs I have the following error:
Warning (initialization): An error occurred while loading `/home/dev/.emacs':
Symbol's value as variable is void: ac-dictionary-directories
Starting emacs with the debug options I have the following:
Loading 00debian-vars...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
Error while loading 50dictionaries-common: Symbol's value as variable is void: debian-aspell-only-dictionary-alist
Entering debugger...
find-library-name: Can't find library /usr/share/emacs/24E.3/lisp/subr.el
I tried many things already but to no avail. I checked the value of the 'load-path' variable and the dict folder is in it. What else should I try?
Emacs does not recognize 'ac-dictionary-directories. You should put this line after (require 'auto-complete-config)
I an new to emacs...so i was trying to install ya-snippets
for this first i downloaded the ya-snippet tar file and then uzipped it and then kept it .emacs.d/packages/
and then added the following code to my .emacs file
;; yasnippet
(add-to-list 'load-path
"~/.emacs.d/packages/yasnippet")
(require 'yasnippet)
(yas-global-mode 1)
but my obtaining the following error ...
Warning (initialization): An error occurred while loading `/home/nitesh/.emacs':
Symbol's function definition is void: yas-global-mode
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.
please tell me the error and as i am new to emacs and please tell what each line is doing my .emacs file written to configure yasnippet ?
and please tell me what to add to .emacs file for ya -snippet to use all c/c++ snippets that comes default with it?
Step One: Place the following two lines near the top of your .emacs file and restart Emacs:
(require 'package)
(package-initialize)
Step Two: M-x list-packages
Step Three: Select Yasnippet with the left mouse click and then click Install, and click Yes.
Step Four: Open up your .emacs file and place this underneath package-initialize
(require 'yasnippet)
(yas-global-mode 1)
Step Five: Restart Emacs and have fun coding. The mode-line will display yas when that minor mode is active.
I have installed YASnippet and configured it with this:
(add-to-list 'load-path "~/.emacs.d/plugins/yasnippet-0.6.1c")
(require 'yasnippet) ;; not yasnippet-bundle
(yas--initialize)
(yas/load-directory "~/.emacs.d/packages/yasnippet-0.6.1c/snippets")
However, when I launch Emacs it gives me an error:
Warning (initialization): An error occurred while loading `/home/alexander/.emacs':
Symbol's function definition is void: yas--initialize
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.
(add-to-list 'load-path "~/.emacs.d/plugins/yasnippet-0.6.1c")
(require 'yasnippet) ;; not yasnippet-bundle
(yas--initialize)
(yas/load-directory "~/.emacs.d/packages/yasnippet-0.6.1c/snippets")
What am I doing wrong? I have tried to find the answer but with no success. (I have also tried with another version of yasnippet yasnippet-0.6.1b but it was the same.)
Just at a glance, that
(yas--initialise)
should be
(yas/initialize)
I'm running 0.6.1 and there's no such function as yas--initialize in the package.
My init code looks like
(require 'yasnippet)
(yas/initialize)
(yas/load-directory
(dot-emacs "elpa/yasnippet-0.6.1/snippets"))
I think you just got some garbled init code somewhere.
EDIT
I should have omitted the load-directory call in my sample since it's beside the point. But for what it's worth, dot-emacs is just a config-agnostic function I use to reference files relative to my init:
(defun dot-emacs (relative-path)
"Return the full path of a file in the user's emacs directory."
(expand-file-name (concat user-emacs-directory relative-path)))
FYI in case you ever upgrade: the information you got is correct for version 0.8, but for 0.7 and below yas/initialize is correct.
See this commit
This question already has an answer here:
Emacs: Symbol's value as variable is void
(1 answer)
Closed 5 years ago.
I'm trying to install the emacs latex auto-complete package (http://code.google.com/p/ac-math/). I put ac-math.el into my ~/elisp load-path directory then put the following into my .emacs file:
;; Adds elisp to load-path
(add-to-list 'load-path "~/elisp")
;; Loads latex auto-complete
(require 'ac-math)
(add-to-list 'ac-modes 'latex-mode)
(defun ac-latex-mode-setup ()
(setq ac-sources
(append '(ac-source-math-latex ac-source-latex-commands ac-source-math-unicode)
ac-sources))
)
(add-hook 'LaTeX-mode-hook 'ac-latex-mode-setup)
But when I load emacs I get this error:
Warning (initialization): An error occurred while loading
`/home/eddy/.emacs':
Symbol's value as variable is void: ac-modes
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.
Thanks in advance
Add (require 'auto-complete) at the top. Or, better yet, convince the ac-math package maintainer to add it there.
I had to install the auto-complete package first. I had mixed up the math auto-complete package with the actual auto-complete package.
So first you go here to install the auto-complete package: http://cx4a.org/software/auto-complete/
Then you go here for the math auto-complete add-on: http://code.google.com/p/ac-math/
The problem was that I was trying to install the math add-on without first installing the auto-complete package
I am using GNU emacs 23.1.1 on Fedora 12
I have this in my .emacs file
(require 'color-theme)
(color-theme-initialize)
(color-theme-Classic))
And I get the following error:
Symbol's function definition is void: color-theme-Classic
I have all the libraries in my /usr/share/emacs/site-lisp directory
color-theme.el
color-theme-example.el
color-theme-library.el
themes/
Many thanks for any suggestions,
Maybe Classic should be classic?