Adding Marmalade as Package Source - emacs

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).

Related

can't install doom-modeline package on emacs

I'm new at emacs.
I'm trying to install doom-modeline using this command
M-x package-install RET doom-modeline RET
but it seems to not be in the package list
My init.el looks like this:
(require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives
'(("melpa" ."https://melpa.org/packages/")
("elpa" . "https://elpa.gnu.org/packages/")
("org" . "https://orgmode.org/elpa/")))
(unless package--initialized
(package-initialize))
(unless package-archive-contents
(package-refresh-contents))
;; Initialize use-package on non-Linux platforms
(unless (package-installed-p 'use-package)
(package-install 'use-package))
(require 'use-package)
(setq use-package-always-ensure t)
;; Setup use-package
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(eval-when-compile
(require 'use-package))
(setq use-package-always-ensure t)
What can I do?
I suspect you just need to do this:
M-x package-refresh-contents RET
And then try installing it again.
Failing that, check that you don't already have it installed, as package-install doesn't offer to install the things you already have.

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)

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.

error: package.el not yet initialized

I'm in the middle of organising my .emacs file to better keep track of all the things I'm adding to it.
In doing so I've run into the error described in the title, and I'm not sure exactly why
Here's my .emacs file: (the load of comments are for my own reference)
;;;; Emacs config file
;; convenience function for loading multiple libs in a single call
(defun load-libs (&rest libs)
(dolist (lib libs)
(load-library lib)))
;; path to custom libraries as well as the libraries themselves
(add-to-list 'load-path "~/.emacs.d/lisp/")
(load-libs "convenience" "editor-behaviour")
;; Add support for the package manager
(require 'package)
;; Add various package archives
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/")
'("melpa" . "http://melpa.milkbox.net/packages/"))
;; Installs packages if they aren't already
(package-refresh-and-install ; from convenience.el
'scala-mode2 'sbt-mode 'haskell-mode 'geiser 'auto-complete 'ac-geiser 'cider)
;; Initialise packages
(package-initialize)
;; libs dependent on the packages being initialized go here
(load-library "autocomplete-config")
;; Enable Haskell indentation
(custom-set-variables
'(haskell-mode-hook '(turn-on-haskell-indentation)))
Running emacs .emacs --debug-init gives me the following output:
Debugger entered--Lisp error: (error "package.el is not yet initialized!")
signal(error ("package.el is not yet initialized!"))
error("package.el is not yet initialized!")
package-installed-p(scala-mode2)
(if (package-installed-p pkg) nil (package-refresh-contents) (package-install pkg))
(while --dolist-tail-- (setq pkg (car --dolist-tail--)) (if (package-installed-p pkg) $
(let ((--dolist-tail-- pkgs) pkg) (while --dolist-tail-- (setq pkg (car --dolist-tail-$
package-refresh-and-install(scala-mode2 sbt-mode haskell-mode geiser auto-complete ac-$
eval-buffer(#<buffer *load*> nil "/Users/ElectricCoffee/.emacs" nil t) ; Reading at $
load-with-code-conversion("/Users/ElectricCoffee/.emacs" "/Users/ElectricCoffee/.emacs$
load("~/.emacs" t t)
#[0 "^H\205\262^# \306=\203^Q^#\307^H\310Q\202;^# \311=\204^^^#\307^H\312Q\202;^#\$
command-line()
normal-top-level()
Which suggests (by my understanding) that it has something to do with convenience.el, but all that's in there is this:
(defun package-refresh-and-install (&rest pkgs)
"Utility function to refresh package contents and install several packages at once"
(dolist (pkg pkgs)
(unless (package-installed-p pkg)
(package-refresh-contents)
(package-install pkg))))
So I'm not exactly sure where I'm making an error here... Any help?
You need to call package-initialize before you call package-refresh-and-install.

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.