emacs 23: struggling to get package.el to work - emacs

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.

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.

Latest ada-mode (5.1.9) does not indent on Emacs for OS X (24.5.1)

I recently upgraded from the ada-mode built-in to Emacs for the updated elpa version (5.1.9) due to issues with compiling from within ada-mode with the earlier version (4.0.0).
In the updated package it is impossible to indent, with TAB performing no operation at all except to move all text on all lines to the leftmost column, regardless of whether it should be indented or not. No other type of indenting (ada-indent-current, ada-indent-region, or ada-indent-newline-indent) work either and neither does automatic indentation via RET.
There is no mention in *Messages* that there is any problem, and the built-in version has no trouble with the indentation.
I'm quite new to Emacs, but I've been trying to solve this problem for a while now with no solution in sight.
My init.el is below in case I've simply done something strange in my noviceness:
(package-initialize)
;; (setq package-enable-at-startup nil)
(require 'package)
(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
("marmalade" . "https://marmalade-repo.org/packages/")
("melpa" . "https://melpa.org/packages/")))
(add-to-list 'load-path "~/.emacs.d/lisp")
(global-linum-mode t) ;; Show line numbers
(autoload 'markdown-mode "markdown-mode" "Major mode for editing Markdown files" t)
(add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
(when (eq system-type 'darwin) ;; mac specific settings
(setq mac-option-modifier 'meta))
(setq exec-path-from-shell-check-startup nil)
(when (memq window-system '(mac ns))
(exec-path-from-shell-initialize))
(ac-config-default)

Emacs24 auto-complete mode does not work

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.

ac-math error in emacs

I installed ac-math plugin as well as auto-complete. I ac-math.el in .emacs.d/plugins/auto-complete
I put this in my .emacs
(add-to-list 'load-path "~/.emacs.d/plugins/auto-complete/.")
(add-to-list 'ac-dictionary-directories "~/.emacs.d/plugins/auto-complete/ac-dict/")
(require 'auto-complete-config)
(ac-config-default)
(require 'ac-math)
(add-to-list 'ac-modes 'latex-mode) ; make auto-complete aware of latex-mode
(defun ac-latex-mode-setup () ; add ac-sources to default ac-sources
(setq ac-sources
(append '(ac-source-math-unicode ac-source-math-latex ac-source-latex-commands)
ac-sources)))
(add-hook 'latex-mode-hook 'ac-latex-mode-setup)
But I get the error "wrong type argument: integrep nil". Any help?
As far as auto-complete-mode is concerned there is a rather out-dated homepage: http://cx4a.org/software/auto-complete/
If you install from there you propably do not have an up to date version like eg the one that can be found on github ( https://github.com/auto-complete/auto-complete ). In that repository the branch for version 1.3 (the one that is available on the homepage) was not updated in the last three years.

Adding Marmalade as Package Source

I'm trying to add Marmalade as a package source, but when I do so I get the error:Symbol's value as variable is void: package-archives. Anyone know how to resolve this? Below is my .emacs file.
;;; This was installed by package-install.el.
;;; This provides support for the package system and
;;; interfacing with ELPA, the package archive.
;;; Move this code earlier if you want to reference
;;; packages in your .emacs.
(when
(load
(expand-file-name "~/.emacs.d/elpa/package.el"))
(package-initialize))
(add-to-list 'load-path (expand-file-name "~/.emacs.d"))
(add-to-list 'load-path "~/.emacs.d/plugins")
(add-to-list 'load-path "~/.emacs.d/plugins/color-theme")
(add-to-list 'load-path "~/.emacs.d/plugins/groovy")
(require 'package)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/"))
(package-initialize)
To install package.el
I ran the following code:
(let ((buffer (url-retrieve-synchronously
"http://tromey.com/elpa/package-install.el")))
(save-excursion
(set-buffer buffer)
(goto-char (point-min))
(re-search-forward "^$" nil 'move)
(eval-region (point) (point-max))
(kill-buffer (current-buffer))))
Use the package.el to be included with emacs24, as the ELPA version doesn't include package-archives and support for multiple repositories.
It is found here (emacs24!): http://bzr.savannah.gnu.org/lh/emacs/trunk/annotate/head:/lisp/emacs-lisp/package.el
Last emacs23 compatible version: http://repo.or.cz/w/emacs.git/blob/ba08b24186711eaeb3748f3d1f23e2c2d9ed0d09:/lisp/emacs-lisp/package.el
Drop it into your loadpath and settle for one type of loading (that is drop the lines after the comment).