Emacs24 auto-complete mode does not work - emacs

I have Emacs24, i want to use some modes like auto-complete.
Here is the thing, I installed 'linum' before and it's just working very well but others not working.
My .emacs file
(add-to-list 'load-path "/root/.scripts")
(require 'linum)
(global-linum-mode 1)
(require 'package)
(add-to-list 'package-archives '("melppa" . "http://melpa.milkbox.net/packages/"))
(package-initalize)
(add-to-list 'load-path "~/.emacs.d/")
(require 'auto-complete)
(require 'auto-complete-config)
(ac-config-default)
(require 'yasnippet)
auto-complete and yasnippet just doesn't working , i tried command 'auto-complete-mode' but its still same.
Any ideas ?
EDIT : I installed it from source not from ELPA and it worked.

I had a similar issue when I upgraded to Emacs 24. Have you tried running M-x auto-complete? When I did, I got an error message like the following:
gv-get: (popup-cursor ac-menu) is not a valid place expression
It turned out this was an already reported bug that can be fixed by recompiling your byte-code:
https://github.com/auto-complete/auto-complete/issues/222
https://github.com/auto-complete/auto-complete/issues/118
This solution worked for me:
$ find ~/.emacs.d/elpa -name '*.elc' | xargs rm
(to remove all compiled elisp in your elpa subdirectories)
... then, in an elisp interaction buffer, like scratch eval:
(byte-recompile-directory (expand-file-name "~/.emacs.d/elpa") 0)
... then re-start emacs.

Related

How to install Proof General for Emacs on Mac?

I am new to Emacs and perhaps that is the problem but I was following the instructions here:
https://github.com/ProofGeneral/PG
in particular after I added the given lines to my .emacs file, I did (M is the alt/option key):
M-x package-refresh-contents RET
but I got the error message:
[no match]
what is going wrong?
maybe this what I am doing wrong, what does:
M-x package-refresh-contents RET followed by M-x package-install RET proof-general RET
mean?
This is what works for me (TM):
(require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(package-initialize)
;; Bootstrap use-package
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(use-package proof-general
:no-require t
:ensure t)
The line will work if you have melpa as your package source. See the answer of ejgallego:
(require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(package-initialize)
If you add these lines to your .emacs - file and then
M-x package-refresh-contents (followed by return)
M-x package-install (followed by return and then `proof-general`)
then it will work without explicitly adding the package in your .emacs-file.

emacs 23: struggling to get package.el to work

Following the instructions here, I have not had any success. I put package.el inside my ~/.emacs.d/ folder.
Inside .emacs I put:
(add-hook 'after-init-hook (lambda ()
(load "~/.emacs.d/my-init.el")))
And myinit.el:
(when
(load
(expand-file-name "~/.emacs.d/package.el")))
(require 'package)
;; Any add to list for package-archives (to add marmalade or melpa) goes here, e.g.:
(add-to-list 'package-archives
'("marmalade" .
"https://marmalade-repo.org/packages/"))
(add-to-list 'package-archives
'("MELPA" .
"http://melpa.milkbox.net/packages/"))
(package-initialize)
I'm not getting any errors when I start emacs. But when I do M-x package-install [RET] afternoon-theme, for example, I get a message saying no packages found.

Running racket with emacs?

I installed Geiser from source and following this SO answer set the path to drracket.
Here is my part of my .emacs file. I'm on a GNU/linux distribution.
;;;;;;;;;;;;;;;;
;Geiser
;downloaded geiser from git rep and make install
;;;;;;;;;;;;;;
(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/")
(require 'geiser-install)
(setq geiser-racket-binary "/usr/racket/bin/drracket")
In emacs when I M-x run-racket on emacs I get the following error:
drracket: unknown switch: -i
Do you have any solution?
Of course the solution was to use
(setq geiser-racket-binary "/usr/racket/bin/racket")
instead of :
(setq geiser-racket-binary "/usr/racket/bin/drracket")

Installing YASnippet

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

emacsclient not evaluating color-theme?

When I boot I launch emacs --daemon
and it evaluates my .emacs with one exception:
(add-to-list 'load-path "~/.elisp/zenburn-emacs") ;fix loading issue
(require 'zenburn)
;;; color theme - zenburn?
(add-to-list 'load-path "~/.elisp/color-theme")
(require 'color-theme)
(eval-after-load "color-theme"
'(progn
(color-theme-initialize)))
I know that the load-path stuff works because M-x zenburn loads the color scheme just fine once I launch emacsclient with emacsclient -nw.
Does anybody know what is up with (eval-after-load [snip - see above])?
Is this a bug?
System Info:
GNU Emacs 23.2.1
Installed in debian sid on2.6.32-5-amd64 Version: 23.2+1-7
Filename: pool/main/e/emacs23/emacs23_23.2+1-7_amd64.deb
And a tip from the current maintainer of Zenburn for Emacs(yours truly):
(add-to-list 'load-path "~/.elisp/color-theme")
(add-to-list 'load-path "~/.elisp/zenburn-emacs")
(require 'zenburn)
(zenburn)
You don't need to require color-theme since zenburn requires it internally. You do need, however, to call the zenburn function after you've required zenburn.
You're actually invoking the (zenburn) function when you type M-x zenburn and this is why the theme is getting applied just then instead of on startup.
You don't really say what isn't working?
(require 'zenburn) isn't enough to start the theme.
You need to call (color-theme-zenburn) as well (or its alias (zenburn), as you are doing interactively).
FWIW, here's how I load zenburn in my .emacs:
(require 'zenburn)
(zenburn)
Loads fine via emacsclient.
This is too long for a comment:
I have in my .emacs file the following line:
(setq default-frame-alist '((font . "Inconsolata-20") (tool-bar-lines . 0) (menu-bar-lines . 0)))
If I put for example
(color-theme-taylor)
after this line it works, if I put it before this line, it doesn't.
I.e.
(require 'color-theme)
(color-theme-initialize)
(setq default-frame-alist '((font . "Inconsolata-20") (tool-bar-lines . 0) (menu-bar-lines . 0)))
(color-theme-taylor)
works... perhaps your problem may have a similar cause...
Something like (progn (require 'color-theme) (color-theme-initialize)) should work. To see (eval-after-load "color-theme" '(progn (color-theme-initialize))) does what it should do, check if color-theme-initialize is appended to after-load-alist (describe-variable C-h v). If not, it could be a bug.