1

I get Symbol's value as variable is void: github when I have the following in my .emacs file (the error comes from the last expression):

(require 'package)
(add-to-list 'package-archives
             '("MELPA Stable" . "http://stable.melpa.org/packages/") t)
(add-to-list 'package-archives
             '("gnu" . "http://elpa.gnu.org/packages/") t )

(package-initialize)
(package-refresh-contents)

(package-install 'flycheck)

(global-flycheck-mode)
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(package-selected-packages (quote (haskell-mode idris-mode flycheck))))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

(add-hook 'after-init-hook #'global-flycheck-mode)

(idris-mode
 :repo "idris-hackers/idris-mode"
 :fetcher github
 :files (:defaults "logo-small.png"))
bbarker
  • 11,636
  • 9
  • 38
  • 62

1 Answers1

2

It looks like the last expression in your .emacs file comes from the MELPA recipe for idris-mode. You don't need that in your init file - just type M-x list-packages, find idris-mode in the list, and install it by typing i x. After that, idris-mode will be available every time you start Emacs.

legoscia
  • 39,593
  • 22
  • 116
  • 167
  • Ah, I see. That makes sense. Do you know off hand if there is a way to script package installation from `.emacs`, assuming a package isn't already installed? – bbarker May 10 '18 at 16:29
  • I can ask that as a separate question if it is involved – bbarker May 10 '18 at 16:31
  • 2
    You could use [use-package](https://github.com/jwiegley/use-package), specifying `:ensure t` to install any missing packages. – legoscia May 10 '18 at 16:33
  • 1
    Anyway, you might get more answers to that over at http://emacs.stackexchange.com/. – legoscia May 10 '18 at 16:47